Skip to content

Get Site Account Details



GET /api/v1/account/get

Overview

Retrieve account details by account UUID or third-party account ID.

Before You Call and Usage Steps

Use External credentials with r or w permission. accountUUID is taken from the uuid field in the account list; exterId is taken from your identity system. Provide at least one of them; when both are provided, they are intersected. A disabled account returns an error; to view details of a disabled account, use the list. To obtain workspace roles, provide a valid accountUUID together with wsRoleNeeded=true; with only exterId, the current implementation returns wsInfo=[].

Request Headers

Parameter Type Required Description
X-Df-SVersion string Signature version for the original path and request body; you cannot omit it and keep using the algorithm on this page.
Example: v20240417
How to obtain or fill: The examples on this page use this fixed version, which is paired with the example signature algorithm.
X-Df-Access-Key string Y Read endpoints accept r or w credentials; write endpoints require w credentials.
Example: <external-access-key>
How to obtain or fill: The External API AK assigned by the site administrator; the 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 apply HMAC-SHA256 and take the hex digest.
Example: <hmac-sha256-hex>
How to obtain or fill: Compute with the paired SK according to External API Signature Authentication; see the complete runnable template below.
X-Df-Timestamp string Y Must fall within the signature validity window configured for the site; do not reuse the example time.
Example: 1785427200
How to obtain or fill: When sending, 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, generate a new value and recompute the signature.
Example: 97d275ee9f774315a7885ba7347acbd9
How to obtain or fill: Regenerate uuid.uuid4().hex for each request.

Query Parameters

Parameter Type Required Description
accountUUID string Account UUID; can be provided together with exterId. If omitted, the lookup uses exterId.
Nullable: False
Example: acnt_example001
How to obtain or fill: Obtain from content.data[].uuid in the account list or from content.uuid in the successful creation response.
exterId string Third-party ID; can be provided together with accountUUID. When both are provided, they must refer to the same account.
Nullable: False
Example: sso-user-1001
How to obtain or fill: Use the unique identifier passed in when the third-party account was created.
wsRoleNeeded string The string true or 1 enables it; any other string disables it. By default, wsInfo is not returned.
Nullable: False
Example: true
How to obtain or fill: To return workspaces and roles directly, pass the string true or 1; otherwise omit it or pass false.

Additional Parameter Notes

Use site-level External API credentials; for authentication, see External API Signature Authentication. The following example uses the v20240417 signature version; the signed path, Query encoding, and original request body must match exactly what is actually sent. The returned account details do not include a password field; mfaSecret is only a fixed mask and is not a secret that can be used to log in.

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/get'
query = {'accountUUID': 'acnt_example001', 'wsRoleNeeded': 'true'}
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)  # Check errorCode, message, content, and traceId; do not print AK/SK.
    raise SystemExit(1)
except (URLError, TimeoutError):
    print("Request result unknown; for write operations, query the current account state first and then decide whether to retry.")
    raise SystemExit(1)
print(json.dumps(payload, ensure_ascii=False, indent=2))

Response

HTTP 200 with the unified application/json envelope; External does not automatically add declaration. content is the account details object; wsInfo is returned according to the query entry point and the actual direct associations.

Field Type Description
content.id integer Sequence number of the account record within the site, returned for reference only; use uuid when calling other endpoints.
content.uuid string Account UUID; use this field for subsequent queries, modifications, disabling, and deletion.
content.status integer Account status: 0 normal, 2 disabled; the list filters out 3 deleted. Other legacy statuses may appear.
content.creator string Identity identifier of the creator; typically SYS for External-created accounts.
content.updator string Identity identifier of the last modifier; may be empty if the account has never been modified.
content.createAt number Creation time, in Unix seconds.
content.updateAt number Update time, in Unix seconds; -1 if there is no update time yet.
content.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.name string Display nickname.
content.username string Login account name. For third-party accounts it may be empty or duplicated with other accounts.
content.email string Account contact email; if it is empty at creation and username is in email format, it is filled with username.
content.mobile string Local mobile number, displayed decrypted, without the country code; an empty string if not set.
content.countryCode string Country/region calling code of the mobile number as a digits-only string, such as 86; an empty string if not set.
content.exterId string Unique ID in the third-party identity system; usually empty for local accounts.
content.extend object or null Existing extended details, which may include the user_icon avatar address; the extend passed at creation through this API is not currently saved, and the modify API does not expose this parameter either.
content.extend.user_icon string Optional avatar URL or static asset file name; may appear when reading legacy details, and is not a writable parameter on this page.
content.source string Identity source identifier, such as local, unknown, oidc, or ldap; legacy internal sources such as agent may also exist.
content.nameSpace string Identity namespace; empty by default for External-created accounts, and cannot be set through the public parameters of this module.
content.isUsed integer or boolean Flag indicating whether the account has been used.
content.agreeTerms integer Terms agreement flag.
content.canaryPublic boolean Canary flag.
content.enableMFA boolean Whether MFA is enabled.
content.mfaSecret string Fixed mask *********************, does not contain a usable MFA secret.
content.language string Language identifier: zh, en, zh-hant, id, ja, ko.
content.tokenHoldTime integer Session idle timeout for the account, in seconds; new accounts are initialized according to the site's secure session configuration and are not guaranteed to match the example value.
content.tokenMaxValidDuration integer Maximum session validity for the account, in seconds; new accounts are initialized according to the site's secure session configuration.
content.timezone string Time zone identifier; empty if not set.
content.attributes object KV object of SSO-synchronized attributes, which may be overwritten by subsequent SSO logins; keys and values are agreed upon by the integrating party.
content.attributes.{attribute name} any JSON value Custom attribute value; strings are recommended, for example department=R&D.
content.customAttributes object KV object of attributes maintained by the business side.
content.customAttributes.{attribute name} any JSON value Business-defined value; strings are recommended, for example costCenter=CC-1001.
content.statusPageSubs integer Status page subscription flag.
content.defaultWorkspace string UUID of the account's default workspace; empty if not configured.
content.brandKey string Current brand identifier of the account, determined by the set of brands allowed for the site.
content.scheduleMobile string Local mobile number dedicated to scheduling; empty if not set.
content.scheduleEmail string Email dedicated to scheduling; empty if not set.
content.ifScheduleMobileEnable boolean Whether the scheduling mobile number is enabled.
content.ifScheduleEmailEnable boolean Whether the scheduling email is enabled.
content.accountStatus string Additional account status identifier; empty if not set.
content.userIconUrl string or null Avatar URL generated from the existing extend.user_icon; null if there is no avatar.
content.wsInfo array of objects or null Active workspaces directly bound to the account and their roles; does not include permissions inherited only through admin backend groups.
content.wsInfo[].uuid string Workspace UUID.
content.wsInfo[].name string Workspace name.
content.wsInfo[].roles array of objects Valid roles directly associated with this account.
content.wsInfo[].roles[].uuid string Role UUID, for example owner.
content.wsInfo[].roles[].name string Role display name.
content.wsInfo[].roles[].workspaceUUID string UUID of the workspace to which the role definition belongs; an empty string for system public roles.
{
  "code": 200,
  "content": {
    "id": 1001,
    "uuid": "acnt_example001",
    "status": 0,
    "creator": "SYS",
    "updator": "",
    "createAt": 1785427200,
    "deleteAt": -1,
    "updateAt": -1,
    "name": "Example Member",
    "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": {
      "department": "R&D"
    },
    "customAttributes": {
      "costCenter": "CC-1001"
    },
    "statusPageSubs": 0,
    "defaultWorkspace": "",
    "brandKey": "guance",
    "scheduleMobile": "",
    "scheduleEmail": "",
    "ifScheduleMobileEnable": false,
    "ifScheduleEmailEnable": false,
    "accountStatus": "",
    "userIconUrl": null,
    "wsInfo": [
      {
        "uuid": "wksp_example001",
        "name": "Example Workspace",
        "roles": [
          {
            "uuid": "general",
            "name": "General Member",
            "workspaceUUID": ""
          }
        ]
      }
    ]
  },
  "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 A request field is missing, or a field value violates the declared validation conditions Parameter parsing failed Verify the parameter location, field name, type, and value.
404 ft.NotFoundAccount No account matches the query conditions, or the account has already been deleted The specified account was not found Obtain a valid uuid again from the account list; for dual-condition queries, verify that both values belong to the same account.
403 ft.AccountIsDisabled The target account has status=2 The account is disabled First enable it using the enable/disable endpoint, or check the account status in the list.
500 ft.InternalServerError An exception in the database, cache, asynchronous task delivery, or a field that is not explicitly handled Internal error Keep the traceId and query conditions, and verify the account data and service status; this endpoint is read-only, so you can retry with backoff.

Feedback

Is this page helpful?