Details
-
Bug
-
Resolution: Unresolved
-
Low
-
1
-
Minor
-
Description
Issue Summary
When using the REST API to update a page, if it has the View representation under the body's value, the update will not work.
Although it will provide a "200" response, no changes will be done to the page nor a new version will be created.
Steps to Reproduce
Make sure to have a valid API token to use the API.
- As a user with permission to edit/add pages in a space, use the REST API to update the body of the pages.
- Make sure to use the representation as "view" under the body of the page.
- Run the update.
As an example, these would API calls with "View" as the representation:
curl --request PUT \ --url 'https://INSTANCE.atlassian.net/wiki/rest/api/content/<content-id>' \ -u '<EMAIL>:<API TOKEN>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "version": { "number": 10 }, "title": "Creating a page to be changed via API", "type": "page", "body": { "view": { "value": "<p>PAGE BODY</p>", "representation": "view", } } }'
With an ID for the body:
curl --request PUT \ --url 'https://instance.atlassian.net/wiki/rest/api/content/<content-id>' \ -u '<EMAIL>:<API-TOKEN>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "version": { "number": 10 }, "title": "Creating a page to be changed via API", "type": "page", "body": { "view": { "value": "<p>TEXT HERE</p>", "representation": "view", "content": { "id": "BODY-ID" } } } }'
Expected Results
The API should update the page content or an error message should be displayed.
Actual Results
The page is not updated and no error messages will be displayed.
Workaround
Different workarounds can be used for this one:
- Use the REST API to convert the representation format to a different one.
- Use a different representation to update the page (I.E. atlas_doc_format or storage)