GetRole - Query role information

Updated at:

Retrieves the details of a specified role, including its name and permissions.

Applicable editions

Central edition, Region edition

Endpoints and authorization information

  • Obtain an endpoint to replace {domain} in the API request syntax.

  • Obtain a personal access token.

  • Obtain the organizationId, which is required only for the Central edition, from the Basic Information page in the Organization Management console.

Product

Resource

Required permission

Organization Management

Organization role

Read-only

Request syntax

Central edition

GET https://{domain}/oapi/v1/platform/organizations/{organizationId}/roles/{id}

Region edition

GET https://{domain}/oapi/v1/platform/roles/{id}

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

The personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Position

Required

Description

Example

organizationId

string

path

  • Yes: Central

  • No: Regional

The organization ID.

id

string

path

Yes

The role ID.

Request examples

Central edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/platform/organizations/{organizationId}/roles/{id}' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/platform/roles/{id}' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example

-

object

id

string

The role ID.

99d1****6124

name

string

The role name.

Sample Name

organizationId

string

The organization ID.

99d1****6124

permissions

array[string]

The permissions assigned to the role.

["base******"]

Response example

{
    "id": "99d1****6124",
    "name": "Sample Name",
    "organizationId": "99d1****6124",
    "permissions": ["base******"]
}

Error codes

For error codes, see Error Code Center.