/auth/v1/users/<user_ID>/groups: GET
Gets the details of the groups to which a specific user belongs.
The following table shows which roles can access this REST API endpoint:
Data admin | Data user | Collection Admin | Admin | Service user |
---|---|---|---|---|
✓1 | ✓1 | ✓ | ✓ | ✓1 |
1The specified user ID must be the same as the requesting user ID. Otherwise the command fails with error 403, "Not authorized". |
Synopsis of the request URL
curl -k -H ‘Authorization: Bearer <token>’ https://<spectrum_discover_host>/auth/v1/users/<user_ID>/groups
Supported request types and response formats
Supported request types:
- GET
- JSON
Examples
The following example shows how to get the details of the groups to which a specific user belongs.
Request:
curl -k -H ‘Authorization: Bearer <token>’ https://<spectrum_discover_host>/auth/v1/users/ 4ee5b47f439640d29b6fac7253a64290/groups
Response:
{
"groups": [
{
"name": "test-group1",
"description": "Test Group 1",
"domain": "default"
},
{
"name": "test-group2",
"description": "Test Group 2",
"domain": "default"
}
]
}