Queries all roles defined in a specified project, including role names, descriptions, and creator details.
Endpoint and authorization information
- Get the endpoint: Replace {domain} in the API request syntax.
- Get a personal access token.
|
Product |
Resource |
Required permission |
|
Project Collaboration |
Project roles |
Read-only |
Request syntax
Region edition
GET https://{domain}/oapi/v1/projex/projects/{id}/roles
Request headers
|
Parameter |
Type |
Required |
Description |
Example value |
|
x-yunxiao-token |
string |
Yes |
The personal access token for authentication. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
|
Parameter |
Type |
Location |
Required |
Description |
Example value |
|
id |
string |
path |
Yes |
The unique project identifier. |
589c53d622cc8521793e08**** |
Request examples
Region edition
curl -X 'GET' \
'https://{domain}/oapi/v1/projex/projects/589c53d622cc8521793e08****/roles' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
Response parameters
|
Parameter |
Type |
Description |
Example value |
| - |
array |
|
|
| - |
object |
|
|
| creator |
object |
The user who created the role. |
|
| id |
string |
User ID. |
674d96abd497cd558d68**** |
| name |
string |
Username. |
user-name-xxx |
| description |
string |
Role description. |
Participant |
| gmtCreate |
string |
Creation timestamp. |
|
| gmtModified |
string |
Update timestamp. |
|
| id |
string |
The role ID. |
1111 |
| modifier |
object |
The user who last modified the role. |
|
| id |
string |
User ID. |
674d96abd497cd558d68**** |
| name |
string |
Username. |
user-name-xxx |
| name |
string |
Role name. |
Participant |
Response example
[
{
"creator": {
"id": "674d96abd497cd558d68****",
"name": "user-name-xxx"
},
"description": "Participant",
"gmtCreate": "",
"gmtModified": "",
"id": "1111",
"modifier": {
"id": "674d96abd497cd558d68****",
"name": "user-name-xxx"
},
"name": "Participant"
}
]
Error codes
For API-related error codes, see Error Code Center.