我怎样才能获得line messenger api(bot)访问令牌和刷新令牌

时间:2016-11-21 04:44:34

标签: node.js

https://devdocs.line.me/en/#reissuing-access-tokens

B owns A

https://api.line.me/v1/oauth/accessToken

在上面的curl命令中有一个指定的刷新令牌....我怎样才能获得行机器人的刷新令牌?

1 个答案:

答案 0 :(得分:0)

您可以通过登录来获取访问令牌和刷新令牌。

您可以在此处找到相关文档https://developers.line.me/web-api/integrating-web-login#obtain_access_token

对于刷新令牌,您必须向

发送帖子请求
https://api.line.me/v1/oauth/accessToken

Name            Type    Description
grant_type      String  Fixed “authorization_code”.
client_id       String  Channel ID.
client_secret   String  Channel Secret string issued when registering your Channel.
code            String  Acquired authorization code.
redirect_uri    String  Callback URL string passed at issuing the authorization code.

您将获得响应中的令牌

Property         Type   Description
mid              String     ID of authorized user
access_token     String     Access token string
expires_in       Integer    Validity of access token. Elapsed time in seconds from when the access token is issued.
refresh_token    String     Token string necessary to reissue (refresh) a new access token
scope   —   Fixed null value