Appearance
获取 Token
| 项 | 说明 |
|---|---|
| 方向 | 你 → 平台 |
| 方法 | POST |
| 路径 | /openapi/v1/token |
| Header | Content-Type: application/json |
请求
http
POST /openapi/v1/token
Content-Type: application/jsonjson
{
"enterpriseId": 123,
"specVersion": "1",
"alg": "A256GCM",
"keyVersion": 1,
"eventId": "partner-req-001",
"nonce": "<Base64>",
"ciphertext": "<Base64>",
"tag": "<Base64>"
}| 参数名 | 类型 | 必传 | 描述 |
|---|---|---|---|
| enterpriseId | long | 是 | 企业 ID(明文,外壳外额外字段) |
| specVersion | string | 是 | 固定 "1" |
| alg | string | 是 | 固定 A256GCM |
| keyVersion | int | 是 | 密钥版本 |
| eventId | string | 是 | 本次请求 ID |
| nonce | string | 是 | GCM IV,Base64 |
| ciphertext | string | 是 | 密文 Base64;明文可为 {} |
| tag | string | 是 | GCM tag,Base64 |
响应
json
{
"code": 2000,
"msg": "success",
"data": {
"accessToken": "<token>",
"expiresIn": 7200,
"tokenType": "Bearer"
}
}| 参数名 | 类型 | 必传 | 描述 |
|---|---|---|---|
| code | int | 是 | 2000 成功 |
| msg | string | 否 | 提示信息 |
| data.accessToken | string | 是 | 访问令牌 |
| data.expiresIn | long | 是 | 有效期,秒 |
| data.tokenType | string | 是 | 固定 Bearer |
后续请求头:Authorization: Bearer <accessToken>。