Page content status / get and set via REST API

Is there a way to get/set the new page content statuses via REST API?

I do see we can get the status with expand=metadata.properties.content_state_draft,metadata.properties.content_state_published

It returns some interesting-looking JSON values. In this example, it’s a custom “Published” status.

Obtained with this GET call: /wiki/rest/api/content/835059848?expand=metadata.properties.content_state_draft,metadata.properties.content_state_published

Result:

Any official API for this, to get all available content status etc?

  • Why are there 2 statuses content-state-published, and content-state-draft? In my tests both were populated with the same value. (but different value ‘versions’)
  • Getting the value and parsing it as JSON could work, but not sure if Atlassian intended this
  • Setting the value to this undocumented JSON value does seem a bit shaky
2 Likes

Additional questions appear related to our App Content Property Editor.

Usually, content properties are stored as valid JSON; thus, you can display single properties using a JSON path. However, the JSON value for both content-state-published and content-state-draft are not valid JSON… they are escaped.

Can someone on Atlassian’s side comment on this? Is it a bug?

2 Likes