Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Access page content via URL

Jonathan Simonoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 28, 2013

Is there a way to get a page's content only, without the page frame, via url? I mean something like:

http://myconfluence.com/display/SSPACE/some+page?format=contentonly

Thanks!

6 answers

1 accepted

0 votes
Answer accepted
Jonathan Simonoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2015

There is no real answer.  The closest I've come is to use xml/rpc to get a rendered version of the page – in that case, you can get it without the page frame.

3 votes
SarahA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 29, 2013

Hallo Jonathan

You can use the REST API to get the page content. For example, to get the content of this page:

https://confluence.atlassian.com/display/DOC/Confluence+Documentation+Home

Use this format:

https://confluence.atlassian.com/rest/prototype/1/content/135922

The number "135922" is the unique page ID as generated by Confluence for each page. You can see it in the URL when you edit a page, for example.

However, the REST API returns the HTML plus Confluence-specific elements as used in the Confluence storage format. You'd need some way of parsing them and putting them into a pretty format.

Here's the documentation on the REST API:

https://developer.atlassian.com/display/CONFDEV/Using+the+REST+APIs+-+Prototype+Only

Graham Hannington provides some resources that you may find useful:

http://www.amnet.net.au/~ghannington/confluence/

Cheers

Sarah

Jonathan Simonoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2015

Thanks, Sarah. The parsing and rendering is the hard part.

1 vote
SarahA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 4, 2013

Hallo again Jonathan

Oh wow, this could be what you need: Just add the URL parameter "decorator=printable".

Examples:

https://confluence.atlassian.com/display/DOC/Confluence+Documentation+Home?decorator=printable

https://confluence.atlassian.com/display/DOC/Database+Configuration?decorator=printable

I remembered it in the middle of the night. Someone gave me the hint a couple of years ago, when I was trying my hand at gadget development and needed some pretty page content without the chrome.

:)

Cheers

Sarah

Jonathan Simonoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2015

Thanks, again, Sarah. That is a bit better, and points temptingly in the direction I was going for, but doesn't get there.Still too much page decoration.

0 votes
Jonathan Simonoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2015

What I was looking for was the rendered page contents -- that shows the storage format, doesn't it?

0 votes
JK Kim January 12, 2015

Hi jonathan! is this issue solved? I am having same problem for weeks. What I found is ... (if you are in any given confluence page) Tools>View Source Here you can get the URL, but it is not complete solution. it shows well page content without having macros. please re-touch with this issue. from JK

0 votes
William Zanchet [Atlassian]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2013

Hi Jon,

Just adding in what Sarah said, you could try to use this third party plugin: https://marketplace.atlassian.com/plugins/org.swift.confluence.acli

That Allow Atlassian CLI commands to be easily run from within Confluence. The Atlassian CLI provides actions for remotely accessing Atlassian products including Confluence, JIRA, Bamboo, Crucible, and FishEye. This enables administrators to document and run automation. This also enables administrators to provide selective automation capabilities to users using techniques like the Run macro. It is recommended that the Macro Security Plugin be used to control access to trusted users.

Is like a terminal.

Cheers,

WZ

Jonathan Simonoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2013

Thanks, William. I know about the CLI. My need here is to use Confluence content outside Confluence, so the plugin isn't relevant. As for the CLI itself, I think it is for command line use, rather than use in a web page. Sarah's answer works better, although given that it returns XML it isn't really what I was looking for either (I'd like to be able to pass a parameter to render it into HTML, rather than having to do that myself. It may be, though, that this problem is a side-effect of getting rid of wiki markup -- the "HTML" (really XML) has gotten quite a bit more complicated, and reuse outside of the wiki is not easy.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events