Forums

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

Confluence Rest API Error

Harvey Bennett
Contributor
July 30, 2019

Is my URL not structured properly?

http://localhost:8090/confluence/rest/api/content?title=Pagetitle&spaceKey=MBS&expand=body.storage

Does anyone have any suggestions on why this URL is not working? I created a page earlier using JSON, REST, & PHP with no problem but now that when I'm trying to retrieve ANY pages contents I'm just receiving a not found error. I am currently just trying to test this in browser with the same success level as my CURL request I built out using PHP. 

2 answers

1 accepted

1 vote
Answer accepted
Thomas Deiler
Community Champion
July 31, 2019

Dear @Harvey Bennett ,

I assume, that you access your Confluence normally with this URL from any browser:

http://localhost:8090/confluence

Then the correct REST API for getting content would be:

http://localhost:8090/confluence/rest/api/content?title=Pagetitle&spaceKey=MBS&expand=body.storage

If your Confluence is located at

http://localhost:8090/

The REST API call would look like

http://localhost:8090/rest/api/content?title=Pagetitle&spaceKey=MBS&expand=body.storage

If all of this doesn't help, try this to check if the REST API works at all:

http://localhost:8090/rest/api/user/current

This should return information about your own login. And please post the returned error message, if this issue is not solved.

So long

Thomas

Harvey Bennett
Contributor
July 31, 2019

@Thomas Deiler All of these URL's are returning what I show in the image below. I am not getting an error. The page loads just the content on the page says the page is not found. The same information is returned with my cURL call in code. Is there something that I have to enable to make rest calls? The account that I'm using to access this information is a system admin. I just installed Confluence yesterday to do some testing on my own. Confluence version is 6.8 and it run on MySQLmissinginformation.png

Thomas Deiler
Community Champion
July 31, 2019

Dear @Harvey Bennett ,

possibly the REST API is disabled. Have a look at this page to double check.

So long

Thomas

Thomas Deiler
Community Champion
July 31, 2019

Dear @Harvey Bennett ,

I checked it on my own and found out, that the endpoint description of Atlassian of the REST API was incorrect - I looked at an outdated page :(. The current API.

The upper URLs were fixed by me.

So long

Thomas

0 votes
Harvey Bennett
Contributor
August 1, 2019

@Thomas Deiler I didn't realize the API was disabled by default after it is installed. I should have checked before asking! Thanks for the insight :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events