liff-server-api
v0.1.0-delta
Published
LIFF Server API Client === [](https://dl.circleci.com/status-badge/redirect/gh/martymarron/liff-server-api-ts/tree/main) [;
const request: IssueAccessTokenRequest
= new IssueAccessTokenRequest({
channelId: '{YOUR_CHANNEL_ID}',
channelSecret: '{YOUR_CHANNEL_SECRET}'
});
const response: MessageApiResponse = await client.issueAccessToken(request);
const accessToken = response.access_token;
console.debug('access token: %s', accessToken);Invoke LIFF Server API
Once you get a channel access token, you next initialize the LiffApiClient object with the channel access token.
Then, you're ready to call the server API.
The snippet below initializes the LiffApiClient and invokes the getAll() method that calls the /liff/v1/apps endpoint which provides all the LIFF apps belonging to your channel.
import {
LiffApiClient,
LiffAppGetRequest,
LiffApiGetRespoinse
} from 'liff-server-api';
const baseUrl = 'https://line.api.me';
const client: LiffApiClient = new LiffApiClient(baseUrl);
const request: LiffAppGetRequest
= new LiffAppGetRequest({
channelAccessToken: '{YOUR_ACCESS_TOKEN}'
});
const response: LiffApiGetRespoinse = await client.getAll(request);
console.debug('Your LIFF apps: %O', response.apps);Contributing
See CONTRIBUTING.md
Credits
Masashi Kurita, [email protected]
Licensing
All rights reserved.
EOD
