> ## Documentation Index
> Fetch the complete documentation index at: https://docs.168992.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

所有回调请求均以 JSON 数据形式通过 `POST` 方法发送。

我们的 API 要求所有请求（无论成功与否）均返回 HTTP 状态码 `200`。其他任何 HTTP 状态码均视为失败。

## **Request Header**

| Key | Value | Description |
| :- | :- | :- |
| `X-Request-Signature` | `Hash string` | `Signature string issued by our API. ` |
| `Accept` | `application/json` | `Accept: application/json` |
| `Content-Type` | `application/json` | `Content-Type: application/json` |

## **验证回调请求签名**

`X-Request-Signature` 头部是原始 HTTP 请求体经过 **HMAC-SHA512** 算法计算并进行 **Base64 编码**后的值。其中，HMAC 密钥为 `API_TOKEN` 对应的 UTF-8 字节序列。

请在解析 JSON 之前，直接对接收到的原始请求体字节进行签名。

```javascript theme={null}
const crypto = require('crypto');

function signature(rawBody, apiToken) {
  return crypto.createHmac('sha512', apiToken)
	.update(rawBody)
	.digest('base64');
}
```

将你生成的哈希字符串与 `X-Request-Signature` 请求头中提供的值进行比较。若两者不匹配，则表明该请求可能已被恶意方篡改或伪造。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.