code2AccessToken
GET
/oauth2/access_token请求参数
Query 参数
app_secret
string
应用对应的密钥
code
string
临时授权票据
grant_type
string
必需
写死 “authorization_code” 即可
示例值:
authorization_code
示例代码
返回响应
Success Response(200)
Error Response(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
result
integer
必需
错误码。1 表示成功。
access_token
string
授权凭证
expires_in
integer
必需
access_token 的过期时间,单位为秒。
refresh_token
string
必需
新的有效refresh_token,老的refresh_token随即失效。
refresh_token_expires_in
integer
必需
refresh_token 的过期时间,单位为秒。 刷新的时候,过期时间不会延期,会继承上一个refresh_token 的过期时间。
open_id
string
必需
scopes
array[string]
必需
access_token包含的scope,如果返回的scope没有包含开发者需要的scope,说明用户没有点击同意授权,开发者在调用相应的openAPI接口的时候,需要让用户授权。
示例
Success Response
{
"result": 1,
"access_token": "xxxxxxx",
"expires_in": 3600,
"refresh_token": "xxxxxx",
"refresh_token_expires_in": 648000,
"scopes": [
"user_info"
]
}
最后修改时间: 3 年前