Updated on 2025-11-17 GMT+08:00

Obtaining Workspace Roles

Function

This API is used to obtain the roles of a workspace.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/users/role

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain it, see Project ID and Account ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

instance_id

No

String

DataArts Studio instance ID. For details about how to obtain it, see Instance ID and Workspace ID.

workspace_id

No

String

Workspace ID. For details about how to obtain it, see Instance ID and Workspace ID.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. This parameter is mandatory for token authentication. Call the "Obtaining the User Token" API of IAM to obtain the value of X-Subject-Token in the response header.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

[items]

Array of ApigRoleVo objects

List of roles in a DataArts Studio workspace

Table 5 ApigRoleVo

Parameter

Type

Description

role_id

String

Role ID

role_code

String

Role code

role_name

String

Role name

description

String

Role description

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_msg

String

Returned error information.

error_code

String

Returned error code.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_msg

String

Returned error information.

error_code

String

Returned error code.

Example Requests

None

Example Responses

Status code: 400

Bad request.

{
  "error_code" : "DAYU.4402",
  "error_msg" : "The operation failed, detail msg {0}."
}

Status code: 500

Internal server error.

{
  "error_code" : "DAYU.3531",
  "error_msg" : "Internal server error: {0}"
}

Status Codes

Status Code

Description

200

Roles of the workspace are returned.

400

Bad request.

500

Internal server error.