Hi!
I've tried to add restriction for the page, but I've got 500 status code.
My request was:
POST /wiki/rest/api/content/{id}/restrictionBody:
{
"operation": "update",
"restrictions": {
"group": [
{
"type": "group",
"name": "<group name>"
}
]
}
}
Response:
{
"statusCode": 500,
"message": "java.lang.NullPointerException: null"
}
Returned message isn't informative and solution isn't clear for me :(
Thanks!
Hi @vkochugova and welcome to the community!
Try PUT instead of POST
Update restrictions
PUT /wiki/rest/api/content/{id}/restriction
Updates restrictions for a piece of content. This removes the existing restrictions and replaces them with the restrictions in the request.
Permissions required: Permission to edit the content.
Connect app scope required:
WRITEOAuth 2.0 scopes required:ClassicRECOMMENDED:write:confluence-content
Hi @Alex Koxaras -Relational- !
Of course I've tried!
Also I've tried different groups and I didn't get anything
if it will be useful, the GET request works fine, that is the path and the Auth creds are correct. Also it's possible to add restrictions via Web UI
Thanks!
UPD SOLVED:
PUT /wiki/rest/api/content/{id}/restriction/byOperation/update/group/{group_name}PUT /wiki/rest/api/content/{id}/restriction/byOperation/update/user?accountId={current user ID}
Hopefully someone will fix this in the documentation.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alex Koxaras -Relational- This API works and update the restriction for user. Could you please help with the API endpoint to update the group.
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.