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.
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¶
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 |
|---|---|---|---|
|
string |
Yes |
Current workspace ID. |
Successful response¶
{
"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 |
|---|---|---|
|
integer |
|
|
string |
A callback Token composed of 32 hexadecimal characters. |
|
string |
Base64 encoded AES key of 43 characters without trailing padding. |
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors
HTTP status code |
error code |
Description |
|---|---|---|
|
|
Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key. |
|
|
Common reasons: The current identity does not have the permission to generate callback keys. Recommended Action: Check the workspace authorization. |
|
|
Common Cause: The service failed to generate random key material. Recommended Action: Regenerate later. Do not reuse incomplete responses. |