Skip to content

获取 Token ​

项说明
方向你 → 平台
方法POST
路径/openapi/v1/token
HeaderContent-Type: application/json

请求 ​

http
POST /openapi/v1/token
Content-Type: application/json
json
{
  "enterpriseId": 123,
  "specVersion": "1",
  "alg": "A256GCM",
  "keyVersion": 1,
  "eventId": "partner-req-001",
  "nonce": "<Base64>",
  "ciphertext": "<Base64>",
  "tag": "<Base64>"
}
参数名类型必传描述
enterpriseIdlong是企业 ID(明文,外壳外额外字段)
specVersionstring是固定 "1"
algstring是固定 A256GCM
keyVersionint是密钥版本
eventIdstring是本次请求 ID
noncestring是GCM IV,Base64
ciphertextstring是密文 Base64;明文可为 {}
tagstring是GCM tag,Base64

响应 ​

json
{
  "code": 2000,
  "msg": "success",
  "data": {
    "accessToken": "<token>",
    "expiresIn": 7200,
    "tokenType": "Bearer"
  }
}
参数名类型必传描述
codeint是2000 成功
msgstring否提示信息
data.accessTokenstring是访问令牌
data.expiresInlong是有效期,秒
data.tokenTypestring是固定 Bearer

后续请求头:Authorization: Bearer <accessToken>。