/**
* LINE Messaging API
* This document describes LINE Messaging API.
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import HTTPFetchClient, { mergeHeaders, } from "../../http-fetch.js";
export class MessagingApiClient {
httpClient;
constructor(config) {
const baseURL = config.baseURL || "https://api.line.me";
const defaultHeaders = mergeHeaders(config.defaultHeaders, {
Authorization: "Bearer " + config.channelAccessToken,
});
this.httpClient = new HTTPFetchClient({
defaultHeaders: defaultHeaders,
baseURL: baseURL,
});
}
/**
* Sends a message to multiple users at any time.
* @param broadcastRequest
* @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
*
* @see Documentation
*/
async broadcast(broadcastRequest, xLineRetryKey) {
return (await this.broadcastWithHttpInfo(broadcastRequest, xLineRetryKey))
.body;
}
/**
* Sends a message to multiple users at any time..
* This method includes HttpInfo object to return additional information.
* @param broadcastRequest
* @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
*
* @see Documentation
*/
async broadcastWithHttpInfo(broadcastRequest, xLineRetryKey) {
const params = broadcastRequest;
const headerParams = {
...(xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}),
};
const res = await this.httpClient.post("/v2/bot/message/broadcast", params, { headers: headerParams });
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Cancel default rich menu
*
* @see Documentation
*/
async cancelDefaultRichMenu() {
return (await this.cancelDefaultRichMenuWithHttpInfo()).body;
}
/**
* Cancel default rich menu.
* This method includes HttpInfo object to return additional information.
*
* @see Documentation
*/
async cancelDefaultRichMenuWithHttpInfo() {
const res = await this.httpClient.delete("/v2/bot/user/all/richmenu");
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Close coupon
* @param couponId
*
* @see Documentation
*/
async closeCoupon(couponId) {
return (await this.closeCouponWithHttpInfo(couponId)).body;
}
/**
* Close coupon.
* This method includes HttpInfo object to return additional information.
* @param couponId
*
* @see Documentation
*/
async closeCouponWithHttpInfo(couponId) {
const res = await this.httpClient.put("/v2/bot/coupon/{couponId}/close".replace("{couponId}", String(couponId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Create a new coupon. Define coupon details such as type, title, and validity period.
* @param couponCreateRequest
*
* @see Documentation
*/
async createCoupon(couponCreateRequest) {
return (await this.createCouponWithHttpInfo(couponCreateRequest)).body;
}
/**
* Create a new coupon. Define coupon details such as type, title, and validity period..
* This method includes HttpInfo object to return additional information.
* @param couponCreateRequest
*
* @see Documentation
*/
async createCouponWithHttpInfo(couponCreateRequest) {
const params = couponCreateRequest;
const res = await this.httpClient.post("/v2/bot/coupon", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Create rich menu
* @param richMenuRequest
*
* @see Documentation
*/
async createRichMenu(richMenuRequest) {
return (await this.createRichMenuWithHttpInfo(richMenuRequest)).body;
}
/**
* Create rich menu.
* This method includes HttpInfo object to return additional information.
* @param richMenuRequest
*
* @see Documentation
*/
async createRichMenuWithHttpInfo(richMenuRequest) {
const params = richMenuRequest;
const res = await this.httpClient.post("/v2/bot/richmenu", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Create rich menu alias
* @param createRichMenuAliasRequest
*
* @see Documentation
*/
async createRichMenuAlias(createRichMenuAliasRequest) {
return (await this.createRichMenuAliasWithHttpInfo(createRichMenuAliasRequest)).body;
}
/**
* Create rich menu alias.
* This method includes HttpInfo object to return additional information.
* @param createRichMenuAliasRequest
*
* @see Documentation
*/
async createRichMenuAliasWithHttpInfo(createRichMenuAliasRequest) {
const params = createRichMenuAliasRequest;
const res = await this.httpClient.post("/v2/bot/richmenu/alias", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Deletes a rich menu.
* @param richMenuId ID of a rich menu
*
* @see Documentation
*/
async deleteRichMenu(richMenuId) {
return (await this.deleteRichMenuWithHttpInfo(richMenuId)).body;
}
/**
* Deletes a rich menu..
* This method includes HttpInfo object to return additional information.
* @param richMenuId ID of a rich menu
*
* @see Documentation
*/
async deleteRichMenuWithHttpInfo(richMenuId) {
const res = await this.httpClient.delete("/v2/bot/richmenu/{richMenuId}".replace("{richMenuId}", String(richMenuId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Delete rich menu alias
* @param richMenuAliasId Rich menu alias ID that you want to delete.
*
* @see Documentation
*/
async deleteRichMenuAlias(richMenuAliasId) {
return (await this.deleteRichMenuAliasWithHttpInfo(richMenuAliasId)).body;
}
/**
* Delete rich menu alias.
* This method includes HttpInfo object to return additional information.
* @param richMenuAliasId Rich menu alias ID that you want to delete.
*
* @see Documentation
*/
async deleteRichMenuAliasWithHttpInfo(richMenuAliasId) {
const res = await this.httpClient.delete("/v2/bot/richmenu/alias/{richMenuAliasId}".replace("{richMenuAliasId}", String(richMenuAliasId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get name list of units used this month
* @param limit The maximum number of aggregation units you can get per request.
* @param start Value of the continuation token found in the next property of the JSON object returned in the response. If you can\'t get all the aggregation units in one request, include this parameter to get the remaining array.
*
* @see Documentation
*/
async getAggregationUnitNameList(limit, start) {
return (await this.getAggregationUnitNameListWithHttpInfo(limit, start))
.body;
}
/**
* Get name list of units used this month.
* This method includes HttpInfo object to return additional information.
* @param limit The maximum number of aggregation units you can get per request.
* @param start Value of the continuation token found in the next property of the JSON object returned in the response. If you can\'t get all the aggregation units in one request, include this parameter to get the remaining array.
*
* @see Documentation
*/
async getAggregationUnitNameListWithHttpInfo(limit, start) {
const queryParams = {
limit: limit,
start: start,
};
Object.keys(queryParams).forEach((key) => {
if (queryParams[key] === undefined) {
delete queryParams[key];
}
});
const res = await this.httpClient.get("/v2/bot/message/aggregation/list", queryParams);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get number of units used this month
*
* @see Documentation
*/
async getAggregationUnitUsage() {
return (await this.getAggregationUnitUsageWithHttpInfo()).body;
}
/**
* Get number of units used this month.
* This method includes HttpInfo object to return additional information.
*
* @see Documentation
*/
async getAggregationUnitUsageWithHttpInfo() {
const res = await this.httpClient.get("/v2/bot/message/aggregation/info");
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get bot info
*
* @see Documentation
*/
async getBotInfo() {
return (await this.getBotInfoWithHttpInfo()).body;
}
/**
* Get bot info.
* This method includes HttpInfo object to return additional information.
*
* @see Documentation
*/
async getBotInfoWithHttpInfo() {
const res = await this.httpClient.get("/v2/bot/info");
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get coupon detail
* @param couponId
*
* @see Documentation
*/
async getCouponDetail(couponId) {
return (await this.getCouponDetailWithHttpInfo(couponId)).body;
}
/**
* Get coupon detail.
* This method includes HttpInfo object to return additional information.
* @param couponId
*
* @see Documentation
*/
async getCouponDetailWithHttpInfo(couponId) {
const res = await this.httpClient.get("/v2/bot/coupon/{couponId}".replace("{couponId}", String(couponId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Gets the ID of the default rich menu set with the Messaging API.
*
* @see Documentation
*/
async getDefaultRichMenuId() {
return (await this.getDefaultRichMenuIdWithHttpInfo()).body;
}
/**
* Gets the ID of the default rich menu set with the Messaging API..
* This method includes HttpInfo object to return additional information.
*
* @see Documentation
*/
async getDefaultRichMenuIdWithHttpInfo() {
const res = await this.httpClient.get("/v2/bot/user/all/richmenu");
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get a list of users who added your LINE Official Account as a friend
* @param start Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs.
* @param limit The maximum number of user IDs to retrieve in a single request.
*
* @see Documentation
*/
async getFollowers(start, limit) {
return (await this.getFollowersWithHttpInfo(start, limit)).body;
}
/**
* Get a list of users who added your LINE Official Account as a friend.
* This method includes HttpInfo object to return additional information.
* @param start Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs.
* @param limit The maximum number of user IDs to retrieve in a single request.
*
* @see Documentation
*/
async getFollowersWithHttpInfo(start, limit) {
const queryParams = {
start: start,
limit: limit,
};
Object.keys(queryParams).forEach((key) => {
if (queryParams[key] === undefined) {
delete queryParams[key];
}
});
const res = await this.httpClient.get("/v2/bot/followers/ids", queryParams);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get number of users in a group chat
* @param groupId Group ID
*
* @see Documentation
*/
async getGroupMemberCount(groupId) {
return (await this.getGroupMemberCountWithHttpInfo(groupId)).body;
}
/**
* Get number of users in a group chat.
* This method includes HttpInfo object to return additional information.
* @param groupId Group ID
*
* @see Documentation
*/
async getGroupMemberCountWithHttpInfo(groupId) {
const res = await this.httpClient.get("/v2/bot/group/{groupId}/members/count".replace("{groupId}", String(groupId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get group chat member profile
* @param groupId Group ID
* @param userId User ID
*
* @see Documentation
*/
async getGroupMemberProfile(groupId, userId) {
return (await this.getGroupMemberProfileWithHttpInfo(groupId, userId)).body;
}
/**
* Get group chat member profile.
* This method includes HttpInfo object to return additional information.
* @param groupId Group ID
* @param userId User ID
*
* @see Documentation
*/
async getGroupMemberProfileWithHttpInfo(groupId, userId) {
const res = await this.httpClient.get("/v2/bot/group/{groupId}/member/{userId}"
.replace("{groupId}", String(groupId))
.replace("{userId}", String(userId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get group chat member user IDs
* @param groupId Group ID
* @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group.
*
* @see Documentation
*/
async getGroupMembersIds(groupId, start) {
return (await this.getGroupMembersIdsWithHttpInfo(groupId, start)).body;
}
/**
* Get group chat member user IDs.
* This method includes HttpInfo object to return additional information.
* @param groupId Group ID
* @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group.
*
* @see Documentation
*/
async getGroupMembersIdsWithHttpInfo(groupId, start) {
const queryParams = {
start: start,
};
Object.keys(queryParams).forEach((key) => {
if (queryParams[key] === undefined) {
delete queryParams[key];
}
});
const res = await this.httpClient.get("/v2/bot/group/{groupId}/members/ids".replace("{groupId}", String(groupId)), queryParams);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get group chat summary
* @param groupId Group ID
*
* @see Documentation
*/
async getGroupSummary(groupId) {
return (await this.getGroupSummaryWithHttpInfo(groupId)).body;
}
/**
* Get group chat summary.
* This method includes HttpInfo object to return additional information.
* @param groupId Group ID
*
* @see Documentation
*/
async getGroupSummaryWithHttpInfo(groupId) {
const res = await this.httpClient.get("/v2/bot/group/{groupId}/summary".replace("{groupId}", String(groupId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get a list of user IDs who joined the membership.
* @param membershipId Membership plan ID.
* @param start A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren\'t returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds).
* @param limit The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000.
*
* @see Documentation
*/
async getJoinedMembershipUsers(membershipId, start, limit) {
return (await this.getJoinedMembershipUsersWithHttpInfo(membershipId, start, limit)).body;
}
/**
* Get a list of user IDs who joined the membership..
* This method includes HttpInfo object to return additional information.
* @param membershipId Membership plan ID.
* @param start A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren\'t returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds).
* @param limit The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000.
*
* @see Documentation
*/
async getJoinedMembershipUsersWithHttpInfo(membershipId, start, limit) {
const queryParams = {
start: start,
limit: limit,
};
Object.keys(queryParams).forEach((key) => {
if (queryParams[key] === undefined) {
delete queryParams[key];
}
});
const res = await this.httpClient.get("/v2/bot/membership/{membershipId}/users/ids".replace("{membershipId}", String(membershipId)), queryParams);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get a list of memberships.
*
* @see Documentation
*/
async getMembershipList() {
return (await this.getMembershipListWithHttpInfo()).body;
}
/**
* Get a list of memberships..
* This method includes HttpInfo object to return additional information.
*
* @see Documentation
*/
async getMembershipListWithHttpInfo() {
const res = await this.httpClient.get("/v2/bot/membership/list");
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get a user\'s membership subscription.
* @param userId User ID
*
* @see Documentation
*/
async getMembershipSubscription(userId) {
return (await this.getMembershipSubscriptionWithHttpInfo(userId)).body;
}
/**
* Get a user\'s membership subscription..
* This method includes HttpInfo object to return additional information.
* @param userId User ID
*
* @see Documentation
*/
async getMembershipSubscriptionWithHttpInfo(userId) {
const res = await this.httpClient.get("/v2/bot/membership/subscription/{userId}".replace("{userId}", String(userId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned.
*
* @see Documentation
*/
async getMessageQuota() {
return (await this.getMessageQuotaWithHttpInfo()).body;
}
/**
* Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned..
* This method includes HttpInfo object to return additional information.
*
* @see Documentation
*/
async getMessageQuotaWithHttpInfo() {
const res = await this.httpClient.get("/v2/bot/message/quota");
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Gets the number of messages sent in the current month.
*
* @see Documentation
*/
async getMessageQuotaConsumption() {
return (await this.getMessageQuotaConsumptionWithHttpInfo()).body;
}
/**
* Gets the number of messages sent in the current month..
* This method includes HttpInfo object to return additional information.
*
* @see Documentation
*/
async getMessageQuotaConsumptionWithHttpInfo() {
const res = await this.httpClient.get("/v2/bot/message/quota/consumption");
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Gets the status of a narrowcast message.
* @param requestId The narrowcast message\'s request ID. Each Messaging API request has a request ID.
*
* @see Documentation
*/
async getNarrowcastProgress(requestId) {
return (await this.getNarrowcastProgressWithHttpInfo(requestId)).body;
}
/**
* Gets the status of a narrowcast message..
* This method includes HttpInfo object to return additional information.
* @param requestId The narrowcast message\'s request ID. Each Messaging API request has a request ID.
*
* @see Documentation
*/
async getNarrowcastProgressWithHttpInfo(requestId) {
const queryParams = {
requestId: requestId,
};
Object.keys(queryParams).forEach((key) => {
if (queryParams[key] === undefined) {
delete queryParams[key];
}
});
const res = await this.httpClient.get("/v2/bot/message/progress/narrowcast", queryParams);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get number of sent broadcast messages
* @param date Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9
*
* @see Documentation
*/
async getNumberOfSentBroadcastMessages(date) {
return (await this.getNumberOfSentBroadcastMessagesWithHttpInfo(date)).body;
}
/**
* Get number of sent broadcast messages.
* This method includes HttpInfo object to return additional information.
* @param date Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9
*
* @see Documentation
*/
async getNumberOfSentBroadcastMessagesWithHttpInfo(date) {
const queryParams = {
date: date,
};
Object.keys(queryParams).forEach((key) => {
if (queryParams[key] === undefined) {
delete queryParams[key];
}
});
const res = await this.httpClient.get("/v2/bot/message/delivery/broadcast", queryParams);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get number of sent multicast messages
* @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9
*
* @see Documentation
*/
async getNumberOfSentMulticastMessages(date) {
return (await this.getNumberOfSentMulticastMessagesWithHttpInfo(date)).body;
}
/**
* Get number of sent multicast messages.
* This method includes HttpInfo object to return additional information.
* @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9
*
* @see Documentation
*/
async getNumberOfSentMulticastMessagesWithHttpInfo(date) {
const queryParams = {
date: date,
};
Object.keys(queryParams).forEach((key) => {
if (queryParams[key] === undefined) {
delete queryParams[key];
}
});
const res = await this.httpClient.get("/v2/bot/message/delivery/multicast", queryParams);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get number of sent push messages
* @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9
*
* @see Documentation
*/
async getNumberOfSentPushMessages(date) {
return (await this.getNumberOfSentPushMessagesWithHttpInfo(date)).body;
}
/**
* Get number of sent push messages.
* This method includes HttpInfo object to return additional information.
* @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9
*
* @see Documentation
*/
async getNumberOfSentPushMessagesWithHttpInfo(date) {
const queryParams = {
date: date,
};
Object.keys(queryParams).forEach((key) => {
if (queryParams[key] === undefined) {
delete queryParams[key];
}
});
const res = await this.httpClient.get("/v2/bot/message/delivery/push", queryParams);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get number of sent reply messages
* @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9
*
* @see Documentation
*/
async getNumberOfSentReplyMessages(date) {
return (await this.getNumberOfSentReplyMessagesWithHttpInfo(date)).body;
}
/**
* Get number of sent reply messages.
* This method includes HttpInfo object to return additional information.
* @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9
*
* @see Documentation
*/
async getNumberOfSentReplyMessagesWithHttpInfo(date) {
const queryParams = {
date: date,
};
Object.keys(queryParams).forEach((key) => {
if (queryParams[key] === undefined) {
delete queryParams[key];
}
});
const res = await this.httpClient.get("/v2/bot/message/delivery/reply", queryParams);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get number of sent LINE notification messages
* @param date Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9
*
* @see Documentation
*/
async getPNPMessageStatistics(date) {
return (await this.getPNPMessageStatisticsWithHttpInfo(date)).body;
}
/**
* Get number of sent LINE notification messages .
* This method includes HttpInfo object to return additional information.
* @param date Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9
*
* @see Documentation
*/
async getPNPMessageStatisticsWithHttpInfo(date) {
const queryParams = {
date: date,
};
Object.keys(queryParams).forEach((key) => {
if (queryParams[key] === undefined) {
delete queryParams[key];
}
});
const res = await this.httpClient.get("/v2/bot/message/delivery/pnp", queryParams);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get profile
* @param userId User ID
*
* @see Documentation
*/
async getProfile(userId) {
return (await this.getProfileWithHttpInfo(userId)).body;
}
/**
* Get profile.
* This method includes HttpInfo object to return additional information.
* @param userId User ID
*
* @see Documentation
*/
async getProfileWithHttpInfo(userId) {
const res = await this.httpClient.get("/v2/bot/profile/{userId}".replace("{userId}", String(userId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Gets a rich menu via a rich menu ID.
* @param richMenuId ID of a rich menu
*
* @see Documentation
*/
async getRichMenu(richMenuId) {
return (await this.getRichMenuWithHttpInfo(richMenuId)).body;
}
/**
* Gets a rich menu via a rich menu ID..
* This method includes HttpInfo object to return additional information.
* @param richMenuId ID of a rich menu
*
* @see Documentation
*/
async getRichMenuWithHttpInfo(richMenuId) {
const res = await this.httpClient.get("/v2/bot/richmenu/{richMenuId}".replace("{richMenuId}", String(richMenuId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get rich menu alias information
* @param richMenuAliasId The rich menu alias ID whose information you want to obtain.
*
* @see Documentation
*/
async getRichMenuAlias(richMenuAliasId) {
return (await this.getRichMenuAliasWithHttpInfo(richMenuAliasId)).body;
}
/**
* Get rich menu alias information.
* This method includes HttpInfo object to return additional information.
* @param richMenuAliasId The rich menu alias ID whose information you want to obtain.
*
* @see Documentation
*/
async getRichMenuAliasWithHttpInfo(richMenuAliasId) {
const res = await this.httpClient.get("/v2/bot/richmenu/alias/{richMenuAliasId}".replace("{richMenuAliasId}", String(richMenuAliasId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get list of rich menu alias
*
* @see Documentation
*/
async getRichMenuAliasList() {
return (await this.getRichMenuAliasListWithHttpInfo()).body;
}
/**
* Get list of rich menu alias.
* This method includes HttpInfo object to return additional information.
*
* @see Documentation
*/
async getRichMenuAliasListWithHttpInfo() {
const res = await this.httpClient.get("/v2/bot/richmenu/alias/list");
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get the status of Replace or unlink a linked rich menus in batches.
* @param requestId A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID.
*
* @see Documentation
*/
async getRichMenuBatchProgress(requestId) {
return (await this.getRichMenuBatchProgressWithHttpInfo(requestId)).body;
}
/**
* Get the status of Replace or unlink a linked rich menus in batches..
* This method includes HttpInfo object to return additional information.
* @param requestId A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID.
*
* @see Documentation
*/
async getRichMenuBatchProgressWithHttpInfo(requestId) {
const queryParams = {
requestId: requestId,
};
Object.keys(queryParams).forEach((key) => {
if (queryParams[key] === undefined) {
delete queryParams[key];
}
});
const res = await this.httpClient.get("/v2/bot/richmenu/progress/batch", queryParams);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get rich menu ID of user
* @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
*
* @see Documentation
*/
async getRichMenuIdOfUser(userId) {
return (await this.getRichMenuIdOfUserWithHttpInfo(userId)).body;
}
/**
* Get rich menu ID of user.
* This method includes HttpInfo object to return additional information.
* @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
*
* @see Documentation
*/
async getRichMenuIdOfUserWithHttpInfo(userId) {
const res = await this.httpClient.get("/v2/bot/user/{userId}/richmenu".replace("{userId}", String(userId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get rich menu list
*
* @see Documentation
*/
async getRichMenuList() {
return (await this.getRichMenuListWithHttpInfo()).body;
}
/**
* Get rich menu list.
* This method includes HttpInfo object to return additional information.
*
* @see Documentation
*/
async getRichMenuListWithHttpInfo() {
const res = await this.httpClient.get("/v2/bot/richmenu/list");
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get number of users in a multi-person chat
* @param roomId Room ID
*
* @see Documentation
*/
async getRoomMemberCount(roomId) {
return (await this.getRoomMemberCountWithHttpInfo(roomId)).body;
}
/**
* Get number of users in a multi-person chat.
* This method includes HttpInfo object to return additional information.
* @param roomId Room ID
*
* @see Documentation
*/
async getRoomMemberCountWithHttpInfo(roomId) {
const res = await this.httpClient.get("/v2/bot/room/{roomId}/members/count".replace("{roomId}", String(roomId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get multi-person chat member profile
* @param roomId Room ID
* @param userId User ID
*
* @see Documentation
*/
async getRoomMemberProfile(roomId, userId) {
return (await this.getRoomMemberProfileWithHttpInfo(roomId, userId)).body;
}
/**
* Get multi-person chat member profile.
* This method includes HttpInfo object to return additional information.
* @param roomId Room ID
* @param userId User ID
*
* @see Documentation
*/
async getRoomMemberProfileWithHttpInfo(roomId, userId) {
const res = await this.httpClient.get("/v2/bot/room/{roomId}/member/{userId}"
.replace("{roomId}", String(roomId))
.replace("{userId}", String(userId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get multi-person chat member user IDs
* @param roomId Room ID
* @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group.
*
* @see Documentation
*/
async getRoomMembersIds(roomId, start) {
return (await this.getRoomMembersIdsWithHttpInfo(roomId, start)).body;
}
/**
* Get multi-person chat member user IDs.
* This method includes HttpInfo object to return additional information.
* @param roomId Room ID
* @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group.
*
* @see Documentation
*/
async getRoomMembersIdsWithHttpInfo(roomId, start) {
const queryParams = {
start: start,
};
Object.keys(queryParams).forEach((key) => {
if (queryParams[key] === undefined) {
delete queryParams[key];
}
});
const res = await this.httpClient.get("/v2/bot/room/{roomId}/members/ids".replace("{roomId}", String(roomId)), queryParams);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get webhook endpoint information
*
* @see Documentation
*/
async getWebhookEndpoint() {
return (await this.getWebhookEndpointWithHttpInfo()).body;
}
/**
* Get webhook endpoint information.
* This method includes HttpInfo object to return additional information.
*
* @see Documentation
*/
async getWebhookEndpointWithHttpInfo() {
const res = await this.httpClient.get("/v2/bot/channel/webhook/endpoint");
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Issue link token
* @param userId User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE.
*
* @see Documentation
*/
async issueLinkToken(userId) {
return (await this.issueLinkTokenWithHttpInfo(userId)).body;
}
/**
* Issue link token.
* This method includes HttpInfo object to return additional information.
* @param userId User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE.
*
* @see Documentation
*/
async issueLinkTokenWithHttpInfo(userId) {
const res = await this.httpClient.post("/v2/bot/user/{userId}/linkToken".replace("{userId}", String(userId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Leave group chat
* @param groupId Group ID
*
* @see Documentation
*/
async leaveGroup(groupId) {
return (await this.leaveGroupWithHttpInfo(groupId)).body;
}
/**
* Leave group chat.
* This method includes HttpInfo object to return additional information.
* @param groupId Group ID
*
* @see Documentation
*/
async leaveGroupWithHttpInfo(groupId) {
const res = await this.httpClient.post("/v2/bot/group/{groupId}/leave".replace("{groupId}", String(groupId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Leave multi-person chat
* @param roomId Room ID
*
* @see Documentation
*/
async leaveRoom(roomId) {
return (await this.leaveRoomWithHttpInfo(roomId)).body;
}
/**
* Leave multi-person chat.
* This method includes HttpInfo object to return additional information.
* @param roomId Room ID
*
* @see Documentation
*/
async leaveRoomWithHttpInfo(roomId) {
const res = await this.httpClient.post("/v2/bot/room/{roomId}/leave".replace("{roomId}", String(roomId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Link rich menu to user.
* @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
* @param richMenuId ID of a rich menu
*
* @see Documentation
*/
async linkRichMenuIdToUser(userId, richMenuId) {
return (await this.linkRichMenuIdToUserWithHttpInfo(userId, richMenuId))
.body;
}
/**
* Link rich menu to user..
* This method includes HttpInfo object to return additional information.
* @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
* @param richMenuId ID of a rich menu
*
* @see Documentation
*/
async linkRichMenuIdToUserWithHttpInfo(userId, richMenuId) {
const res = await this.httpClient.post("/v2/bot/user/{userId}/richmenu/{richMenuId}"
.replace("{userId}", String(userId))
.replace("{richMenuId}", String(richMenuId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Link rich menu to multiple users
* @param richMenuBulkLinkRequest
*
* @see Documentation
*/
async linkRichMenuIdToUsers(richMenuBulkLinkRequest) {
return (await this.linkRichMenuIdToUsersWithHttpInfo(richMenuBulkLinkRequest)).body;
}
/**
* Link rich menu to multiple users.
* This method includes HttpInfo object to return additional information.
* @param richMenuBulkLinkRequest
*
* @see Documentation
*/
async linkRichMenuIdToUsersWithHttpInfo(richMenuBulkLinkRequest) {
const params = richMenuBulkLinkRequest;
const res = await this.httpClient.post("/v2/bot/richmenu/bulk/link", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Get a paginated list of coupons.
* @param status Filter coupons by their status.
* @param start Pagination token to retrieve the next page of results.
* @param limit Maximum number of coupons to return per request.
*
* @see Documentation
*/
async listCoupon(status, start, limit) {
return (await this.listCouponWithHttpInfo(status, start, limit)).body;
}
/**
* Get a paginated list of coupons..
* This method includes HttpInfo object to return additional information.
* @param status Filter coupons by their status.
* @param start Pagination token to retrieve the next page of results.
* @param limit Maximum number of coupons to return per request.
*
* @see Documentation
*/
async listCouponWithHttpInfo(status, start, limit) {
const queryParams = {
status: [...status].join(","),
start: start,
limit: limit,
};
Object.keys(queryParams).forEach((key) => {
if (queryParams[key] === undefined) {
delete queryParams[key];
}
});
const res = await this.httpClient.get("/v2/bot/coupon", queryParams);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Mark messages from users as read
* @param markMessagesAsReadRequest
*
* @see Documentation
*/
async markMessagesAsRead(markMessagesAsReadRequest) {
return (await this.markMessagesAsReadWithHttpInfo(markMessagesAsReadRequest)).body;
}
/**
* Mark messages from users as read.
* This method includes HttpInfo object to return additional information.
* @param markMessagesAsReadRequest
*
* @see Documentation
*/
async markMessagesAsReadWithHttpInfo(markMessagesAsReadRequest) {
const params = markMessagesAsReadRequest;
const res = await this.httpClient.post("/v2/bot/message/markAsRead", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Mark messages from users as read by token
* @param markMessagesAsReadByTokenRequest
*
* @see Documentation
*/
async markMessagesAsReadByToken(markMessagesAsReadByTokenRequest) {
return (await this.markMessagesAsReadByTokenWithHttpInfo(markMessagesAsReadByTokenRequest)).body;
}
/**
* Mark messages from users as read by token.
* This method includes HttpInfo object to return additional information.
* @param markMessagesAsReadByTokenRequest
*
* @see Documentation
*/
async markMessagesAsReadByTokenWithHttpInfo(markMessagesAsReadByTokenRequest) {
const params = markMessagesAsReadByTokenRequest;
const res = await this.httpClient.post("/v2/bot/chat/markAsRead", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* An API that efficiently sends the same message to multiple user IDs. You can\'t send messages to group chats or multi-person chats.
* @param multicastRequest
* @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
*
* @see Documentation
*/
async multicast(multicastRequest, xLineRetryKey) {
return (await this.multicastWithHttpInfo(multicastRequest, xLineRetryKey))
.body;
}
/**
* An API that efficiently sends the same message to multiple user IDs. You can\'t send messages to group chats or multi-person chats..
* This method includes HttpInfo object to return additional information.
* @param multicastRequest
* @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
*
* @see Documentation
*/
async multicastWithHttpInfo(multicastRequest, xLineRetryKey) {
const params = multicastRequest;
const headerParams = {
...(xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}),
};
const res = await this.httpClient.post("/v2/bot/message/multicast", params, { headers: headerParams });
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Send narrowcast message
* @param narrowcastRequest
* @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
*
* @see Documentation
*/
async narrowcast(narrowcastRequest, xLineRetryKey) {
return (await this.narrowcastWithHttpInfo(narrowcastRequest, xLineRetryKey))
.body;
}
/**
* Send narrowcast message.
* This method includes HttpInfo object to return additional information.
* @param narrowcastRequest
* @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
*
* @see Documentation
*/
async narrowcastWithHttpInfo(narrowcastRequest, xLineRetryKey) {
const params = narrowcastRequest;
const headerParams = {
...(xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}),
};
const res = await this.httpClient.post("/v2/bot/message/narrowcast", params, { headers: headerParams });
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Sends a message to a user, group chat, or multi-person chat at any time.
* @param pushMessageRequest
* @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
*
* @see Documentation
*/
async pushMessage(pushMessageRequest, xLineRetryKey) {
return (await this.pushMessageWithHttpInfo(pushMessageRequest, xLineRetryKey)).body;
}
/**
* Sends a message to a user, group chat, or multi-person chat at any time..
* This method includes HttpInfo object to return additional information.
* @param pushMessageRequest
* @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
*
* @see Documentation
*/
async pushMessageWithHttpInfo(pushMessageRequest, xLineRetryKey) {
const params = pushMessageRequest;
const headerParams = {
...(xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}),
};
const res = await this.httpClient.post("/v2/bot/message/push", params, { headers: headerParams });
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Send LINE notification message
* @param pnpMessagesRequest
* @param xLineDeliveryTag String returned in the delivery.data property of the delivery completion event via Webhook.
*
* @see Documentation
*/
async pushMessagesByPhone(pnpMessagesRequest, xLineDeliveryTag) {
return (await this.pushMessagesByPhoneWithHttpInfo(pnpMessagesRequest, xLineDeliveryTag)).body;
}
/**
* Send LINE notification message.
* This method includes HttpInfo object to return additional information.
* @param pnpMessagesRequest
* @param xLineDeliveryTag String returned in the delivery.data property of the delivery completion event via Webhook.
*
* @see Documentation
*/
async pushMessagesByPhoneWithHttpInfo(pnpMessagesRequest, xLineDeliveryTag) {
const params = pnpMessagesRequest;
const headerParams = {
...(xLineDeliveryTag != null
? { "X-Line-Delivery-Tag": xLineDeliveryTag }
: {}),
};
const res = await this.httpClient.post("/bot/pnp/push", params, { headers: headerParams });
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Send reply message
* @param replyMessageRequest
*
* @see Documentation
*/
async replyMessage(replyMessageRequest) {
return (await this.replyMessageWithHttpInfo(replyMessageRequest)).body;
}
/**
* Send reply message.
* This method includes HttpInfo object to return additional information.
* @param replyMessageRequest
*
* @see Documentation
*/
async replyMessageWithHttpInfo(replyMessageRequest) {
const params = replyMessageRequest;
const res = await this.httpClient.post("/v2/bot/message/reply", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu
* @param richMenuBatchRequest
*
* @see Documentation
*/
async richMenuBatch(richMenuBatchRequest) {
return (await this.richMenuBatchWithHttpInfo(richMenuBatchRequest)).body;
}
/**
* You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu .
* This method includes HttpInfo object to return additional information.
* @param richMenuBatchRequest
*
* @see Documentation
*/
async richMenuBatchWithHttpInfo(richMenuBatchRequest) {
const params = richMenuBatchRequest;
const res = await this.httpClient.post("/v2/bot/richmenu/batch", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Set default rich menu
* @param richMenuId ID of a rich menu
*
* @see Documentation
*/
async setDefaultRichMenu(richMenuId) {
return (await this.setDefaultRichMenuWithHttpInfo(richMenuId)).body;
}
/**
* Set default rich menu.
* This method includes HttpInfo object to return additional information.
* @param richMenuId ID of a rich menu
*
* @see Documentation
*/
async setDefaultRichMenuWithHttpInfo(richMenuId) {
const res = await this.httpClient.post("/v2/bot/user/all/richmenu/{richMenuId}".replace("{richMenuId}", String(richMenuId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Set webhook endpoint URL
* @param setWebhookEndpointRequest
*
* @see Documentation
*/
async setWebhookEndpoint(setWebhookEndpointRequest) {
return (await this.setWebhookEndpointWithHttpInfo(setWebhookEndpointRequest)).body;
}
/**
* Set webhook endpoint URL.
* This method includes HttpInfo object to return additional information.
* @param setWebhookEndpointRequest
*
* @see Documentation
*/
async setWebhookEndpointWithHttpInfo(setWebhookEndpointRequest) {
const params = setWebhookEndpointRequest;
const res = await this.httpClient.put("/v2/bot/channel/webhook/endpoint", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Display a loading animation in one-on-one chats between users and LINE Official Accounts.
* @param showLoadingAnimationRequest
*
* @see Documentation
*/
async showLoadingAnimation(showLoadingAnimationRequest) {
return (await this.showLoadingAnimationWithHttpInfo(showLoadingAnimationRequest)).body;
}
/**
* Display a loading animation in one-on-one chats between users and LINE Official Accounts..
* This method includes HttpInfo object to return additional information.
* @param showLoadingAnimationRequest
*
* @see Documentation
*/
async showLoadingAnimationWithHttpInfo(showLoadingAnimationRequest) {
const params = showLoadingAnimationRequest;
const res = await this.httpClient.post("/v2/bot/chat/loading/start", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Test webhook endpoint
* @param testWebhookEndpointRequest
*
* @see Documentation
*/
async testWebhookEndpoint(testWebhookEndpointRequest) {
return (await this.testWebhookEndpointWithHttpInfo(testWebhookEndpointRequest)).body;
}
/**
* Test webhook endpoint.
* This method includes HttpInfo object to return additional information.
* @param testWebhookEndpointRequest
*
* @see Documentation
*/
async testWebhookEndpointWithHttpInfo(testWebhookEndpointRequest) {
const params = testWebhookEndpointRequest;
const res = await this.httpClient.post("/v2/bot/channel/webhook/test", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Unlink rich menu from user
* @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
*
* @see Documentation
*/
async unlinkRichMenuIdFromUser(userId) {
return (await this.unlinkRichMenuIdFromUserWithHttpInfo(userId)).body;
}
/**
* Unlink rich menu from user.
* This method includes HttpInfo object to return additional information.
* @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
*
* @see Documentation
*/
async unlinkRichMenuIdFromUserWithHttpInfo(userId) {
const res = await this.httpClient.delete("/v2/bot/user/{userId}/richmenu".replace("{userId}", String(userId)));
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Unlink rich menus from multiple users
* @param richMenuBulkUnlinkRequest
*
* @see Documentation
*/
async unlinkRichMenuIdFromUsers(richMenuBulkUnlinkRequest) {
return (await this.unlinkRichMenuIdFromUsersWithHttpInfo(richMenuBulkUnlinkRequest)).body;
}
/**
* Unlink rich menus from multiple users.
* This method includes HttpInfo object to return additional information.
* @param richMenuBulkUnlinkRequest
*
* @see Documentation
*/
async unlinkRichMenuIdFromUsersWithHttpInfo(richMenuBulkUnlinkRequest) {
const params = richMenuBulkUnlinkRequest;
const res = await this.httpClient.post("/v2/bot/richmenu/bulk/unlink", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Update rich menu alias
* @param richMenuAliasId The rich menu alias ID you want to update.
* @param updateRichMenuAliasRequest
*
* @see Documentation
*/
async updateRichMenuAlias(richMenuAliasId, updateRichMenuAliasRequest) {
return (await this.updateRichMenuAliasWithHttpInfo(richMenuAliasId, updateRichMenuAliasRequest)).body;
}
/**
* Update rich menu alias.
* This method includes HttpInfo object to return additional information.
* @param richMenuAliasId The rich menu alias ID you want to update.
* @param updateRichMenuAliasRequest
*
* @see Documentation
*/
async updateRichMenuAliasWithHttpInfo(richMenuAliasId, updateRichMenuAliasRequest) {
const params = updateRichMenuAliasRequest;
const res = await this.httpClient.post("/v2/bot/richmenu/alias/{richMenuAliasId}".replace("{richMenuAliasId}", String(richMenuAliasId)), params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Validate message objects of a broadcast message
* @param validateMessageRequest
*
* @see Documentation
*/
async validateBroadcast(validateMessageRequest) {
return (await this.validateBroadcastWithHttpInfo(validateMessageRequest))
.body;
}
/**
* Validate message objects of a broadcast message.
* This method includes HttpInfo object to return additional information.
* @param validateMessageRequest
*
* @see Documentation
*/
async validateBroadcastWithHttpInfo(validateMessageRequest) {
const params = validateMessageRequest;
const res = await this.httpClient.post("/v2/bot/message/validate/broadcast", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Validate message objects of a multicast message
* @param validateMessageRequest
*
* @see Documentation
*/
async validateMulticast(validateMessageRequest) {
return (await this.validateMulticastWithHttpInfo(validateMessageRequest))
.body;
}
/**
* Validate message objects of a multicast message.
* This method includes HttpInfo object to return additional information.
* @param validateMessageRequest
*
* @see Documentation
*/
async validateMulticastWithHttpInfo(validateMessageRequest) {
const params = validateMessageRequest;
const res = await this.httpClient.post("/v2/bot/message/validate/multicast", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Validate message objects of a narrowcast message
* @param validateMessageRequest
*
* @see Documentation
*/
async validateNarrowcast(validateMessageRequest) {
return (await this.validateNarrowcastWithHttpInfo(validateMessageRequest))
.body;
}
/**
* Validate message objects of a narrowcast message.
* This method includes HttpInfo object to return additional information.
* @param validateMessageRequest
*
* @see Documentation
*/
async validateNarrowcastWithHttpInfo(validateMessageRequest) {
const params = validateMessageRequest;
const res = await this.httpClient.post("/v2/bot/message/validate/narrowcast", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Validate message objects of a push message
* @param validateMessageRequest
*
* @see Documentation
*/
async validatePush(validateMessageRequest) {
return (await this.validatePushWithHttpInfo(validateMessageRequest)).body;
}
/**
* Validate message objects of a push message.
* This method includes HttpInfo object to return additional information.
* @param validateMessageRequest
*
* @see Documentation
*/
async validatePushWithHttpInfo(validateMessageRequest) {
const params = validateMessageRequest;
const res = await this.httpClient.post("/v2/bot/message/validate/push", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Validate message objects of a reply message
* @param validateMessageRequest
*
* @see Documentation
*/
async validateReply(validateMessageRequest) {
return (await this.validateReplyWithHttpInfo(validateMessageRequest)).body;
}
/**
* Validate message objects of a reply message.
* This method includes HttpInfo object to return additional information.
* @param validateMessageRequest
*
* @see Documentation
*/
async validateReplyWithHttpInfo(validateMessageRequest) {
const params = validateMessageRequest;
const res = await this.httpClient.post("/v2/bot/message/validate/reply", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Validate a request body of the Replace or unlink the linked rich menus in batches endpoint.
* @param richMenuBatchRequest
*
* @see Documentation
*/
async validateRichMenuBatchRequest(richMenuBatchRequest) {
return (await this.validateRichMenuBatchRequestWithHttpInfo(richMenuBatchRequest)).body;
}
/**
* Validate a request body of the Replace or unlink the linked rich menus in batches endpoint..
* This method includes HttpInfo object to return additional information.
* @param richMenuBatchRequest
*
* @see Documentation
*/
async validateRichMenuBatchRequestWithHttpInfo(richMenuBatchRequest) {
const params = richMenuBatchRequest;
const res = await this.httpClient.post("/v2/bot/richmenu/validate/batch", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
/**
* Validate rich menu object
* @param richMenuRequest
*
* @see Documentation
*/
async validateRichMenuObject(richMenuRequest) {
return (await this.validateRichMenuObjectWithHttpInfo(richMenuRequest))
.body;
}
/**
* Validate rich menu object.
* This method includes HttpInfo object to return additional information.
* @param richMenuRequest
*
* @see Documentation
*/
async validateRichMenuObjectWithHttpInfo(richMenuRequest) {
const params = richMenuRequest;
const res = await this.httpClient.post("/v2/bot/richmenu/validate", params);
const text = await res.text();
const parsedBody = text ? JSON.parse(text) : null;
return { httpResponse: res, body: parsedBody };
}
}
//# sourceMappingURL=messagingApiClient.js.map