Skip to content

@line/bot-sdk


@line/bot-sdk / manageAudience / ManageAudienceClient

Class: ManageAudienceClient ​

Defined in: lib/manage-audience/api/manageAudienceClient.ts:64

See ​

LineBotClient for a unified interface that wraps this client.

Constructors ​

Constructor ​

new ManageAudienceClient(config): ManageAudienceClient

Defined in: lib/manage-audience/api/manageAudienceClient.ts:80

Initializes a new ManageAudienceClient.

Parameters ​

config ​

httpClientConfig

Configuration for this API client.

Returns ​

ManageAudienceClient

Example ​

ts
const client = new ManageAudienceClient({
  channelAccessToken: process.env.LINE_CHANNEL_ACCESS_TOKEN!,
});

Methods ​

addAudienceToAudienceGroup() ​

addAudienceToAudienceGroup(addAudienceToAudienceGroupRequest): Promise<MessageAPIResponseBase>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:99

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 addAudienceToAudienceGroupWithHttpInfo.

Parameters ​

addAudienceToAudienceGroupRequest ​

AddAudienceToAudienceGroupRequest

Returns ​

Promise<MessageAPIResponseBase>

A promise resolving to the response body.

See ​

LINE Developers documentation


addAudienceToAudienceGroupWithHttpInfo() ​

addAudienceToAudienceGroupWithHttpInfo(addAudienceToAudienceGroupRequest): Promise<ApiResponseType<MessageAPIResponseBase>>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:117

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.

Parameters ​

addAudienceToAudienceGroupRequest ​

AddAudienceToAudienceGroupRequest

Returns ​

Promise<ApiResponseType<MessageAPIResponseBase>>

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

See ​

LINE Developers documentation


createAudienceGroup() ​

createAudienceGroup(createAudienceGroupRequest): Promise<CreateAudienceGroupResponse>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:138

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 createAudienceGroupWithHttpInfo.

Parameters ​

createAudienceGroupRequest ​

CreateAudienceGroupRequest

Returns ​

Promise<CreateAudienceGroupResponse>

A promise resolving to the response body.

See ​

LINE Developers documentation


createAudienceGroupWithHttpInfo() ​

createAudienceGroupWithHttpInfo(createAudienceGroupRequest): Promise<ApiResponseType<CreateAudienceGroupResponse>>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:154

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.

Parameters ​

createAudienceGroupRequest ​

CreateAudienceGroupRequest

Returns ​

Promise<ApiResponseType<CreateAudienceGroupResponse>>

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

See ​

LINE Developers documentation


createClickBasedAudienceGroup() ​

createClickBasedAudienceGroup(createClickBasedAudienceGroupRequest): Promise<CreateClickBasedAudienceGroupResponse>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:175

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 createClickBasedAudienceGroupWithHttpInfo.

Parameters ​

createClickBasedAudienceGroupRequest ​

CreateClickBasedAudienceGroupRequest

Returns ​

Promise<CreateClickBasedAudienceGroupResponse>

A promise resolving to the response body.

See ​

LINE Developers documentation


createClickBasedAudienceGroupWithHttpInfo() ​

createClickBasedAudienceGroupWithHttpInfo(createClickBasedAudienceGroupRequest): Promise<ApiResponseType<CreateClickBasedAudienceGroupResponse>>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:193

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.

Parameters ​

createClickBasedAudienceGroupRequest ​

CreateClickBasedAudienceGroupRequest

Returns ​

Promise<ApiResponseType<CreateClickBasedAudienceGroupResponse>>

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

See ​

LINE Developers documentation


createImpBasedAudienceGroup() ​

createImpBasedAudienceGroup(createImpBasedAudienceGroupRequest): Promise<CreateImpBasedAudienceGroupResponse>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:214

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 createImpBasedAudienceGroupWithHttpInfo.

Parameters ​

createImpBasedAudienceGroupRequest ​

CreateImpBasedAudienceGroupRequest

Returns ​

Promise<CreateImpBasedAudienceGroupResponse>

A promise resolving to the response body.

See ​

LINE Developers documentation


createImpBasedAudienceGroupWithHttpInfo() ​

createImpBasedAudienceGroupWithHttpInfo(createImpBasedAudienceGroupRequest): Promise<ApiResponseType<CreateImpBasedAudienceGroupResponse>>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:232

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.

Parameters ​

createImpBasedAudienceGroupRequest ​

CreateImpBasedAudienceGroupRequest

Returns ​

Promise<ApiResponseType<CreateImpBasedAudienceGroupResponse>>

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

See ​

LINE Developers documentation


deleteAudienceGroup() ​

deleteAudienceGroup(audienceGroupId): Promise<MessageAPIResponseBase>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:250

Delete audience Calls DELETE https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}. To inspect the HTTP status code or response headers, use deleteAudienceGroupWithHttpInfo.

Parameters ​

audienceGroupId ​

number

The audience ID.

Returns ​

Promise<MessageAPIResponseBase>

A promise resolving to the response body.

See ​

LINE Developers documentation


deleteAudienceGroupWithHttpInfo() ​

deleteAudienceGroupWithHttpInfo(audienceGroupId): Promise<ApiResponseType<MessageAPIResponseBase>>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:264

Delete audience Calls DELETE https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}. This method returns the response body together with the underlying httpResponse.

Parameters ​

audienceGroupId ​

number

The audience ID.

Returns ​

Promise<ApiResponseType<MessageAPIResponseBase>>

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

See ​

LINE Developers documentation


getAudienceData() ​

getAudienceData(audienceGroupId): Promise<GetAudienceDataResponse>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:284

Gets audience data. Calls GET https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}. To inspect the HTTP status code or response headers, use getAudienceDataWithHttpInfo.

Parameters ​

audienceGroupId ​

number

The audience ID.

Returns ​

Promise<GetAudienceDataResponse>

A promise resolving to the response body.

See ​

LINE Developers documentation


getAudienceDataWithHttpInfo() ​

getAudienceDataWithHttpInfo(audienceGroupId): Promise<ApiResponseType<GetAudienceDataResponse>>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:298

Gets audience data. Calls GET https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}. This method returns the response body together with the underlying httpResponse.

Parameters ​

audienceGroupId ​

number

The audience ID.

Returns ​

Promise<ApiResponseType<GetAudienceDataResponse>>

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

See ​

LINE Developers documentation


getAudienceGroups() ​

getAudienceGroups(page, description?, status?, size?, includesExternalPublicGroups?, createRoute?): Promise<GetAudienceGroupsResponse>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:323

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 getAudienceGroupsWithHttpInfo.

Parameters ​

page ​

number

The page to return when getting (paginated) results. Must be 1 or higher.

description? ​

string

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.

status? ​

AudienceGroupStatus

The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.

size? ​

number

The number of audiences per page. Default: 20 Max: 40

includesExternalPublicGroups? ​

boolean

true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel.

createRoute? ​

AudienceGroupCreateRoute

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 ​

Promise<GetAudienceGroupsResponse>

A promise resolving to the response body.

See ​

LINE Developers documentation


getAudienceGroupsWithHttpInfo() ​

getAudienceGroupsWithHttpInfo(page, description?, status?, size?, includesExternalPublicGroups?, createRoute?): Promise<ApiResponseType<GetAudienceGroupsResponse>>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:356

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.

Parameters ​

page ​

number

The page to return when getting (paginated) results. Must be 1 or higher.

description? ​

string

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.

status? ​

AudienceGroupStatus

The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.

size? ​

number

The number of audiences per page. Default: 20 Max: 40

includesExternalPublicGroups? ​

boolean

true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel.

createRoute? ​

AudienceGroupCreateRoute

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 ​

Promise<ApiResponseType<GetAudienceGroupsResponse>>

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

See ​

LINE Developers documentation


getSharedAudienceData() ​

getSharedAudienceData(audienceGroupId): Promise<GetSharedAudienceDataResponse>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:409

Gets audience data. Calls GET https://api.line.me/v2/bot/audienceGroup/shared/{audienceGroupId}. To inspect the HTTP status code or response headers, use getSharedAudienceDataWithHttpInfo.

Parameters ​

audienceGroupId ​

number

The audience ID.

Returns ​

Promise<GetSharedAudienceDataResponse>

A promise resolving to the response body.

See ​

LINE Developers documentation


getSharedAudienceDataWithHttpInfo() ​

getSharedAudienceDataWithHttpInfo(audienceGroupId): Promise<ApiResponseType<GetSharedAudienceDataResponse>>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:423

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.

Parameters ​

audienceGroupId ​

number

The audience ID.

Returns ​

Promise<ApiResponseType<GetSharedAudienceDataResponse>>

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

See ​

LINE Developers documentation


getSharedAudienceGroups() ​

getSharedAudienceGroups(page, description?, status?, size?, createRoute?, includesOwnedAudienceGroups?): Promise<GetSharedAudienceGroupsResponse>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:451

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 getSharedAudienceGroupsWithHttpInfo.

Parameters ​

page ​

number

The page to return when getting (paginated) results. Must be 1 or higher.

description? ​

string

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.

status? ​

AudienceGroupStatus

The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.

size? ​

number

The number of audiences per page. Default: 20 Max: 40

createRoute? ​

AudienceGroupCreateRoute

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.

includesOwnedAudienceGroups? ​

boolean

true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager

Returns ​

Promise<GetSharedAudienceGroupsResponse>

A promise resolving to the response body.

See ​

LINE Developers documentation


getSharedAudienceGroupsWithHttpInfo() ​

getSharedAudienceGroupsWithHttpInfo(page, description?, status?, size?, createRoute?, includesOwnedAudienceGroups?): Promise<ApiResponseType<GetSharedAudienceGroupsResponse>>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:484

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.

Parameters ​

page ​

number

The page to return when getting (paginated) results. Must be 1 or higher.

description? ​

string

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.

status? ​

AudienceGroupStatus

The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion.

size? ​

number

The number of audiences per page. Default: 20 Max: 40

createRoute? ​

AudienceGroupCreateRoute

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.

includesOwnedAudienceGroups? ​

boolean

true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager

Returns ​

Promise<ApiResponseType<GetSharedAudienceGroupsResponse>>

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

See ​

LINE Developers documentation


updateAudienceGroupDescription() ​

updateAudienceGroupDescription(audienceGroupId, updateAudienceGroupDescriptionRequest): Promise<MessageAPIResponseBase>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:538

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 updateAudienceGroupDescriptionWithHttpInfo.

Parameters ​

audienceGroupId ​

number

The audience ID.

updateAudienceGroupDescriptionRequest ​

UpdateAudienceGroupDescriptionRequest

Returns ​

Promise<MessageAPIResponseBase>

A promise resolving to the response body.

See ​

LINE Developers documentation


updateAudienceGroupDescriptionWithHttpInfo() ​

updateAudienceGroupDescriptionWithHttpInfo(audienceGroupId, updateAudienceGroupDescriptionRequest): Promise<ApiResponseType<MessageAPIResponseBase>>

Defined in: lib/manage-audience/api/manageAudienceClient.ts:559

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.

Parameters ​

audienceGroupId ​

number

The audience ID.

updateAudienceGroupDescriptionRequest ​

UpdateAudienceGroupDescriptionRequest

Returns ​

Promise<ApiResponseType<MessageAPIResponseBase>>

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

See ​

LINE Developers documentation