Forums

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

Cannot get info with page-id using REST API

hgaviyappa@vmware.com
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!
July 28, 2018

hgaviyappa@localhost: confluence $curl -H "Authorization: f4TqMwy7tkeJf3h3cabt5C17" -X GET "https://confluence.eng.vmware.com/rest/api/content/129820786/property" | python -mjson.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 154 0 154 0 0 6364 0 --:--:-- --:--:-- --:--:-- 6416
{
"data": {
"authorized": false,
"errors": [],
"successful": false,
"valid": true
},
"message": "Cannot find content with id ContentId{id=129820786}",
"statusCode": 404
}
(confluence) hgaviyappa@localhost: confluence $

 

I am sure I am using the right page-id. 

My page path: https://confluence.eng.vmware.com/display/<space_name>/<header>

How can i solve this issue.

 

 

1 answer

0 votes
Zak Laughton
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 30, 2018

 

It appears you are trying to reach the Confluence Server REST API using an access token. Confluence only supports basic authentication for API requests (though we have a feature request for extended authentication functionality here: CONFSERVER-55421).

The following command should work (after inserting your username/password):

curl -u username:password -X GET "https://confluence.eng.vmware.com/rest/api/content/129820786/property" | python -mjson.tool

For more code examples, see Confluence REST API examples.

(As a sidenote: I assume that is a test API token in your question, but if that API token is from some public, production application, I recommend revoking/regenerating the token for security purposes, since it has been published to this public forum.)

Thanks!
Zak

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events