How to escape group names in the Confluence Cloud API

青山 明 September 15, 2022

Using the following APIs in the confluence Cloud API, I want to grant group permissions.

API: /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}

But if the group name contains spaces.  e.g. test group.

The space is a problem and the API URL is invalid.

Example: /wiki/rest/api/~/group/test group

Is there any way to escape this?

There is also a method to specify the group ID, but in order to obtain the group ID, it is necessary to specify the group name in the same way, which requires escaping.

1 answer

1 accepted

0 votes
Answer accepted
青山 明 September 16, 2022

Was self resolved.

aorlov September 16, 2022

Hi @青山 明 

It is better not to use group name. It can be changed. 

You should use groupId. You can get group id with https://developer.atlassian.com/cloud/confluence/rest/api-group-group/#api-wiki-rest-api-group-get . Get all groups, find group by name and send groupId.

 

Kind regards

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events