Generate enterprise WeChat callback key

Generate random key material required for enterprise WeChat callback verification. The key is only returned in this response; please save it immediately in a controlled environment and do not write it to the code repository, logs or screenshots.

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

Before you call this API

Configure the regional API endpoint and authentication, and select the target workspace.

The request body of this interface must be empty.

Request

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"

Path parameters

Parameters

Type

Is it required

Description

workspace_id

string

Yes

The current workspace ID.

Successful response

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

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

The response fields are as follows.

Field

Type

Description

code

integer

0 on success.

data.callback_token

string

Callback Token composed of 32 hexadecimal characters.

data.callback_encoding_aes_key

string

43-character Base64 encoded AES key without trailing padding.

Error response

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

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

401

6(UNAUTHENTICATED)

Lack of valid identity credentials.

Check API Key.

403

5(PERMISSION_DENIED)

The current identity does not have permission to generate callback keys.

Check workspace authorization.

500

1(INTERNAL)

The service failed to generate random key material.

Regenerate later; do not reuse incomplete responses.

Follow-up operations

Save the returned key or ID, and check the relevant configuration if necessary Query GitHub tool connection.

Last updated on