Moogsoft Docs

getToolShares

A Graze API GET request that returns the shared access for a specified tool.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint getToolShares 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 retrieve its shared access for.

Response

Endpoint getToolShares returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

tool_id

Number

ID of the tool you requested to return its shared access for.

domain_ids

Array

An array of all the IDs within the domain that can access the tool. If the domain is global, no domain IDs are returned.

domain

String

Domain that can access the tool. One of: user, team, role, or global.

Examples

The following examples demonstrate typical use of endpoint getToolShares:

Request example

Example cURL request to retrieve all the domain IDs that have access to tool 15:

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/getToolShares" -H "Content-Type: application/json; charset=UTF-8" -d '{"tool_id":15}'

Response example

Example response returning that tool ID 15 can be accessed by team ID 3:

{
    "tool_id": 15,
    "domain_ids": [
        3
    ],
    "domain": "team"
}