Description
Returns a list of all groups that a user is a part of in a particular company.
GET
/v1/security/users/{userId}/groups
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
userId | path | string | true | The ID of the User. |
pageSize | query | integer | false | Limit number of results returned (Max 100). |
page | query | integer | false | Page number to retrieve in the paginated results (0-based index). |
Code Samples
curl -X GET https://h.app.wdesk.com/s/wdata/oc/api/v1/security/users/{userId}/groups \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
http GET https://h.app.wdesk.com/s/wdata/oc/api/v1/security/users/{userId}/groups \
Accept:application/json \
Authorization:"Bearer {access-token}"
wget --method=GET "https://h.app.wdesk.com/s/wdata/oc/api/v1/security/users/{userId}/groups" \
--output-document - \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://h.app.wdesk.com/s/wdata/oc/api/v1/security/users/{userId}/groups', headers = headers)
print(r.json())
Returns
200 - OK
Returns a UserGroupsResponse
containing an array of UserGroup
objects for the provided userId
.
Example Responses
{
"data": [
{
"id": "1",
"name": "Admins",
"default": true,
"created_at": "2018-03-14 20:10:39.520585"
}
]
}