Querying the User Role Information
Function
This API is used to obtain the role information of a specified user in the system. This API is used when you need to know the permissions and roles of a user in the system. The administrator or system can use this API to query the role information of the user. Before using this API, ensure that the user exists and the role information is defined in the system. After the query, the API returns the role list of the user. If the user does not exist or the role information is not defined in the system, the API returns an error message.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET /v1/{project_id}/workspaces/users/roles
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: User project ID. For details, see Obtaining a Project ID and Name. Constraints: The value can contain 1 to 64 characters. Letters, digits, and hyphens (-) are allowed. Range: N/A Default Value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition: User token. It can be obtained by calling the IAM API. The token is the value of X-Subject-Token in the response header. Constraints: N/A Range: N/A Default Value: N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
roles |
Array of strings |
Definition: User role. |
Example Requests
None
Example Responses
Status code: 200
Query the user role information.
{
"roles" : [ "gray_workspace" ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Query the user role information. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot