Forums

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

Error 404 when reading a page with API

Fabian Ischia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 17, 2019

I'm trying to read Confluence pages using the APIs. Every attempt to read a page ends in error 404. I have tried various URL formats:

curl -X GET -u <USERNAME>:<API TOKEN> -H "Accept: application/json" 'https://<MY COMPANY DOMAIN>/wiki/rest/api/content/898042287'
curl -X GET -u <USERNAME>:<API TOKEN> -H "Accept: application/json" 'https://<MY COMPANY DOMAIN>/confluence/rest/api/content/898042287'
curl -X GET -u <USERNAME>:<API TOKEN> -H "Accept: application/json" 'https://<MY COMPANY DOMAIN>/wiki/spaces/ds/pages/898042287'

I can create a new page without problems, the page ID on the above example is from the newly created page using the API, it is jut the GET commands that fail

I followed all different versions of the API documentation online, but none of them works. Also tried using Python with same results. I can always create pages, but I cannot read them.

I assume the URL might be incorrect for the latest version of Confluence Cloud?

1 answer

1 accepted

0 votes
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 20, 2019

Hello Fabian,

Thank you for reporting your issue along with the examples you provided. I tested the following on a Mac using Conflund cloud and found I was able to GET pages without issue:

curl --request GET \
 --url 'https://DOMAIN.atlassian.net/wiki/rest/api/content/123456' \
 --user 'email@example.com:<api_token>' \
 --header 'Accept: application/json'

To see where the disconnect might be, you stated you’re using REST API calls to create content but you’re unable to GET the content you’ve created. Could you please show us the REST API POST or PUT calls you’re making against Confluence?

Once we have the REST API calls you’re using that work we might be able to find the issue with getting your GET calls working.

Regards,
Stephen Sifers

Fabian Ischia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 21, 2019

Hi Stephen, thanks for the response. I just tried the same script from Friday and today they are working. I guess it was some glitch on the servers. 

Like Stephen Sifers likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events