OAuth2/access token
(→返回数据) |
(→请求参数) |
||
第17行: | 第17行: | ||
{{api_args|client_id|true|string|申请应用时分配的AppKey。}} | {{api_args|client_id|true|string|申请应用时分配的AppKey。}} | ||
{{api_args|client_secret|true|string|申请应用时分配的AppSecret。}} | {{api_args|client_secret|true|string|申请应用时分配的AppSecret。}} | ||
− | {{api_args|grant_type|true|string| | + | {{api_args|grant_type|true|string|请求的类型,填写authorization_code}} |
|} | |} | ||
第43行: | 第43行: | ||
{{api_args|password|true|string|授权用户的密码。}} | {{api_args|password|true|string|授权用户的密码。}} | ||
|} | |} | ||
− | |||
==返回数据== | ==返回数据== |
2013年1月16日 (三) 18:56的版本
oauth2/access_token
OAuth2的access_token接口
URL
https://api.weibo.com/oauth2/access_token
HTTP请求方式
POST
请求参数
必选 | 类型及范围 | 说明 | |
---|---|---|---|
client_id | true | string | 申请应用时分配的AppKey。 |
client_secret | true | string | 申请应用时分配的AppSecret。 |
grant_type | true | string | 请求的类型,填写authorization_code |
- grant_type为authorization_code时
必选 | 类型及范围 | 说明 | |
---|---|---|---|
code | true | string | 调用authorize获得的code值。 |
redirect_uri | true | string | 回调地址,需需与注册应用里的回调地址一致。 |
- grant_type为password时
必选 | 类型及范围 | 说明 | |
---|---|---|---|
username | true | string | 授权用户的用户名。 |
password | true | string | 授权用户的密码。 |
返回数据
{ "access_token": "ACCESS_TOKEN", "expires_in": 1234, "remind_in":"798114", "uid":"12341234" }
返回值字段 | 字段类型 | 字段说明 |
---|---|---|
access_token | string | 用于调用access_token,接口获取授权后的access token。 |
expires_in | string | access_token的生命周期,单位是秒数。 |
remind_in | string | access_token的生命周期(该参数即将废弃,开发者请使用expires_in)。 |
uid | string | 当前授权用户的UID。 |