getUserTeams
A Graze API GET request that returns the team names and IDs associated with the specified user ID or username.
Back to Graze API EndPoint Reference.
Request arguments
Endpoint getUserTeams
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | A valid |
| Number | No, if you specify | A valid user ID. |
| String | No if you specify | A valid username. |
Response
Endpoint getUserTeams
returns the following response:
Successful requests return an array of JSON objects containing the following:
Name | Type | Description |
---|---|---|
JSON Object | JSON | A Javascript object containing the user ID and the teams that the user belongs to. |
Examples
The following examples demonstrate typical use of endpoint getUserTeams
:
Request example
Example cURL request to return the teams that user "admin" belongs to.
curl -G -u graze:graze -k -v "https://localhost/graze/v1/getUserTeams" \ --data-urlencode "username=admin"
Response example
Example response returning the teams associated with username "admin":
[ { "id" : 11, "name" : "Cloud DevOps" }, { "id" : 12, "name" : "Network" }, { "id" : 2, "name" : "Application Support" } ]