Generate enterprise WeChat callback key

Generate random key material required for WeCom callback authentication. The key is returned in this response only. Please save immediately in a controlled environment and do not write to the code repository, logs or screenshots.

HTTP
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/tools/wecom/callback-secrets/generate

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare a personal access token and target workspace ID that can access the target workspace.

Request parameters

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/tools/wecom/callback-secrets/generate" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

The request body must be empty.

Path parameters

Parameter

Type

Required

Description

workspace_id

string

Yes

Current workspace ID.

Successful response

JSON
{
  "code": 0,
  "data": {
    "callback_token": "<32_CHARACTER_HEX_TOKEN>",
    "callback_encoding_aes_key": "<43_CHARACTER_BASE64_KEY>"
  }
}

Returns 200 on success. Each call generates a new set of random values, and the interface does not save or echo previously generated values.

Field

Type

Description

code

integer

0 on success.

data.callback_token

string

A callback Token composed of 32 hexadecimal characters.

data.callback_encoding_aes_key

string

Base64 encoded AES key of 43 characters without trailing padding.

Error response

JSON
{
  "code": 2,
  "message": "<错误信息>"
}

Common HTTP errors

HTTP status code

error code

Description

401

6(UNAUTHENTICATED)

Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key.

403

5(PERMISSION_DENIED)

Common reasons: The current identity does not have the permission to generate callback keys. Recommended Action: Check the workspace authorization.

400

2(INVALID_ARGUMENT)

Common Cause: The service failed to generate random key material. Recommended Action: Regenerate later. Do not reuse incomplete responses.

Last updated on