Skip to content

Get



GET /api/v1/role/{role_uuid}/get

Overview

Read the basic information and permission identifiers of a specified role in the current workspace.

Prerequisites and Steps

First call Role List to obtain the role UUID. To display permission identifiers as names, read the catalog from Permission List. The permissions a role has and the permissions the current API Key has are determined by different calls.

Select the OpenAPI address of the site from the Site Domain Table.

Route Parameters

Parameter Type Required Description
role_uuid string Y UUID of the target role.
Example: role_example
How to obtain or fill in: Get it from content.data[].uuid in the Role List response.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y OpenAPI Key credential of the workspace. Use the full key value, not the UUID of the API Key record.
Example: <DF-API-KEY>
How to obtain or fill in: Create or obtain a Key with permission for this API in API Key Management of the target workspace.

Additional Parameter Notes

The workspace is determined by the DF-API-KEY in the request.

Request Example

curl --get -H "DF-API-KEY: <DF-API-KEY>" \
  "https://openapi.guance.com/api/v1/role/role_example/get"

Response

HTTP 200, application/json.

Field Type Description
content.id integer Role record ID.
content.uuid string Role UUID; use this field for subsequent queries of role details.
content.name string Role name.
content.desc string Role description.
content.isSystem integer 1 means a system built-in role, 0 means another role.
content.workspaceUUID string The workspace the role belongs to or applies to; may be empty for system built-in roles.
content.builtinRoleUUID string UUID of the built-in role template in the management console; empty if there is no template.
content.isAllWorkspace integer Whether the built-in role in the management console applies to all workspaces: 0 no, 1 yes.
content.isManageBuiltinRole boolean Whether this is a built-in role defined and applied through the management console.
content.creator string Creator identifier.
content.updator string Identifier of the last updater.
content.createAt integer Creation time. Unix seconds.
content.updateAt integer Last update time. Unix seconds.
content.deleteAt integer Deletion time in Unix seconds; -1 if not deleted.
content.status integer Role record status.
content.creatorInfo object Creator profile; {} if not found.
content.updatorInfo object Last updater profile; {} if not found.
content.permissions array<string> Set of permission identifiers for the current role.
content.declaration object or null Public declaration data of the workspace; may be null when the configuration is empty.
{
  "code": 200,
  "content": {
    "id": 101,
    "uuid": "role_example",
    "name": "Log read-only",
    "desc": "Query application logs",
    "isSystem": 0,
    "workspaceUUID": "wksp_example",
    "builtinRoleUUID": "",
    "isAllWorkspace": 0,
    "isManageBuiltinRole": false,
    "status": 0,
    "creatorInfo": {},
    "updatorInfo": {},
    "permissions": [
      "routine.defaultAccess"
    ],
    "declaration": null
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Response

For authentication, rate limiting, and common request errors, see Common Error Definitions.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
404 ft.NotFoundRole The corresponding role does not exist, has been deleted, or is unavailable in the current workspace The specified role was not found or has been deleted. Query the role list of the current workspace again and use the uuid actually returned.

Feedback

Is this page helpful?