-
Type:
Bug
-
Resolution: Not a bug
-
Priority:
Low
-
None
-
Affects Version/s: 6.13.0
-
Component/s: Core - Content REST APIs
-
None
-
1
-
Severity 3 - Minor
Summary
Fetching draft data using REST will return a 404 error code.
Steps to Reproduce
- Create a page and publish it
- Edit the page and exit the editor, choose keep draft if necessary
- Get the contentid of the draft
- Execute the following REST call to fetch the draft data:
curl -u <USERNAME>:<PASSWORD> -X GET "http://<DOMAIN>/rest/api/content/<DRAFT-CONTENTID>" | python -mjson.tool
Expected Results
Draft content is returned as expected.
Actual Results
Draft content is not returned. Instead, this is what we see:
{
"data": {
"authorized": false,
"errors": [],
"successful": false,
"valid": true
},
"message": "No content found with id: ContentId{id=<ID>}",
"statusCode": 404
}
Workaround
It is not possible to access the content ID for drafts directly. Instead, if you need to fetch draft data, use the content ID of the published version of the page and add status=draft to the request. Example:
/rest/api/content/101112?status=draft
In this request 101112 is the content ID of the last published version of this page.