shareToolAccess
A Graze API POST request that shares access to a tool with other users, teams, or roles, or makes it global so that all users can access it. When a user creates a tool, it is automatically shared globally. You can use this endpoint to restrict its availability and ensure that tools are only available to users who need them. Using this endpoint to share access to a tool overwrites any existing shares.
Back to Graze API EndPoint Reference.
Request arguments
Endpoint shareToolAccess
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | A valid |
| Number | Yes | ID of the tool that you want to share access for. |
| String | Yes | Domain to share access with. One of: |
| Array | Yes/No | An array of one or more IDs within the domain. Optional for the |
Response
Endpoint shareToolAccess
returns the following response:
Type | Description |
---|---|
HTTP Code | HTTP status or error code indicating request success or failure. See HTTP status code definitions for more information. |
Successful requests return a JSON object containing the following:
Name | Type | Description |
---|---|---|
| Array | An array of the IDs for the domain that you requested to share tool access with. |
| String | Domain that you requested to share access with. One of: |
| Number | ID of the tool you requested to share access with. |
Examples
The following examples demonstrate typical use of endpoint shareToolAccess
:
Request example
Example cURL request to share access of tool ID 15 with team ID 3:
curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/shareToolAccess" -H "Content-Type: application/json; charset=UTF-8" -d '{"tool_id":15, "domain":"team", "domain_ids":[3]}'
Response example
Example response returning that the request to share access of tool ID 15 with team ID 3 was successful:
{ "domain_ids": [ 3 ], "domain": "team", "tool_id": 15 }