一. 获取access_token

OAuth2

WebAPI方式获取access_token

RequestAPIDescription
POSTntWebAPI/v1/oauth2/queTokenAsync获取access_token
POSTntWebAPI/v1/oauth2/refTokenAsync根据refresh_token刷新access_token

通过API方式,获取access_token

url: ntWebAPI/v1/oauth2/queTokenAsync

Request Information

  • Body Parameters
NameDescriptionTypeAdditional information
grant_type请求类型:client_credentialsstringRequired
client_id客户端IDstringRequired
client_secret客户端秘钥stringRequired
  • Request Formats

application/json, text/json

{
  "grant_type": "client_credentials",
  "client_id": "newtype",
  "client_secret": "hh7gsd1"
}

Response Information

  • Resource Description
NameDescriptionTypeAdditional information
access_tokenaccess_tokenstringNone.
token_typebearerstringNone.
expires_inaccess_token过期时间(秒)stringNone.
refresh_tokenrefresh_tokenstringNone.
refresh_expires_inrefresh_token过期时间(秒)stringNone.
client_id客户端client_idstringNone.
resultMSG请求结果信息(成功/失败信息提示)stringNone.
  • Response Formats

application/json, text/json

{
    "access_token": "ZYlHPRoxb25Cae6rvQLA25XCZGB2WXqrwlwmy-cp6Zbm4gWHObO9OGw4IqiMhDjK-CsGoqDfWBiHyjWLQFIJ3SvpDrPac0f3dK57aDMje8hZl6fOlLjqNmjA_GrwOKWbDlTTASq4ZTngVCZwKgO_rdbQ3osQHfk0htsetiETMHCAiMQAdjiUR6CPPazrIIZlGmSCyWeheIdMyK_NWPiNt7Us2Hvd9CRjmTPq1k8dMMg",
    "token_type": "bearer",
    "expires_in": "299",
    "refresh_token": "d9a3d3aa93414f6791f46538498dc4b30a8f6fe4e8b240aaaa535f3d7f66c27f",
    "refresh_expires_in": "2592000",
    "client_id": "ntAPI",
    "resultMSG": "The request is successful"
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值