Skip to content

开发者令牌生成

生成开发者访问令牌。

请求方式

POST /api/v1/grant/dev/token

请求参数

参数名类型必填说明
app_idstring应用ID
secretstring应用密钥
scopestring权限范围(默认all)
expires_inint过期时间(秒,默认3600)

响应参数

参数名类型说明
access_tokenstring访问令牌
token_typestring令牌类型(Bearer)
expires_inint过期时间(秒)
scopestring权限范围

请求示例

json
{
  "app_id": "app123",
  "secret": "app-secret-123",
  "expires_in": 7200
}

响应示例

json
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
  "token_type": "Bearer",
  "expires_in": 7200,
  "scope": "all"
}

错误码

错误码说明
400参数错误
401认证失败
403应用被禁用
500服务器内部错误

相关链接