/auth/v1/users/<user_ID>/roles: GET

Gets the list of roles that are assigned to a user.

The following table shows which roles can access this REST API endpoint:
Table 1. Access by role
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>/roles

Supported request types and response formats

Supported request types:
  • GET
Supported response formats:
  • JSON

Examples

The following example shows how to get the list of roles that are assigned to a user.

Request:
curl -k -H ‘Authorization: Bearer <token>’ https://<spectrum_discover_host>/auth/v1/users/4ee5b47f439640d29b6fac7253a64290/roles 

Response:

(200 OK): 
{ 
    "roles": [ 
        { 
            "domain_id": null, 
            "id": "4a5415cb9cc5460aafe12a6f6206448e", 
            "name": "datauser" 
        } 
    ] 
}