Moogsoft Docs

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

auth_token

String

Yes

A valid auth_token returned from the authenticate request. See the authenticate endpoint for more information.

tool_id

Number

Yes

ID of the tool that you want to share access for.

domain

String

Yes

Domain to share access with. One of: user, team, role, or global.

domain_ids

Array

Yes/No

An array of one or more IDs within the domain. Optional for the global domain.

Response

Endpoint shareToolAccess returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

domain_ids

Array

An array of the IDs for the domain that you requested to share tool access with.

domain

String

Domain that you requested to share access with. One of: user, team, role, or global.

tool_id

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
}