Skip to content

@line/bot-sdk


@line/bot-sdk / channelAccessToken / ChannelAccessTokenClient

Class: ChannelAccessTokenClient

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:47

Constructors

Constructor

new ChannelAccessTokenClient(config): ChannelAccessTokenClient

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:61

Initializes a new ChannelAccessTokenClient.

Parameters

config

httpClientConfig

Configuration for this API client.

Returns

ChannelAccessTokenClient

Example

ts
const client = new ChannelAccessTokenClient({
});

Methods

getsAllValidChannelAccessTokenKeyIds()

getsAllValidChannelAccessTokenKeyIds(clientAssertionType, clientAssertion): Promise<ChannelAccessTokenKeyIdsResponse>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:79

Gets all valid channel access token key IDs. Calls GET https://api.line.me/oauth2/v2.1/tokens/kid. To inspect the HTTP status code or response headers, use getsAllValidChannelAccessTokenKeyIdsWithHttpInfo.

Parameters

clientAssertionType

string

urn:ietf:params:oauth:client-assertion-type:jwt-bearer

clientAssertion

string

A JSON Web Token (JWT) (opens new window)the client needs to create and sign with the private key.

Returns

Promise<ChannelAccessTokenKeyIdsResponse>

A promise resolving to the response body.

See

LINE Developers documentation


getsAllValidChannelAccessTokenKeyIdsWithHttpInfo()

getsAllValidChannelAccessTokenKeyIdsWithHttpInfo(clientAssertionType, clientAssertion): Promise<ApiResponseType<ChannelAccessTokenKeyIdsResponse>>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:100

Gets all valid channel access token key IDs. Calls GET https://api.line.me/oauth2/v2.1/tokens/kid. This method returns the response body together with the underlying httpResponse.

Parameters

clientAssertionType

string

urn:ietf:params:oauth:client-assertion-type:jwt-bearer

clientAssertion

string

A JSON Web Token (JWT) (opens new window)the client needs to create and sign with the private key.

Returns

Promise<ApiResponseType<ChannelAccessTokenKeyIdsResponse>>

A promise resolving to the response body together with the underlying httpResponse.

See

LINE Developers documentation


issueChannelToken()

issueChannelToken(grantType, clientId, clientSecret): Promise<IssueShortLivedChannelAccessTokenResponse>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:127

Issue short-lived channel access token Calls POST https://api.line.me/v2/oauth/accessToken. To inspect the HTTP status code or response headers, use issueChannelTokenWithHttpInfo.

Parameters

grantType

string

client_credentials

clientId

string

Channel ID.

clientSecret

string

Channel secret.

Returns

Promise<IssueShortLivedChannelAccessTokenResponse>

A promise resolving to the response body.

See

LINE Developers documentation


issueChannelTokenByJWT()

issueChannelTokenByJWT(grantType, clientAssertionType, clientAssertion): Promise<IssueChannelAccessTokenResponse>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:180

Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication. Calls POST https://api.line.me/oauth2/v2.1/token. To inspect the HTTP status code or response headers, use issueChannelTokenByJWTWithHttpInfo.

Parameters

grantType

string

client_credentials

clientAssertionType

string

urn:ietf:params:oauth:client-assertion-type:jwt-bearer

clientAssertion

string

A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key.

Returns

Promise<IssueChannelAccessTokenResponse>

A promise resolving to the response body.

See

LINE Developers documentation


issueChannelTokenByJWTWithHttpInfo()

issueChannelTokenByJWTWithHttpInfo(grantType, clientAssertionType, clientAssertion): Promise<ApiResponseType<IssueChannelAccessTokenResponse>>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:204

Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication. Calls POST https://api.line.me/oauth2/v2.1/token. This method returns the response body together with the underlying httpResponse.

Parameters

grantType

string

client_credentials

clientAssertionType

string

urn:ietf:params:oauth:client-assertion-type:jwt-bearer

clientAssertion

string

A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key.

Returns

Promise<ApiResponseType<IssueChannelAccessTokenResponse>>

A promise resolving to the response body together with the underlying httpResponse.

See

LINE Developers documentation


issueChannelTokenWithHttpInfo()

issueChannelTokenWithHttpInfo(grantType, clientId, clientSecret): Promise<ApiResponseType<IssueShortLivedChannelAccessTokenResponse>>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:151

Issue short-lived channel access token Calls POST https://api.line.me/v2/oauth/accessToken. This method returns the response body together with the underlying httpResponse.

Parameters

grantType

string

client_credentials

clientId

string

Channel ID.

clientSecret

string

Channel secret.

Returns

Promise<ApiResponseType<IssueShortLivedChannelAccessTokenResponse>>

A promise resolving to the response body together with the underlying httpResponse.

See

LINE Developers documentation


issueStatelessChannelToken()

issueStatelessChannelToken(grantType?, clientAssertionType?, clientAssertion?, clientId?, clientSecret?): Promise<IssueStatelessChannelAccessTokenResponse>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:236

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. Calls POST https://api.line.me/oauth2/v3/token. To inspect the HTTP status code or response headers, use issueStatelessChannelTokenWithHttpInfo.

Parameters

grantType?

string

client_credentials

clientAssertionType?

string

URL-encoded value of urn:ietf:params:oauth:client-assertion-type:jwt-bearer

clientAssertion?

string

A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key.

clientId?

string

Channel ID.

clientSecret?

string

Channel secret.

Returns

Promise<IssueStatelessChannelAccessTokenResponse>

A promise resolving to the response body.

Deprecated

Use issueStatelessChannelTokenByJWTAssertion or issueStatelessChannelTokenByClientSecret instead.

See

LINE Developers documentation


issueStatelessChannelTokenByClientSecret()

issueStatelessChannelTokenByClientSecret(clientId, clientSecret): Promise<IssueStatelessChannelAccessTokenResponse>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:492

Issues a new stateless channel access token by client secret. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires. Calls POST https://api.line.me/oauth2/v3/token. To inspect the HTTP status code or response headers, use issueStatelessChannelTokenByClientSecretWithHttpInfo.

Parameters

clientId

string

Channel ID.

clientSecret

string

Channel secret.

Returns

Promise<IssueStatelessChannelAccessTokenResponse>

A promise resolving to the response body.

See

LINE Developers documentation


issueStatelessChannelTokenByClientSecretWithHttpInfo()

issueStatelessChannelTokenByClientSecretWithHttpInfo(clientId, clientSecret): Promise<ApiResponseType<IssueStatelessChannelAccessTokenResponse>>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:534

Issues a new stateless channel access token by client secret. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires. Calls POST https://api.line.me/oauth2/v3/token. This method returns the response body together with the underlying httpResponse.

Parameters

clientId

string

Channel ID.

clientSecret

string

Channel secret.

Returns

Promise<ApiResponseType<IssueStatelessChannelAccessTokenResponse>>

A promise resolving to the response body together with the underlying httpResponse.

See

LINE Developers documentation


issueStatelessChannelTokenByJWTAssertion()

issueStatelessChannelTokenByJWTAssertion(clientAssertion): Promise<IssueStatelessChannelAccessTokenResponse>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:472

Issues a new stateless channel access token by JWT assertion. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires. Calls POST https://api.line.me/oauth2/v3/token. To inspect the HTTP status code or response headers, use issueStatelessChannelTokenByJWTAssertionWithHttpInfo.

Parameters

clientAssertion

string

A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key.

Returns

Promise<IssueStatelessChannelAccessTokenResponse>

A promise resolving to the response body.

See

LINE Developers documentation


issueStatelessChannelTokenByJWTAssertionWithHttpInfo()

issueStatelessChannelTokenByJWTAssertionWithHttpInfo(clientAssertion): Promise<ApiResponseType<IssueStatelessChannelAccessTokenResponse>>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:514

Issues a new stateless channel access token by JWT assertion. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires. Calls POST https://api.line.me/oauth2/v3/token. This method returns the response body together with the underlying httpResponse.

Parameters

clientAssertion

string

A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key.

Returns

Promise<ApiResponseType<IssueStatelessChannelAccessTokenResponse>>

A promise resolving to the response body together with the underlying httpResponse.

See

LINE Developers documentation


issueStatelessChannelTokenWithHttpInfo()

issueStatelessChannelTokenWithHttpInfo(grantType?, clientAssertionType?, clientAssertion?, clientId?, clientSecret?): Promise<ApiResponseType<IssueStatelessChannelAccessTokenResponse>>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:267

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. Calls POST https://api.line.me/oauth2/v3/token. This method returns the response body together with the underlying httpResponse.

Parameters

grantType?

string

client_credentials

clientAssertionType?

string

URL-encoded value of urn:ietf:params:oauth:client-assertion-type:jwt-bearer

clientAssertion?

string

A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key.

clientId?

string

Channel ID.

clientSecret?

string

Channel secret.

Returns

Promise<ApiResponseType<IssueStatelessChannelAccessTokenResponse>>

A promise resolving to the response body together with the underlying httpResponse.

Deprecated

Use issueStatelessChannelTokenByJWTAssertionWithHttpInfo or issueStatelessChannelTokenByClientSecretWithHttpInfo instead.

See

LINE Developers documentation


revokeChannelToken()

revokeChannelToken(accessToken): Promise<MessageAPIResponseBase>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:315

Revoke short-lived or long-lived channel access token Calls POST https://api.line.me/v2/oauth/revoke. To inspect the HTTP status code or response headers, use revokeChannelTokenWithHttpInfo.

Parameters

accessToken

string

A short-lived or long-lived channel access token.

Returns

Promise<MessageAPIResponseBase>

A promise resolving to the response body.

See

LINE Developers documentation


revokeChannelTokenByJWT()

revokeChannelTokenByJWT(clientId, clientSecret, accessToken): Promise<MessageAPIResponseBase>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:351

Revoke channel access token v2.1 Calls POST https://api.line.me/oauth2/v2.1/revoke. To inspect the HTTP status code or response headers, use revokeChannelTokenByJWTWithHttpInfo.

Parameters

clientId

string

Channel ID

clientSecret

string

Channel Secret

accessToken

string

Channel access token

Returns

Promise<MessageAPIResponseBase>

A promise resolving to the response body.

See

LINE Developers documentation


revokeChannelTokenByJWTWithHttpInfo()

revokeChannelTokenByJWTWithHttpInfo(clientId, clientSecret, accessToken): Promise<ApiResponseType<MessageAPIResponseBase>>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:375

Revoke channel access token v2.1 Calls POST https://api.line.me/oauth2/v2.1/revoke. This method returns the response body together with the underlying httpResponse.

Parameters

clientId

string

Channel ID

clientSecret

string

Channel Secret

accessToken

string

Channel access token

Returns

Promise<ApiResponseType<MessageAPIResponseBase>>

A promise resolving to the response body together with the underlying httpResponse.

See

LINE Developers documentation


revokeChannelTokenWithHttpInfo()

revokeChannelTokenWithHttpInfo(accessToken): Promise<ApiResponseType<MessageAPIResponseBase>>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:329

Revoke short-lived or long-lived channel access token Calls POST https://api.line.me/v2/oauth/revoke. This method returns the response body together with the underlying httpResponse.

Parameters

accessToken

string

A short-lived or long-lived channel access token.

Returns

Promise<ApiResponseType<MessageAPIResponseBase>>

A promise resolving to the response body together with the underlying httpResponse.

See

LINE Developers documentation


verifyChannelToken()

verifyChannelToken(accessToken): Promise<VerifyChannelAccessTokenResponse>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:402

Verify the validity of short-lived and long-lived channel access tokens Calls POST https://api.line.me/v2/oauth/verify. To inspect the HTTP status code or response headers, use verifyChannelTokenWithHttpInfo.

Parameters

accessToken

string

A short-lived or long-lived channel access token.

Returns

Promise<VerifyChannelAccessTokenResponse>

A promise resolving to the response body.

See

LINE Developers documentation


verifyChannelTokenByJWT()

verifyChannelTokenByJWT(accessToken): Promise<VerifyChannelAccessTokenResponse>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:436

You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid. Calls GET https://api.line.me/oauth2/v2.1/verify. To inspect the HTTP status code or response headers, use verifyChannelTokenByJWTWithHttpInfo.

Parameters

accessToken

string

Channel access token with a user-specified expiration (Channel Access Token v2.1).

Returns

Promise<VerifyChannelAccessTokenResponse>

A promise resolving to the response body.

See

LINE Developers documentation


verifyChannelTokenByJWTWithHttpInfo()

verifyChannelTokenByJWTWithHttpInfo(accessToken): Promise<ApiResponseType<VerifyChannelAccessTokenResponse>>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:450

You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid. Calls GET https://api.line.me/oauth2/v2.1/verify. This method returns the response body together with the underlying httpResponse.

Parameters

accessToken

string

Channel access token with a user-specified expiration (Channel Access Token v2.1).

Returns

Promise<ApiResponseType<VerifyChannelAccessTokenResponse>>

A promise resolving to the response body together with the underlying httpResponse.

See

LINE Developers documentation


verifyChannelTokenWithHttpInfo()

verifyChannelTokenWithHttpInfo(accessToken): Promise<ApiResponseType<VerifyChannelAccessTokenResponse>>

Defined in: lib/channel-access-token/api/channelAccessTokenClient.ts:416

Verify the validity of short-lived and long-lived channel access tokens Calls POST https://api.line.me/v2/oauth/verify. This method returns the response body together with the underlying httpResponse.

Parameters

accessToken

string

A short-lived or long-lived channel access token.

Returns

Promise<ApiResponseType<VerifyChannelAccessTokenResponse>>

A promise resolving to the response body together with the underlying httpResponse.

See

LINE Developers documentation