Get user role bindings¶
View the roles and default roles of the specified user in the current workspace to provide a basis for adjusting role assignments.
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/iam/users/{user_id}/role-bindings
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First select user.
Prepare personal access token and target workspace ID that can access the target workspace.
Request parameters¶
curl -X GET "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/iam/users/$USER_ID/role-bindings" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
workspace_id |
string |
Yes |
Target workspace ID. |
user_id |
string |
Yes |
The IAM user ID of the accepted member, taken from the iam_user_id of the same record in the user list. |
user_id in the path fills in the iam_user_id returned by the user list, and the member must have accepted the invitation. id in the list is the product account UID and cannot replace iam_user_id. Pending invitations cannot be used with this interface.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"user_id": "user-001",
"binding_version": "binding-v3",
"request_id": "req-001",
"trace_id": "trace-001",
"roles": [],
"default_role_id": "",
"default_role_version": 0
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
success code. |
|
string |
Response information. |
|
object |
The data returned by this operation. |
|
string |
Target user ID. |
|
array of object |
List of roles that the user is directly bound to. Returns an empty array if there is no binding. |
|
string |
Role ID. |
|
string |
Character name. |
|
string |
life cycle status. The values are |
|
integer |
Lifecycle version. |
|
boolean |
Whether it is a system role. |
|
boolean |
Is it optional? |
|
string |
Reason not optional. The value is empty string, |
|
string |
status information. The values are |
|
integer |
Member configuration version. |
|
string |
Current default role ID. Returns an empty string if there is no default role. |
|
integer |
Current default character version. Returns 0 when there is no default role. |
|
string |
Current character binding version tag. |
|
string |
Request association ID. |
|
string |
Link tracking ID. |
Error response¶
The only common errors are code and msg, and data:null is not returned. data is only possible if there is a core authorization error code, which contains the request ID, tracking ID, and core error code.
{
"code": "ErrParamInvalid",
"msg": "请求参数无效"
}
Field |
Type |
Description |
|---|---|---|
code |
string |
error code. |
msg |
string |
error message. |
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
401 |
|
Missing or invalid authentication credentials. |
Check the credential type, expiration, and authentication header. |
403 |
|
The current identity or active role does not have permission for this operation. |
Use an authorized identity or contact an administrator to grant access. |
404 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
409 |
|
Conflict in resource state, request payload, or concurrent modification. |
Re-read the current state and version, then handle according to the latest result. |
500 |
|
Internal processing failed; write operations may have been partially applied. |
Retain request and trace details, and verify the current state before retrying. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |