Get Site Account List¶
GET /api/v1/account/list
Overview¶
Paginate through undeleted frontend accounts in the site and their directly associated workspace roles.
Before You Call and Usage Steps¶
Paginate through undeleted accounts in the target site, including active and disabled accounts; this operation does not modify accounts. Use External API credentials with r or w permissions.
- Use the AK/SK assigned by the administrator to sign the GET request, raw Query string, and empty request body according to Signature Authentication. Regenerate the timestamp, nonce, and signature for each request.
- Use the nickname or email keyword
searchto narrow the scope as needed; if omitted, all undeleted accounts are queried. For the first call, usepageIndex=1andpageSize=20. - Read records from
content.data[]; pagination information is in content.pageInfo. Then increment pageIndex and stop paging based on totalCount. Under fixed filter conditions, adding or deleting accounts can still affect subsequent pages. - Save
content.data[].uuidfor use in Account Details or as the ownerUuid for Create Workspace; when selecting an owner, also verify the account status.
Results are sorted by record id in descending order. wsInfo reflects only direct role associations and may be null; it does not represent the complete effective permissions an account obtains through groups or other means.
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| X-Df-SVersion | string | Signature version for the raw path and request body; do not omit this header and then continue using the algorithm on this page. Example: v20240417How to obtain or fill in: The example on this page uses this fixed version and is paired with the example signature algorithm. |
|
| X-Df-Access-Key | string | Y | Read endpoints can use r or w credentials; write endpoints require w credentials. Example: <external-access-key>How to obtain or fill in: Assigned by the site administrator as an External API AK; workspace OpenAPI Keys cannot be used. |
| X-Df-Signature | string | Y | Concatenate the uppercase method, nonce, raw full path, timestamp, and raw 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: Compute 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 time. Example: 1785427200How to obtain or fill in: When sending, generate the current Unix seconds string with str(int(time.time())). |
| X-Df-Nonce | string | Y | Temporary serial number; when resending after a failure, also generate a new value and recompute the signature. Example: 97d275ee9f774315a7885ba7347acbd9How to obtain or fill in: Regenerate uuid.uuid4().hex for each request. |
Query Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| search | string | Performs contains matching on the name nickname or email, and does not search username; if omitted or an empty string, no filtering is applied. The current SQL LIKE interprets % and _ wildcards; do not treat them as ordinary characters. Allowed null: False Example: 示例成员How to obtain or fill in: Use a known keyword from the account's name nickname or email. |
|
| pageIndex | integer | Page number, default 1, minimum 1. Allowed null: False $minValue: 1 Example: 1How to obtain or fill in: Start from 1 and read incrementally; pagination is in content.pageInfo; stop based on totalCount or an empty result at the end. |
|
| pageSize | integer | Number per page, default 10, maximum 100. Allowed null: False $minValue: 1 $maxValue: 100 Example: 10How to obtain or fill in: Choose 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 following example uses signature version v20240417. The signature path, Query encoding, and raw request body must exactly match what is actually sent. Returned account profiles do not contain the password field; mfaSecret is only a fixed mask, not a key that can be used for login. In the list, wsInfo is null when there is no direct association; the list does not populate userIconUrl, and the avatar can be obtained from the details.
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/account/list'
query = {'search': '示例成员', 'pageIndex': 1, 'pageSize': 10}
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:
detail = error.read().decode("utf-8")
print("HTTP", error.code, detail) # Handle based on errorCode/message/traceId; do not print AK/SK.
raise SystemExit(1)
except (URLError, TimeoutError):
print("请求结果未知,请先查询现状后再决定是否重试。")
raise SystemExit(1)
print(json.dumps(payload, ensure_ascii=False, indent=2))
Response¶
HTTP 200, Content-Type is application/json, unified response envelope. Business data is in content; External API does not automatically add declaration, and list pagination remains in content.pageInfo.
| Field | Type | Description |
|---|---|---|
| content | object | List and pagination object. |
| content.data | Array of objects | Accounts on the current page; an empty array is returned when there are no matches. |
| content.data[].id | integer | Account record sequence number within the site, returned only as profile data; use uuid when calling other APIs. |
| content.data[].uuid | string | Account UUID; use this field for subsequent queries, modifications, disabling, and deletion. |
| content.data[].status | integer | Account status: 0 active, 2 disabled; the list filters out 3 (deleted), and other historical statuses may appear. |
| content.data[].creator | string | Creator identity identifier; for External creation this is usually SYS. |
| content.data[].updator | string | Most recent modifier identity identifier; may be empty when there has been no modification. |
| content.data[].createAt | number | Creation time, in Unix seconds. |
| content.data[].updateAt | number | Update time, in Unix seconds; may be -1 when there is no update time. |
| content.data[].deleteAt | number | Status operation time field, usually -1 initially; enabling/disabling also writes this value, so do not use it alone to determine deletion; use status. |
| content.data[].name | string | Display nickname. |
| content.data[].username | string | Login account name. Third-party accounts may be empty or duplicate other accounts. |
| content.data[].email | string | Account contact email; if it is empty at creation and username is in email format, it is filled with username. |
| content.data[].mobile | string | Local mobile number, displayed decrypted, excluding country code; empty string if not set. |
| content.data[].countryCode | string | Country/region calling code for the mobile number as a digits-only string, such as 86; empty string if not set. |
| content.data[].exterId | string | Unique ID in the third-party identity system; usually empty for local accounts. |
| content.data[].extend | object or null | Extended information currently saved for the account; may be an empty object or null; the list does not modify this field. |
| content.data[].extend.user_icon | string | Optional avatar URL or static resource file name; may appear when reading historical profiles and is not a writable parameter on this page. |
| content.data[].source | string | Identity source identifier, such as local, unknown, oidc, ldap; historical internal sources such as agent may also exist. |
| content.data[].nameSpace | string | Identity namespace; empty by default for External creation; cannot be set through public parameters of this module. |
| content.data[].isUsed | integer or boolean | Flag indicating whether the account has been used. |
| content.data[].agreeTerms | integer | Terms agreement flag. |
| content.data[].canaryPublic | boolean | Canary flag. |
| content.data[].enableMFA | boolean | Whether MFA is enabled. |
| content.data[].mfaSecret | string | Fixed mask *********************, and does not contain a usable MFA key. |
| content.data[].language | string | Language identifier: zh, en, zh-hant, id, ja, ko. |
| content.data[].tokenHoldTime | integer | Account idle session retention duration in seconds; new accounts are initialized according to the site's secure session configuration and are not guaranteed to be the example value. |
| content.data[].tokenMaxValidDuration | integer | Maximum account session validity period in seconds; new accounts are initialized according to the site's secure session configuration. |
| content.data[].timezone | string | Time zone identifier; empty if not set. |
| content.data[].attributes | object | SSO synchronization attribute KV object, which may be overwritten by subsequent SSO logins; keys and values are agreed upon by the integrating party. |
| content.data[].attributes.{attributeName} | any JSON value | Custom attribute value; strings are recommended, for example department=R&D. |
| content.data[].customAttributes | object | Attribute KV object maintained by the business side. |
| content.data[].customAttributes.{attributeName} | any JSON value | Business custom value; strings are recommended, for example costCenter=CC-1001. |
| content.data[].statusPageSubs | integer | Status page subscription flag. |
| content.data[].defaultWorkspace | string | Default workspace UUID for the account; empty if not configured. |
| content.data[].brandKey | string | Current brand identifier for the account, determined by the set of brands allowed by the site. |
| content.data[].scheduleMobile | string | Local mobile number dedicated to scheduling; empty if not set. |
| content.data[].scheduleEmail | string | Email dedicated to scheduling; empty if not set. |
| content.data[].ifScheduleMobileEnable | boolean | Whether the scheduling mobile number is enabled. |
| content.data[].ifScheduleEmailEnable | boolean | Whether the scheduling email is enabled. |
| content.data[].accountStatus | string | Additional account status identifier; empty if not set. |
| content.data[].wsInfo | Array of objects or null | Active workspaces directly bound to the account and their roles; does not include permissions inherited only through admin console groups. |
| content.data[].wsInfo[].uuid | string | Workspace UUID. |
| content.data[].wsInfo[].name | string | Workspace name. |
| content.data[].wsInfo[].roles | Array of objects | Effective roles directly associated with this account. |
| content.data[].wsInfo[].roles[].uuid | string | Role UUID, such as owner. |
| content.data[].wsInfo[].roles[].name | string | Role display name. |
| content.data[].wsInfo[].roles[].workspaceUUID | string | UUID of the workspace to which the role definition belongs; empty string for system public roles. |
| content.pageInfo.pageIndex | integer | Current page number. |
| content.pageInfo.pageSize | integer | Number per page. |
| content.pageInfo.count | integer | Number of entries on this page. |
| content.pageInfo.totalCount | integer | Total number of entries under the current filter. |
{
"code": 200,
"content": {
"data": [
{
"id": 1001,
"uuid": "acnt_example001",
"status": 0,
"creator": "SYS",
"updator": "",
"createAt": 1785427200,
"deleteAt": -1,
"updateAt": -1,
"name": "示例成员",
"username": "xxx@guance.com",
"email": "xxx@guance.com",
"mobile": "",
"countryCode": "",
"exterId": "",
"extend": null,
"source": "local",
"nameSpace": "",
"isUsed": 0,
"agreeTerms": 0,
"canaryPublic": false,
"enableMFA": false,
"mfaSecret": "*********************",
"language": "zh",
"tokenHoldTime": 86400,
"tokenMaxValidDuration": 604800,
"timezone": "",
"attributes": {
"部门": "研发部"
},
"customAttributes": {
"costCenter": "CC-1001"
},
"statusPageSubs": 0,
"defaultWorkspace": "",
"brandKey": "guance",
"scheduleMobile": "",
"scheduleEmail": "",
"ifScheduleMobileEnable": false,
"ifScheduleEmailEnable": false,
"accountStatus": "",
"wsInfo": [
{
"uuid": "wksp_example001",
"name": "示例空间",
"roles": [
{
"uuid": "general",
"name": "普通成员",
"workspaceUUID": ""
}
]
}
]
}
],
"pageInfo": {
"pageIndex": 1,
"pageSize": 10,
"count": 1,
"totalCount": 1
}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
When there are no matching accounts:
{
"code": 200,
"content": {
"data": [],
"pageInfo": {
"pageIndex": 1,
"pageSize": 10,
"count": 0,
"totalCount": 0
}
},
"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 | 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 | An unhandled exception occurs while querying accounts or related information | Internal error | Save the traceId; the query can be retried later. If the exception persists, contact the administrator. This call does not write accounts, so duplicate submissions do not need to be handled as for write requests. |