Get¶
GET /api/v1/workspace/accesskey/{ak_uuid}/get
Overview¶
Reads the details and authorization of the specified API Key in the current workspace by record UUID.
Prerequisites and Usage Steps¶
The call requires the workspace.openAPIKeyManage permission for the current workspace. The example below shows selected commonly used fields. Get the record UUID from content[].uuid in the API Key list. For a manually created workspace Key that is not bound to an account, the Workspace Owner can read the complete credentials. A non-Owner can read the complete value only for the Key used in the current call; other records are masked. Records from other sources, such as personal and Agent, are also masked. Redact responses in logs and tickets.
Route Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| ak_uuid | string | Y | UUID of the target record. Do not enter the actual Secret Key. Example: wsak_exampleHow to obtain or enter: Get it from content[].uuid in the API Key list. |
Request Headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | Workspace call credentials. The record UUID and call credentials are different fields. Example: <DF-API-KEY>How to obtain or enter: Obtain the complete credentials from API Key management in the current workspace. |
Additional Parameter Notes¶
The resource identifiers in the examples are placeholders. Replace them with the actual values for the target workspace.
Request Example¶
curl --get -H "DF-API-KEY: <DF-API-KEY>" \
'https://openapi.guance.com/api/v1/workspace/accesskey/wsak_example/get'
Response¶
HTTP 200, application/json.
| Field | Type | Description |
|---|---|---|
| content.uuid | string | UUID of the API Key record, commonly prefixed with wsak_. Used in the path of API Key management APIs. |
| content.name | string | Name of the API Key. |
| content.workspaceUUID | string | Workspace to which the API Key belongs. |
| content.createdWay | string | Creation source of the API Key. |
| content.remark | string | Remark for the API Key. |
| content.isOwnerRole | integer or boolean | Whether the API Key has the workspace owner role. |
| content.callCount | integer | Number of recorded calls. |
| content.lastCallAt | integer | Time of the most recent recorded call, in Unix seconds; may be -1 when no record exists. |
| content.createAt | integer | Record creation time, in Unix seconds. |
| content.accountUUID | string | UUID of the explicitly bound account; an empty string if not bound. |
| content.effectiveAccountUUID | string | Identity identifier used for authentication. When no account is bound, this is the API Key record UUID. |
| content.accountInfo | object or null | Bound account profile; null if not bound. |
| content.roles | array<object> |
Set of effective roles; order is not guaranteed. |
| content.roles[].uuid | string | Role UUID. |
| content.roles[].name | string | Role name. |
| content.permissions | array<string> |
Set of effective permission identifiers; order is not guaranteed. |
| content.rolePermissions | object | Permission identifiers held by each role, keyed by role UUID, with an array of permission strings as the value. |
| content.declaration | object or null | Workspace declaration. |
| content.ak | string | Access Key identifier. May be masked based on the current identity. |
| content.sk | string | Secret Key credential. May be masked based on the current identity. Treat the response as sensitive information. |
| content.creatorInfo | object | Creator profile; an empty object if it cannot be found. |
{
"code": 200,
"content": {
"uuid": "wsak_example",
"name": "应用数据读取",
"workspaceUUID": "wksp_example",
"createdWay": "manual",
"remark": "",
"isOwnerRole": 0,
"callCount": 14,
"lastCallAt": 1785427200,
"createAt": 1785423600,
"accountUUID": "",
"effectiveAccountUUID": "wsak_example",
"accountInfo": null,
"roles": [
{
"uuid": "role_example",
"name": "应用数据只读"
}
],
"permissions": [
"routine.defaultAccess"
],
"rolePermissions": {
"role_example": [
"routine.defaultAccess"
]
},
"declaration": null,
"ak": "*************abcd",
"sk": "*************ef01",
"creatorInfo": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Responses¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Resolution |
|---|---|---|---|---|
| 404 | ft.AKNotExistOrDelete | No matching valid, non-system API Key exists in the same workspace | The API Key does not exist or has been deleted. | Use a UUID returned by the current workspace list. |
| 403 | ft.Forbidden | A non-Owner attempts to read an Owner Key | No operation permission. | Use a calling identity that meets the authorization requirements. |
| 403 | ft.AgentMemberDisabled | The account bound to the API Key is disabled | The bound account is unavailable. | Check whether the bound account is in an available state. |
| 404 | ft.AgentMemberNotFound | The account bound to the API Key does not exist or has been deleted | The bound account cannot be found. | Verify the binding relationship and account status. |
| 404 | ft.WorkspaceAgentMemberNotFound | The bound account has no valid workspace membership | The corresponding workspace member cannot be found. | Check whether the account is still a member of the current workspace. |