oauth2_token
POST
/action/openapi/token
错误代码 | 错误标识 | 说明 |
---|---|---|
400 | invalid_request | 无效请求(缺少必要参数) |
401 | invalid_client | client_id无效 |
401 | invalid_grant | 授权方式无效 |
401 | unauthorized_client | 应用未授权 |
401 | unsupported_grant_type | 不支持的授权方式 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://www.oschina.net/action/openapi/token' \
--header 'Content-Type: application/json' \
--data-raw '{
"client_id": "string",
"client_secret": "string",
"grant_type": "string",
"redirect_uri": "string",
"code": "string",
"refresh_token": "string",
"dataType": "string",
"callback": "string"
}'
响应示例响应示例
{
"access_token": "8447ff97-9b8c-4224-9cec-63b97d34ba65",
"refresh_token": "8447ff97-9b8c-4224-9cec",
"token_type": "bearer",
"expires_in": 43199,
"uid": 12
}
请求参数
Body 参数application/json
返回响应
修改于 2022-08-22 04:12:00