跳到主要内容

开发者令牌生成

生成开发者访问令牌。

请求方式​

POST /api/v1/grant/dev/token

请求参数​

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

响应参数​

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

请求示例​

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

响应示例​

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

错误码​

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

相关链接​