Hi,
I'm trying to remove page read restrictions with the below REST call.
function removePageRestriction() {
const bodyData = `[{
"content": {
"expanded": true,
"idProperties": {}
},
"operation": "read",
"restrictions": {
"user": {},
"group": {}
}
} ]`;
fetch('https://MYIP/rest/api/content/2367857478/restriction', {
method: 'PUT',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
})
.then(response => { alert( `Response: ${response.status} ${response.statusText}` );
return response.text(); })
.then(text => alert(text)) .catch(err => alert(err));
}
But upon execution, I receive an error 405.
Note: the code is taken from https://developer.atlassian.com/server/confluence/rest/v920/api-group-content-restrictions/#api-rest-api-content-id-restriction-put
I have no issues reading the restrictions of that page by using https://developer.atlassian.com/server/confluence/rest/v920/api-group-content-restrictions/#api-rest-api-content-id-restriction-byoperation-get
Has anyone successfully removed page restrictions from confluence pages via REST API?
Or - even better - is there any Confiforms IFTTT method to REMOVE all restrictions from a page (Setting restrictions is easy, but removing?)?
Regards,
Dirk
The solution can be found here:
https://community.developer.atlassian.com/t/remove-page-restrictions-via-rest-api/86971/9?u=dirkeyfrig
On pre 8.8.0 installations, the path is /rest/experimental/content/{contentId}/restriction,
from 8.8.0 onwards it should be /rest/api/content/{contentId}/restriction
Hi @Dirk Eyfrig
Does this work ?
/rest/api/content/{contentId}/restriction/byOperation/read
{
"restrictions": {
"user": [],
"group": []
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
unfortunately not, I receive the same error 405. I've also tried /experimental/ instead of /api/, as proposed by someone else, but that just gives me an error 404.
I'm giving up on this, possibly it's a specific issue of our setup...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.