Skip to content

List



GET /api/v1/workspace/inner_accesskey/list

Overview

Paginate through the active inner sys system Keys in each Workspace.

Before You Call and Usage Steps

It is recommended to explicitly pass workspaceUUIDs to view the built-in credentials of the target Workspace in read-only mode. This Query parameter is a comma-separated string, not a JSON array; leading and trailing whitespace is trimmed from each item, empty segments are ignored, and if omitted or ultimately empty, the query covers active inner sys Keys in all Workspaces of this service. Sorted by record id in descending order; default pageIndex=1, pageSize=50, maximum 100. search actually performs a plaintext contains match on the Access Key, not a search by name or SK. The list returns complete Key entities except for id, including AK/SK, and does not return role or permission summaries; if no match is found, it returns an empty list and does not report that the Workspace was not found.

Request Headers

Parameter Type Required Description
X-Df-SVersion string Signature version for the original path and request body; do not omit it and continue using the algorithm on this page.
Example: v20240417
How to obtain or fill in: The example on this page uses this fixed version, which matches the example signature algorithm.
X-Df-Access-Key string Y The list in this module can use r or w permission; the other three items, including GET initialization, require w permission.
Example: <external-access-key>
How to obtain or fill in: Assigned by the site administrator as an External API AK; a Workspace OpenAPI Key cannot be used.
X-Df-Signature string Y Concatenate the uppercase method, nonce, original full path, timestamp, and original UTF-8 request body with spaces, then compute HMAC-SHA256 and take the hex digest.
Example: <hmac-sha256-hex>
How to obtain or fill in: Calculate using the matching SK according to External API Signature Authentication; see the complete runnable template below.
X-Df-Timestamp string Y Must be within the signature validity window configured for the site; do not reuse the example timestamp.
Example: 1785427200
How to obtain or fill in: At send time, use str(int(time.time())) to generate the current Unix seconds string.
X-Df-Nonce string Y Temporary serial number; when resending after a failure, also generate a new value and recalculate the signature.
Example: 97d275ee9f774315a7885ba7347acbd9
How to obtain or fill in: Regenerate uuid.uuid4().hex for each request.

Query Request Parameters

Parameter Type Required Description
search string Optional; after trimming leading and trailing whitespace, matches by AK contains; if omitted or blank, no filtering is applied. Does not match by name/SK.
Allows null: False
Example: known-ak-part
How to obtain or fill in: Obtain the keyword from ak in the response of the existing Built-in Key List, or from a securely saved Access Key.
workspaceUUIDs commaArray Optional CSV string; if omitted, an empty string, or only empty segments, all Workspaces are queried. Do not wrap a single Workspace in square brackets.
Allows null: False
Example: wksp_example001
How to obtain or fill in: Obtain one or more Workspace UUIDs from Workspace List and join them with commas.
pageIndex integer Default 1, minimum 1.
Allows null: False
$minValue: 1
Example: 1
How to obtain or fill in: Use 1 for the first page, then advance the page number according to content.pageInfo.
pageSize integer Default 50, maximum 100.
Allows null: False
$minValue: 1
$maxValue: 100
Example: 50
How to obtain or fill in: Select 1 to 100 as required by the client.

Additional Parameter Notes

Use site-level External API credentials; for authentication, see External API Signature Authentication. The list allows r or w permission; the other three items, including GET initialization, require w permission. All responses may return high-privilege credentials in plaintext; do not apply the masking display rules for ordinary frontend pages. The examples use placeholder values; actual credentials should be securely stored.

Request Example

import hashlib
import hmac
import json
import time
import uuid
from urllib.parse import urlencode
from urllib.request import Request, urlopen
from urllib.error import HTTPError, URLError

# Replace with the target site address and the External API AK/SK assigned by the administrator.
server = "https://external-api.guance.com"
access_key = "<external-access-key>"
secret_key = "<external-secret-key>"
method = 'GET'
path = '/api/v1/workspace/inner_accesskey/list'
query = {'workspaceUUIDs': 'wksp_example001', 'pageIndex': 1, 'pageSize': 50}
data = None
full_path = path + ("?" + urlencode(query) if query else "")
body = "" if data is None else json.dumps(data, ensure_ascii=False, separators=(",", ":"))
timestamp = str(int(time.time()))
nonce = uuid.uuid4().hex
string_to_sign = " ".join([method, nonce, full_path, timestamp, body])
signature = hmac.new(secret_key.encode("utf-8"), string_to_sign.encode("utf-8"), hashlib.sha256).hexdigest()
headers = {
    "X-Df-Access-Key": access_key,
    "X-Df-Timestamp": timestamp,
    "X-Df-Nonce": nonce,
    "X-Df-Signature": signature,
    "X-Df-SVersion": "v20240417",
}
if data is not None:
    headers["Content-Type"] = "application/json"
request = Request(server + full_path, data=None if data is None else body.encode("utf-8"), headers=headers, method=method)
try:
    with urlopen(request, timeout=30) as result:
        payload = json.loads(result.read().decode("utf-8"))
except HTTPError as error:
    print("HTTP", error.code, error.read().decode("utf-8"))  # Handle according to errorCode, content, and traceId; do not output AK/SK.
    raise SystemExit(1)
except (URLError, TimeoutError):
    print('Read failed; you can back off, re-sign, and retry, preserving the traceId and query conditions.')
    raise SystemExit(1)
print(json.dumps(payload, ensure_ascii=False, indent=2))

Response

HTTP 200, uniform application/json envelope, with business results in content; External does not automatically add declaration, and list pagination retains content.pageInfo.

Field Type Description
content.data Object array Active system Keys on this page.
content.data[].uuid string API Key record UUID, which is different from the calling credential ak/sk.
content.data[].status integer Built-in Key status; queries and deletions in this module select status=0.
content.data[].creator string Creator identity; for External creation, this is usually external.
content.data[].updator string Updater identity; can be empty if not modified.
content.data[].createAt integer Creation time in Unix seconds.
content.data[].deleteAt integer Deletion time in Unix seconds; usually -1 if not deleted.
content.data[].updateAt integer Update time in Unix seconds; usually -1 if not yet modified.
content.data[].name string Built-in Key name; initialized as inner.
content.data[].ak string Plaintext Access Key of the built-in system; store it as a high-privilege credential. This is not the External signing AK.
content.data[].sk string Plaintext Secret Key of the built-in system; store it as a high-privilege credential. This is not the External signing SK.
content.data[].workspaceUUID string UUID of the Workspace to which it belongs.
content.data[].accountUUID string Bound account identifier; for an initialized system Key, this is usually an empty string.
content.data[].createdWay string Creation source; initialized values are usually manual. The system scope is distinguished by isSystem/businessType.
content.data[].businessType string This module manages only the inner sys type.
content.data[].isSystem integer This module manages only system built-in Keys; initialized to 1.
content.data[].isOwnerRole integer Initialized to 1, with Owner role semantics; managed separately from ordinary manual Owner Keys.
content.data[].remark string Existing remark; this module has no request parameter for modifying remarks.
content.data[].isBurnAfterReading integer Retained burn-after-reading flag; this module does not destroy after reading, and you should not rely on it to revoke credentials.
content.data[].callCount integer or null Persistent cumulative call count; asynchronous statistics, not real-time counting. The creation snapshot may be null before flush.
content.data[].lastCallAt integer or null Last call time in Unix seconds; usually -1 means no record yet; the creation snapshot may be null.
content.pageInfo.pageIndex integer Current page number.
content.pageInfo.pageSize integer Number of entries per page.
content.pageInfo.count integer Number of entries on this page.
content.pageInfo.totalCount integer Total number of entries under the filter.
{
  "code": 200,
  "content": {
    "data": [
      {
        "uuid": "wsak_inner_example001",
        "status": 0,
        "creator": "external",
        "updator": "",
        "createAt": 1785427200,
        "deleteAt": -1,
        "updateAt": -1,
        "name": "inner",
        "ak": "<inner-access-key>",
        "sk": "<inner-secret-key>",
        "workspaceUUID": "wksp_example001",
        "accountUUID": "",
        "createdWay": "manual",
        "businessType": "inner sys",
        "isSystem": 1,
        "isOwnerRole": 1,
        "remark": "",
        "isBurnAfterReading": 0,
        "callCount": 0,
        "lastCallAt": -1
      }
    ],
    "pageInfo": {
      "pageIndex": 1,
      "pageSize": 50,
      "count": 1,
      "totalCount": 1
    }
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

When no Key matches:

{
  "code": 200,
  "content": {
    "data": [],
    "pageInfo": {
      "pageIndex": 1,
      "pageSize": 50,
      "count": 0,
      "totalCount": 0
    }
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Response

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

When parameters do not match the declaration, a common request error is returned; ordinary internal exceptions such as database and cache exceptions are ultimately unified as 500 ft.InternalServerError. After a write request fails, first verify the persistent state and cache; it is not guaranteed that none of the changes took effect.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed Request field is missing, or the field value violates the declared validation conditions Parameter parsing failed Verify the parameter location, field name, type, and value.
500 ft.InternalServerError Database or cache failure, or an internal exception that is not explicitly handled Internal error Save the traceId, verify the current Key state and actual call result before deciding to retry; the database may have committed, so do not assume no change occurred based on the error response.

Feedback

Is this page helpful?