chore: 初始开源发布

This commit is contained in:
MiFaZhan
2026-10-22 15:16:43 +08:00
commit 92f239fcc4
114 changed files with 8018 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
---
title: 获取调用凭证
description: 使用 appKey、appSecret 换取 V3 接口调用凭证
outline: deep
---
# 获取调用凭证
```http
POST /openapi/v3/query/token
```
说明:使用 `appKey`、`appSecret` 换取接口调用凭证。
请求体:
| 字段 | 类型 | 说明 |
| --- | --- | --- |
| appKey | string | API 账号标识,在管理后台申请获取 |
| appSecret | string | API 密钥,在管理后台申请获取 |
| refresh | string | 是否刷新 token:`1` 强制生成新 token,`0` 或留空时尽量复用已有 token |
请求示例:
```json
{
"appKey": "YOUR_APP_ID",
"appSecret": "YOUR_APP_SECRETebdebae9763127943f097758e029a0fdbc"
}
```
响应结构:
| 字段 | 类型 | 说明 |
| --- | --- | --- |
| data.appId | string | 客户组织编码,**后续所有接口请求体中都要传入此值** |
| data.accessToken | string | 接口调用凭证,后续放入 `X-Access-Token` |
::: info 注意:appId ≠ appKey
- **`appKey`**(如 `SDYZ`)只用于获取 token,调用 `/openapi/v3/query/token` 后就不再需要
- **`appId`**(如 `CUS-202601-0001`)由 token 接口返回,后续调用 sim-info 等接口时,请求体中的 `appId` 字段必须填这个值
- 如果传错会导致 `code: 61 "登录已过期"` 错误
:::
响应示例:
```json
{
"code": 0,
"message": "",
"data": {
"appId": "CUS-202601-0001",
"accessToken": "eyJhbGciOiJIUzI1NiJ9.eyJ1IjoiZWE3ZjJiZGY5MjQyNDFkZjg3NGIwZDMzNmZkN2UzMzEiLCJleHAiOjE3ODQ3MDAyODB9.JiYK-CXdXQKKU0UNhNOqKX5Hzyk4lVMtIpunQJDxlBI"
},
"error": null
}
```