@line/bot-sdk
Version:
Node.js SDK for LINE Messaging API
266 lines • 20.2 kB
TypeScript
/**
* 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 { AddAudienceToAudienceGroupRequest } from "../model/addAudienceToAudienceGroupRequest.js";
import { AudienceGroupCreateRoute } from "../model/audienceGroupCreateRoute.js";
import { AudienceGroupStatus } from "../model/audienceGroupStatus.js";
import { CreateAudienceGroupRequest } from "../model/createAudienceGroupRequest.js";
import { CreateAudienceGroupResponse } from "../model/createAudienceGroupResponse.js";
import { CreateClickBasedAudienceGroupRequest } from "../model/createClickBasedAudienceGroupRequest.js";
import { CreateClickBasedAudienceGroupResponse } from "../model/createClickBasedAudienceGroupResponse.js";
import { CreateImpBasedAudienceGroupRequest } from "../model/createImpBasedAudienceGroupRequest.js";
import { CreateImpBasedAudienceGroupResponse } from "../model/createImpBasedAudienceGroupResponse.js";
import { GetAudienceDataResponse } from "../model/getAudienceDataResponse.js";
import { GetAudienceGroupsResponse } from "../model/getAudienceGroupsResponse.js";
import { GetSharedAudienceDataResponse } from "../model/getSharedAudienceDataResponse.js";
import { GetSharedAudienceGroupsResponse } from "../model/getSharedAudienceGroupsResponse.js";
import { UpdateAudienceGroupDescriptionRequest } from "../model/updateAudienceGroupDescriptionRequest.js";
import * as Types from "../../types.js";
interface httpClientConfig {
/**
* Base URL for requests.
* Defaults to 'https://api.line.me'.
* You can override this for testing or to use a mock server.
*/
baseURL?: string;
/**
* Channel access token used for authorization.
*/
channelAccessToken: string;
/**
* Extra headers merged into every request.
*/
defaultHeaders?: Record<string, string>;
}
/**
* @see {@link LineBotClient} for a unified interface that wraps this client.
*/
export declare class ManageAudienceClient {
private httpClient;
/**
* Initializes a new `ManageAudienceClient`.
*
* @param config Configuration for this API client.
* @param config.baseURL The base URL for requests. Defaults to `https://api.line.me`.
* @param config.channelAccessToken The channel access token used for authorization.
* @param config.defaultHeaders Extra headers merged into every request.
*
* @example
* const client = new ManageAudienceClient({
* channelAccessToken: process.env.LINE_CHANNEL_ACCESS_TOKEN!,
* });
*/
constructor(config: httpClientConfig);
/**
* Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON)
* Calls `PUT https://api.line.me/v2/bot/audienceGroup/upload`.
* To inspect the HTTP status code or response headers, use {@link addAudienceToAudienceGroupWithHttpInfo}.
* @param addAudienceToAudienceGroupRequest
* @returns A promise resolving to the response body.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group">LINE Developers documentation</a>
*/
addAudienceToAudienceGroup(addAudienceToAudienceGroupRequest: AddAudienceToAudienceGroupRequest): Promise<Types.MessageAPIResponseBase>;
/**
* Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON)
* Calls `PUT https://api.line.me/v2/bot/audienceGroup/upload`.
* This method returns the response body together with the underlying `httpResponse`.
* @param addAudienceToAudienceGroupRequest
* @returns A promise resolving to the response body together with the underlying `httpResponse`.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group">LINE Developers documentation</a>
*/
addAudienceToAudienceGroupWithHttpInfo(addAudienceToAudienceGroupRequest: AddAudienceToAudienceGroupRequest): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>>;
/**
* Create audience for uploading user IDs (by JSON)
* Calls `POST https://api.line.me/v2/bot/audienceGroup/upload`.
* To inspect the HTTP status code or response headers, use {@link createAudienceGroupWithHttpInfo}.
* @param createAudienceGroupRequest
* @returns A promise resolving to the response body.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group">LINE Developers documentation</a>
*/
createAudienceGroup(createAudienceGroupRequest: CreateAudienceGroupRequest): Promise<CreateAudienceGroupResponse>;
/**
* Create audience for uploading user IDs (by JSON)
* Calls `POST https://api.line.me/v2/bot/audienceGroup/upload`.
* This method returns the response body together with the underlying `httpResponse`.
* @param createAudienceGroupRequest
* @returns A promise resolving to the response body together with the underlying `httpResponse`.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group">LINE Developers documentation</a>
*/
createAudienceGroupWithHttpInfo(createAudienceGroupRequest: CreateAudienceGroupRequest): Promise<Types.ApiResponseType<CreateAudienceGroupResponse>>;
/**
* Create audience for click-based retargeting
* Calls `POST https://api.line.me/v2/bot/audienceGroup/click`.
* To inspect the HTTP status code or response headers, use {@link createClickBasedAudienceGroupWithHttpInfo}.
* @param createClickBasedAudienceGroupRequest
* @returns A promise resolving to the response body.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-click-audience-group">LINE Developers documentation</a>
*/
createClickBasedAudienceGroup(createClickBasedAudienceGroupRequest: CreateClickBasedAudienceGroupRequest): Promise<CreateClickBasedAudienceGroupResponse>;
/**
* Create audience for click-based retargeting
* Calls `POST https://api.line.me/v2/bot/audienceGroup/click`.
* This method returns the response body together with the underlying `httpResponse`.
* @param createClickBasedAudienceGroupRequest
* @returns A promise resolving to the response body together with the underlying `httpResponse`.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-click-audience-group">LINE Developers documentation</a>
*/
createClickBasedAudienceGroupWithHttpInfo(createClickBasedAudienceGroupRequest: CreateClickBasedAudienceGroupRequest): Promise<Types.ApiResponseType<CreateClickBasedAudienceGroupResponse>>;
/**
* Create audience for impression-based retargeting
* Calls `POST https://api.line.me/v2/bot/audienceGroup/imp`.
* To inspect the HTTP status code or response headers, use {@link createImpBasedAudienceGroupWithHttpInfo}.
* @param createImpBasedAudienceGroupRequest
* @returns A promise resolving to the response body.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-imp-audience-group">LINE Developers documentation</a>
*/
createImpBasedAudienceGroup(createImpBasedAudienceGroupRequest: CreateImpBasedAudienceGroupRequest): Promise<CreateImpBasedAudienceGroupResponse>;
/**
* Create audience for impression-based retargeting
* Calls `POST https://api.line.me/v2/bot/audienceGroup/imp`.
* This method returns the response body together with the underlying `httpResponse`.
* @param createImpBasedAudienceGroupRequest
* @returns A promise resolving to the response body together with the underlying `httpResponse`.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-imp-audience-group">LINE Developers documentation</a>
*/
createImpBasedAudienceGroupWithHttpInfo(createImpBasedAudienceGroupRequest: CreateImpBasedAudienceGroupRequest): Promise<Types.ApiResponseType<CreateImpBasedAudienceGroupResponse>>;
/**
* Delete audience
* Calls `DELETE https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}`.
* To inspect the HTTP status code or response headers, use {@link deleteAudienceGroupWithHttpInfo}.
* @param audienceGroupId The audience ID.
* @returns A promise resolving to the response body.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#delete-audience-group">LINE Developers documentation</a>
*/
deleteAudienceGroup(audienceGroupId: number): Promise<Types.MessageAPIResponseBase>;
/**
* Delete audience
* Calls `DELETE https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}`.
* This method returns the response body together with the underlying `httpResponse`.
* @param audienceGroupId The audience ID.
* @returns A promise resolving to the response body together with the underlying `httpResponse`.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#delete-audience-group">LINE Developers documentation</a>
*/
deleteAudienceGroupWithHttpInfo(audienceGroupId: number): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>>;
/**
* Gets audience data.
* Calls `GET https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}`.
* To inspect the HTTP status code or response headers, use {@link getAudienceDataWithHttpInfo}.
* @param audienceGroupId The audience ID.
* @returns A promise resolving to the response body.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-group">LINE Developers documentation</a>
*/
getAudienceData(audienceGroupId: number): Promise<GetAudienceDataResponse>;
/**
* Gets audience data.
* Calls `GET https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}`.
* This method returns the response body together with the underlying `httpResponse`.
* @param audienceGroupId The audience ID.
* @returns A promise resolving to the response body together with the underlying `httpResponse`.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-group">LINE Developers documentation</a>
*/
getAudienceDataWithHttpInfo(audienceGroupId: number): Promise<Types.ApiResponseType<GetAudienceDataResponse>>;
/**
* Gets data for more than one audience.
* Calls `GET https://api.line.me/v2/bot/audienceGroup/list`.
* To inspect the HTTP status code or response headers, use {@link getAudienceGroupsWithHttpInfo}.
* @param page The page to return when getting (paginated) results. Must be 1 or higher.
* @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion.
* @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.
* @param size The number of audiences per page. Default: 20 Max: 40
* @param includesExternalPublicGroups true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel.
* @param createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API.
* @returns A promise resolving to the response body.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-groups">LINE Developers documentation</a>
*/
getAudienceGroups(page: number, description?: string, status?: AudienceGroupStatus, size?: number, includesExternalPublicGroups?: boolean, createRoute?: AudienceGroupCreateRoute): Promise<GetAudienceGroupsResponse>;
/**
* Gets data for more than one audience.
* Calls `GET https://api.line.me/v2/bot/audienceGroup/list`.
* This method returns the response body together with the underlying `httpResponse`.
* @param page The page to return when getting (paginated) results. Must be 1 or higher.
* @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion.
* @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.
* @param size The number of audiences per page. Default: 20 Max: 40
* @param includesExternalPublicGroups true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel.
* @param createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API.
* @returns A promise resolving to the response body together with the underlying `httpResponse`.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-groups">LINE Developers documentation</a>
*/
getAudienceGroupsWithHttpInfo(page: number, description?: string, status?: AudienceGroupStatus, size?: number, includesExternalPublicGroups?: boolean, createRoute?: AudienceGroupCreateRoute): Promise<Types.ApiResponseType<GetAudienceGroupsResponse>>;
/**
* Gets audience data.
* Calls `GET https://api.line.me/v2/bot/audienceGroup/shared/{audienceGroupId}`.
* To inspect the HTTP status code or response headers, use {@link getSharedAudienceDataWithHttpInfo}.
* @param audienceGroupId The audience ID.
* @returns A promise resolving to the response body.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience">LINE Developers documentation</a>
*/
getSharedAudienceData(audienceGroupId: number): Promise<GetSharedAudienceDataResponse>;
/**
* Gets audience data.
* Calls `GET https://api.line.me/v2/bot/audienceGroup/shared/{audienceGroupId}`.
* This method returns the response body together with the underlying `httpResponse`.
* @param audienceGroupId The audience ID.
* @returns A promise resolving to the response body together with the underlying `httpResponse`.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience">LINE Developers documentation</a>
*/
getSharedAudienceDataWithHttpInfo(audienceGroupId: number): Promise<Types.ApiResponseType<GetSharedAudienceDataResponse>>;
/**
* Gets data for more than one audience, including those shared by the Business Manager.
* Calls `GET https://api.line.me/v2/bot/audienceGroup/shared/list`.
* To inspect the HTTP status code or response headers, use {@link getSharedAudienceGroupsWithHttpInfo}.
* @param page The page to return when getting (paginated) results. Must be 1 or higher.
* @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion.
* @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.
* @param size The number of audiences per page. Default: 20 Max: 40
* @param createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API.
* @param includesOwnedAudienceGroups true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager
* @returns A promise resolving to the response body.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list">LINE Developers documentation</a>
*/
getSharedAudienceGroups(page: number, description?: string, status?: AudienceGroupStatus, size?: number, createRoute?: AudienceGroupCreateRoute, includesOwnedAudienceGroups?: boolean): Promise<GetSharedAudienceGroupsResponse>;
/**
* Gets data for more than one audience, including those shared by the Business Manager.
* Calls `GET https://api.line.me/v2/bot/audienceGroup/shared/list`.
* This method returns the response body together with the underlying `httpResponse`.
* @param page The page to return when getting (paginated) results. Must be 1 or higher.
* @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion.
* @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.
* @param size The number of audiences per page. Default: 20 Max: 40
* @param createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API.
* @param includesOwnedAudienceGroups true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager
* @returns A promise resolving to the response body together with the underlying `httpResponse`.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list">LINE Developers documentation</a>
*/
getSharedAudienceGroupsWithHttpInfo(page: number, description?: string, status?: AudienceGroupStatus, size?: number, createRoute?: AudienceGroupCreateRoute, includesOwnedAudienceGroups?: boolean): Promise<Types.ApiResponseType<GetSharedAudienceGroupsResponse>>;
/**
* Renames an existing audience.
* Calls `PUT https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}/updateDescription`.
* To inspect the HTTP status code or response headers, use {@link updateAudienceGroupDescriptionWithHttpInfo}.
* @param audienceGroupId The audience ID.
* @param updateAudienceGroupDescriptionRequest
* @returns A promise resolving to the response body.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#set-description-audience-group">LINE Developers documentation</a>
*/
updateAudienceGroupDescription(audienceGroupId: number, updateAudienceGroupDescriptionRequest: UpdateAudienceGroupDescriptionRequest): Promise<Types.MessageAPIResponseBase>;
/**
* Renames an existing audience.
* Calls `PUT https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}/updateDescription`.
* This method returns the response body together with the underlying `httpResponse`.
* @param audienceGroupId The audience ID.
* @param updateAudienceGroupDescriptionRequest
* @returns A promise resolving to the response body together with the underlying `httpResponse`.
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#set-description-audience-group">LINE Developers documentation</a>
*/
updateAudienceGroupDescriptionWithHttpInfo(audienceGroupId: number, updateAudienceGroupDescriptionRequest: UpdateAudienceGroupDescriptionRequest): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>>;
}
export {};
//# sourceMappingURL=manageAudienceClient.d.ts.map