Is there a way to restore archived page via REST API?

Yana Strabuk
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!
January 28, 2022
curl --location --request PUT 'https://{address}/rest/api/content/{contentId}' \

--header 'Authorization: {token}' \

--header 'Content-Type: application/json' \

--data-raw '{

"type": "page",

"title": "{title}",

"version": {

"number": {version}

},

"status": "current"

}'
the request fails with the following error:
{

"statusCode": 403,

"data": {

"authorized": false,

"valid": true,

"errors": [],

"successful": false

},

"message": "com.atlassian.confluence.api.service.exceptions.PermissionException: Could not update Content of type : class com.atlassian.confluence.pages.Page with id {id}"
}
is it possible to restore a page via api? as the request above works for trashed or draft pages and gets no authorization error (checked several times while token was valid)

1 answer

1 accepted

4 votes
Answer accepted
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 28, 2022

Hi @Yana Strabuk 

Welcome to Confluence

There is no API to restore the page!!

The above one works for both trashed or draft as these are valid values

https://developer.atlassian.com/cloud/confluence/rest/api-group-content/#api-wiki-rest-api-content-id-put

Valid.png

Thanks for noticing this!!

Thanks,
Pramodh

Yana Strabuk
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!
January 30, 2022

Thank you! Is it going to be added to the API later on? And is it possible to check the status of the issue, if this functionality will be added?

Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 30, 2022

@Yana Strabuk 

We would have to check with the Atlassian team on this one. Will raise the ticket and keep posted!!

Thanks

Rob Fleming
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!
October 27, 2022

Did you ever get a response from Development this one?

 

It seems the CQl searching isn't working either 

"IncludeArchivedSpaces=true" or "IncludeArchivedSpaces=true&excludeCurrentSpaces=true"

returning zero records 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events