开发者令牌生成
生成开发者访问令牌。
请求方式
POST /api/v1/grant/dev/token
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| app_id | string | 是 | 应用ID |
| secret | string | 是 | 应用密钥 |
| scope | string | 否 | 权限范围(默认all) |
| expires_in | int | 否 | 过期时间(秒,默认3600) |
响应参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| access_token | string | 访问令牌 |
| token_type | string | 令牌类型(Bearer) |
| expires_in | int | 过期时间(秒) |
| scope | string | 权限范围 |
请求示例
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 | 服务器内部错误 |