Help Center/ CodeArts Req/ API Reference/ APIs/ User Information/ Obtains the role of the current user.
Updated on 2023-06-12 GMT+08:00

Obtains the role of the current user.

Function

Obtaining the Role of a User in a Project

URI

GET /v4/projects/{project_id}/user-role

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the 32-bit ID of the devcloud project.

Minimum: 32

Maximum: 32

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies a user token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Minimum: 10

Maximum: 32768

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

user_role

Integer

User Role ID Member Role, -1: project creator, 3 project manager, 4 developers, 5 test manager, 6 test personnel, 7 participant, 8 viewer, 9 O&M manager

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_msg

String

Description

error_code

String

Error Codes

Status code: 401

Table 5 Response body parameters

Parameter

Type

Description

error_msg

String

Description

error_code

String

Error Codes

Example Requests

Get https://{endpoint}/v4/projects/526cefde62004de2b62b5e8dd2c2b3af/user-role

Example Responses

Status code: 200

OK

{
  "user_role" : 3
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.