获取令牌
该接口用于获取鉴权 accessToken,调用其它 API 前需先获取并在请求头中携带。
接口调用
接口说明
| 接口描述 | 获取鉴权accessToken需调用此接口 |
|---|---|
| 请求域名 | https://openapi.jbangai.com |
| 接口地址 | /api/open/v2/token |
| 请求方式 | POST |
| 权限校验 | 否 |
提交参数
Body请求体
| 参数 | 类型 | 是否必传 | 参数说明 |
|---|---|---|---|
| appKey | string | 是 | appKey 由匠邦AI提供 |
| secret | string | 是 | Secret 由匠邦AI提供 |
Header请求头
| 参数 | 类型 | 是否必传 | 参数说明 |
|---|---|---|---|
| Content-Type | string | 是 | 目前固定为: application/json |
| Host | string | 是 | 目前固定为: ai-user-api.jbangai.com |
请求示例
- Curl
curl --location --request POST 'https://openapi.jbangai.com/api/open/v2/token' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host: ai-user-api.jbangai.com' \
--header 'Connection: keep-alive' \
--data-raw '{
"appKey": "appKey 由匠邦AI提供",
"secret": "Secret 由匠邦AI提供"
}'
返回参数
| 参数 | 子参数 | 类型 | 说明 |
|---|---|---|---|
| code | — | string | 响应编码 |
| data | accessToken | string | 鉴权令牌token |
| data | expireIn | string | 过期时间(秒) |
| message | — | string | 返回提示信息 |
| serverTime | — | string | 当前时间戳 |
响应示例
{
"code": 0,
"data": {
"accessToken": "eyJhbGciOiJIUzUxMiJ9...",
"expireIn": 7200
},
"message": "",
"serverTime": 1740663135
}