Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the content page details through rest api service for confluence in trail version?

karthick tgi January 2, 2019

Hi Team,

I am using the free trail version for confluence.

I create a multiple pages & blogs.

I am trying to get the page details through http api service("http://karthicksivan.atlassian.net/confluence/rest/api/content?type=page&spaceKey=TECHGLOBAL&title=Testingwithslack&expand=space,body.view,version,container").

Finally i got the response details only in html page. Refer the attachment in below the screenshot.

confluence_api_service_response.pngIf you have any solutions., please do share..

2 answers

0 votes
Shradha Singh August 6, 2019

Hi,

I have a similar question, can we use Wiki REST API to get all pages which are created in last 24 hours in a given Space Key.

Please suggest.

 

Regards
Shradha

0 votes
David at David Simpson Apps
Atlassian Partner
January 2, 2019

Hello, 

It looks like the page you're getting is for Jira Service Desk rather than the Confluence REST endpoint - see the page title "Service Desk"

Try using this URL instead:

https://karthicksivan.atlassian.net/wiki/rest/api/content?type=page&spaceKey=TECHGLOBAL&title=Testingwithslack&expand=space,body.view,version,container

I get the following which appears to be much more healthy considering I cannot authenticate against your site:

{"statusCode":403,"data":{"authorized":false,"valid":true,"errors":[],"successful":false},"message":"Not permitted to use confluence"}

 

I've used Postman to do something very similar and get JSON returned:

Screen Shot 2019-01-02 at 14.54.15.png

Here's how it's represented as a CURL:

curl -X GET \
'https://dvdsmpsn.atlassian.net/wiki/rest/api/content?type=page&title=Configuration&spaceKey=analytics&expand=space,body.view,version,container' \
-H 'Authorization: Basic *******' \
-H 'Content-Type: application/json' \
-H 'Cache-Control: no-cache'

I've hidden my auth string, sorry ;)

Some things that I particularly notice:

  1. You're using /confluence/rest rather than /wiki/rest in the URL. I'm not sure why that is.
  2. I'm setting a Content-Type header
  3. I'm using Basic Auth - I don't know what you're using for authentication

 

Also note, that this page is open access, so the REST API can be accessed at...

https://dvdsmpsn.atlassian.net/wiki/rest/api/content?type=page&title=Configuration&spaceKey=analytics&expand=space,body.view,version,container

...if you want to test things out.

 

karthick tgi January 2, 2019

thanks for your update @David at David Simpson Apps

David at David Simpson Apps
Atlassian Partner
January 3, 2019

@karthick tgi check the latest update above.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events