Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I edit confluence space permissions by rest api?

Ronaldo Huang
Contributor
November 16, 2020 edited

How can I edit confluence space permissions by rest api?

Do the same as UI http://mydomain/spaces/doeditspacepermissions.action?key=MySpace do.

Is any rest api available? 

 

I have tried what the section 'Get users and groups assigned as Space Administrators to a Space' in document https://jira.atlassian.com/browse/CONFSERVER-44329 says.

But the response is {"id":7,"error":{"code":-32601,"message":"RPC method not found: getSpacePermissionSet taking 0 parameters","data":null},"jsonrpc":"2.0"}

 

Then I tried uri /rpc/json-rpc/confluenceservice-v2/getSpacePermissionSets?os_authType=basic , my request body is {"type":"VIEWSPACE","spacePermissions":"[{\"type\":\"VIEWSPACE\",\"groupName\":\"leader\"}]"}.

But the response is {"id":null,"error":{"code":-32602,"message":"Request parameter types did not match method parameter types (method getSpacePermissionSets taking 1 parameters)","data":null},"jsonrpc":"2.0"}

2 answers

1 accepted

0 votes
Answer accepted
Ronaldo Huang
Contributor
November 16, 2020

Finally, I see the document https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-add-space-permissions-using-Confluence-API/qaq-p/516789

POST URI 

/rpc/json-rpc/confluenceservice-v2/addPermissionsToSpace

is very useful. 

0 votes
Moses Ebrahimi
Contributor
August 3, 2023

Hi @Ronaldo Huang 

I know this is from long time ago, but were you able to structure the data for addPermissionsToSpace? 

Im trying below data and keep getting the error you posted on top

    data = {
        "jsonrpc" : "2.0",
        "method" : "addPermissionToSpace",
        "params" : [
            {
                "permission": permission_type,
                "remoteEntityName": group_name,
                "spaceKey": space_key
                }
            ],
        "id" : 7
    }
{'id': 7, 'error': {'code': -32601, 'message': 'RPC method not found: addPermissionToSpace taking 1 parameters', 'data': None}, 'jsonrpc': '2.0'}
Appreciate it if you can share your findings please
Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian community, loom ai, atlassian loom ai, loom, atlassian ai, record recaps of meetings, meeting recaps, loom recaps, share meeting recaps,

Loom’s guide to great meetings 📹

Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.

Register today!
AUG Leaders

Atlassian Community Events