LINE. Bot. ChannelAccessToken
(line_bot_sdk v0.1.0)
Copy Markdown
API calls for all endpoints tagged ChannelAccessToken.
Summary
Functions
Gets all valid channel access token key IDs.
Issue short-lived channel access token
Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication.
Issues a new stateless channel access token, which doesn't have max active token limit unlike the other token types. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires.
Create a new ChannelAccessToken client.
Revoke short-lived or long-lived channel access token
Revoke channel access token v2.1
Verify the validity of short-lived and long-lived channel access tokens
You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid.
Functions
gets_all_valid_channel_access_token_key_ids(client, client_assertion_type, client_assertion, client_opts \\ [])
Gets all valid channel access token key IDs.
Parameters
client(Req.Request.t/0): Client to make request withclient_assertion_type(String.t/0):urn:ietf:params:oauth:client-assertion-type:jwt-bearerclient_assertion(String.t/0): A JSON Web Token (JWT) (opens new window)the client needs to create and sign with the private key.client_opts(keyword/0): Options to pass toReq.request
Returns
{:ok, LINE.Bot.Model.ChannelAccessTokenKeyIdsResponse.t}on success{:error, Req.Response.t}on failure
Issue short-lived channel access token
Parameters
client(Req.Request.t/0): Client to make request withgrant_type(String.t/0):client_credentialsclient_id(String.t/0): Channel ID.client_secret(String.t/0): Channel secret.client_opts(keyword/0): Options to pass toReq.request
Returns
{:ok, LINE.Bot.Model.IssueShortLivedChannelAccessTokenResponse.t}on success{:error, Req.Response.t}on failure
issue_channel_token_by_jwt(client, grant_type, client_assertion_type, client_assertion, client_opts \\ [])
Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication.
Parameters
client(Req.Request.t/0): Client to make request withgrant_type(String.t/0): client_credentialsclient_assertion_type(String.t/0): urn:ietf:params:oauth:client-assertion-type:jwt-bearerclient_assertion(String.t/0): A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key.client_opts(keyword/0): Options to pass toReq.request
Returns
{:ok, LINE.Bot.Model.IssueChannelAccessTokenResponse.t}on success{:error, Req.Response.t}on failure
Issues a new stateless channel access token, which doesn't have max active token limit unlike the other token types. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires.
Parameters
client(Req.Request.t/0): Client to make request withoptional_args(keyword): Optional parameters:grant_type(String.t/0):client_credentials:client_assertion_type(String.t/0): URL-encoded value ofurn:ietf:params:oauth:client-assertion-type:jwt-bearer:client_assertion(String.t/0): A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key.:client_id(String.t/0): Channel ID.:client_secret(String.t/0): Channel secret.
client_opts(keyword/0): Options to pass toReq.request
Returns
{:ok, LINE.Bot.Model.IssueStatelessChannelAccessTokenResponse.t}on success{:error, Req.Response.t}on failure
Create a new ChannelAccessToken client.
Options
:base_url- base URL for requests (default:"https://api.line.me"):plug- plug to use for testing (seeReq.new/1)
Revoke short-lived or long-lived channel access token
Parameters
client(Req.Request.t/0): Client to make request withaccess_token(String.t/0): A short-lived or long-lived channel access token.client_opts(keyword/0): Options to pass toReq.request
Returns
{:ok, nil}on success{:error, Req.Response.t}on failure
Revoke channel access token v2.1
Parameters
client(Req.Request.t/0): Client to make request withclient_id(String.t/0): Channel IDclient_secret(String.t/0): Channel Secretaccess_token(String.t/0): Channel access tokenclient_opts(keyword/0): Options to pass toReq.request
Returns
{:ok, nil}on success{:error, Req.Response.t}on failure
Verify the validity of short-lived and long-lived channel access tokens
Parameters
client(Req.Request.t/0): Client to make request withaccess_token(String.t/0): A short-lived or long-lived channel access token.client_opts(keyword/0): Options to pass toReq.request
Returns
{:ok, LINE.Bot.Model.VerifyChannelAccessTokenResponse.t}on success{:error, Req.Response.t}on failure
You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid.
Parameters
client(Req.Request.t/0): Client to make request withaccess_token(String.t/0): Channel access token with a user-specified expiration (Channel Access Token v2.1).client_opts(keyword/0): Options to pass toReq.request
Returns
{:ok, LINE.Bot.Model.VerifyChannelAccessTokenResponse.t}on success{:error, Req.Response.t}on failure