Share resources

💡 2 min read

Learn how to share resources with users or groups


You can use the API to share resources with users or groups by sending a POST request to the resource's relative @sharing endpoint.

# Share a Workspace with a user

Enter the user's email address as a value of the principal parameter.

curl --request POST \
  --url https://enterprise.onna.com/api/ACMECORP/ACMECORP/workspaces/WORKSPACE_ID/@sharing \
    --header 'Authorization: Bearer dem0d3moOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MDc2MDIwODAsImV4cCI6MTYwODIwNjg4MCwidG9rZW4iOiIxZjNmMjFhYTZkZDU0NWM1OGFjMjgzOTRmMmMyMGJmOSIsImxvZ2luIjoic3RlZmFub0Bvc2NpbGxhdG9yLmVzIiwibmFtZSI6IlN0ZWZhbm8iLCJzdXBlcnVzZXIiOmZhbHNlLCJhaWQiOm51bGwsInN1YiI6InN0ZWZhbm9Ab3NjaWxsYXRvci5lcyIsImF2IjoxLCJndCI6ImF1dGhvcml6YXRpb25fY29kZSJ9.gemyMZfMTmjoWG-bnfJ6ts0u4defsb59P2Pf4kefAke'
  --data '{
    "prinrole": [
        {
            "setting": "Allow",
            "principal": "ACMEUSER@ACMECORP.COM",
            "role": "guillotina.Owner"
            }
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12

Where:

  • principal is the email address of the user you want to share the Workspace with

For more information about sharing Workspaces with users, check the article about managing Workspaces.

# Share a Workspace with a group

Enter the group ID as a value of the principal parameter. All users that are members of that group will get access to the Workspace.

Retrieve the group ID first

To retrieve the group ID, you can make a GET request to the @groups endpoint. For example, https://enterprise.onna.com/api/ACMECORP/ACMECORP/@groups. Remember that all requests must be authenticated with an auth token.

curl --request POST \
  --url https://enterprise.onna.com/api/ACMECORP/ACMECORP/workspaces/WORKSPACE_ID/@sharing \
    --header 'Authorization: Bearer dem0d3moOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MDc2MDIwODAsImV4cCI6MTYwODIwNjg4MCwidG9rZW4iOiIxZjNmMjFhYTZkZDU0NWM1OGFjMjgzOTRmMmMyMGJmOSIsImxvZ2luIjoic3RlZmFub0Bvc2NpbGxhdG9yLmVzIiwibmFtZSI6IlN0ZWZhbm8iLCJzdXBlcnVzZXIiOmZhbHNlLCJhaWQiOm51bGwsInN1YiI6InN0ZWZhbm9Ab3NjaWxsYXRvci5lcyIsImF2IjoxLCJndCI6ImF1dGhvcml6YXRpb25fY29kZSJ9.gemyMZfMTmjoWG-bnfJ6ts0u4defsb59P2Pf4kefAke'
  --data '{
    "prinrole": [
        {
            "setting": "Allow",
            "principal": "f40d7254-9aa6-11ea-841e-8a5506e5def8",
            "role": "guillotina.Owner"
            }
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12

Where:

  • principal is the ID of the group you want to share the Workspace with

Last Updated: 2/21/2022, 4:01:44 PM