Skip to content

Commit 591921a

Browse files
github-actions[bot]github-actions
and
github-actions
authored
Add includesOwnedAudienceGroups Parameter to Audience API (#1247)
line/line-openapi#105 # Enhancement to Shared Audiences API This PR introduces a new query parameter `includesOwnedAudienceGroups` to the `/v2/bot/audienceGroup/shared/list` endpoint in the Business Manager API. This enhancement allows users to specify whether to include audience groups owned by the user in the response. ## Changes Made - Added the `includesOwnedAudienceGroups` parameter to the API endpoint. - **Type**: Boolean - **Default**: false - **Description**: - `true`: Include audience groups owned by the LINE Official Account Manager. - `false`: Respond only with audience groups shared by Business Manager. - Removed the `/v2/bot/audienceGroup/{audienceGroupId}/activate` and `/v2/bot/audienceGroup/authorityLevel` endpoints. ## Purpose This update provides more flexibility in retrieving audience groups by allowing users to filter based on ownership. It is especially useful for users who manage both shared and owned audience groups. The removal of certain endpoints is part of a cleanup effort to streamline the API. Please review the changes and let me know if there are any questions or further modifications needed. ## Documents and Reference - [Get List of Shared Audiences](https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list) - [Removed Endpoints](https://developers.line.biz/en/news/2025/03/26/cross-targeting-closing/) For more information, please refer to the links provided above. Co-authored-by: github-actions <[email protected]>
1 parent 6e97be3 commit 591921a

File tree

8 files changed

+26
-418
lines changed

8 files changed

+26
-418
lines changed

lib/manage-audience/.openapi-generator/FILES

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ model/adaccount.ts
77
model/addAudienceToAudienceGroupRequest.ts
88
model/audience.ts
99
model/audienceGroup.ts
10-
model/audienceGroupAuthorityLevel.ts
1110
model/audienceGroupCreateRoute.ts
1211
model/audienceGroupFailedType.ts
1312
model/audienceGroupJob.ts
@@ -27,12 +26,10 @@ model/detailedOwner.ts
2726
model/errorDetail.ts
2827
model/errorResponse.ts
2928
model/getAudienceDataResponse.ts
30-
model/getAudienceGroupAuthorityLevelResponse.ts
3129
model/getAudienceGroupsResponse.ts
3230
model/getSharedAudienceDataResponse.ts
3331
model/getSharedAudienceGroupsResponse.ts
3432
model/models.ts
35-
model/updateAudienceGroupAuthorityLevelRequest.ts
3633
model/updateAudienceGroupDescriptionRequest.ts
3734
tests/api/ManageAudienceBlobClientTest.spec.ts
3835
tests/api/ManageAudienceClientTest.spec.ts

lib/manage-audience/api/manageAudienceClient.ts

Lines changed: 6 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ import { CreateImpBasedAudienceGroupRequest } from "../model/createImpBasedAudie
2222
import { CreateImpBasedAudienceGroupResponse } from "../model/createImpBasedAudienceGroupResponse.js";
2323
import { ErrorResponse } from "../model/errorResponse.js";
2424
import { GetAudienceDataResponse } from "../model/getAudienceDataResponse.js";
25-
import { GetAudienceGroupAuthorityLevelResponse } from "../model/getAudienceGroupAuthorityLevelResponse.js";
2625
import { GetAudienceGroupsResponse } from "../model/getAudienceGroupsResponse.js";
2726
import { GetSharedAudienceDataResponse } from "../model/getSharedAudienceDataResponse.js";
2827
import { GetSharedAudienceGroupsResponse } from "../model/getSharedAudienceGroupsResponse.js";
29-
import { UpdateAudienceGroupAuthorityLevelRequest } from "../model/updateAudienceGroupAuthorityLevelRequest.js";
3028
import { UpdateAudienceGroupDescriptionRequest } from "../model/updateAudienceGroupDescriptionRequest.js";
3129

3230
import * as Types from "../../types.js";
@@ -62,38 +60,6 @@ export class ManageAudienceClient {
6260
});
6361
}
6462

65-
/**
66-
* Activate audience
67-
* @param audienceGroupId The audience ID.
68-
*
69-
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#activate-audience-group"> Documentation</a>
70-
*/
71-
public async activateAudienceGroup(
72-
audienceGroupId: number,
73-
): Promise<Types.MessageAPIResponseBase> {
74-
return (await this.activateAudienceGroupWithHttpInfo(audienceGroupId)).body;
75-
}
76-
77-
/**
78-
* Activate audience.
79-
* This method includes HttpInfo object to return additional information.
80-
* @param audienceGroupId The audience ID.
81-
*
82-
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#activate-audience-group"> Documentation</a>
83-
*/
84-
public async activateAudienceGroupWithHttpInfo(
85-
audienceGroupId: number,
86-
): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
87-
const res = await this.httpClient.put(
88-
"/v2/bot/audienceGroup/{audienceGroupId}/activate".replace(
89-
"{audienceGroupId}",
90-
String(audienceGroupId),
91-
),
92-
);
93-
const text = await res.text();
94-
const parsedBody = text ? JSON.parse(text) : null;
95-
return { httpResponse: res, body: parsedBody };
96-
}
9763
/**
9864
* Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON)
9965
* @param addAudienceToAudienceGroupRequest
@@ -297,31 +263,6 @@ export class ManageAudienceClient {
297263
const parsedBody = text ? JSON.parse(text) : null;
298264
return { httpResponse: res, body: parsedBody };
299265
}
300-
/**
301-
* Get the authority level of the audience
302-
*
303-
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-authority-level"> Documentation</a>
304-
*/
305-
public async getAudienceGroupAuthorityLevel(): Promise<GetAudienceGroupAuthorityLevelResponse> {
306-
return (await this.getAudienceGroupAuthorityLevelWithHttpInfo()).body;
307-
}
308-
309-
/**
310-
* Get the authority level of the audience.
311-
* This method includes HttpInfo object to return additional information.
312-
*
313-
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-authority-level"> Documentation</a>
314-
*/
315-
public async getAudienceGroupAuthorityLevelWithHttpInfo(): Promise<
316-
Types.ApiResponseType<GetAudienceGroupAuthorityLevelResponse>
317-
> {
318-
const res = await this.httpClient.get(
319-
"/v2/bot/audienceGroup/authorityLevel",
320-
);
321-
const text = await res.text();
322-
const parsedBody = text ? JSON.parse(text) : null;
323-
return { httpResponse: res, body: parsedBody };
324-
}
325266
/**
326267
* Gets data for more than one audience.
327268
* @param page The page to return when getting (paginated) results. Must be 1 or higher.
@@ -434,6 +375,7 @@ export class ManageAudienceClient {
434375
* @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.
435376
* @param size The number of audiences per page. Default: 20 Max: 40
436377
* @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.
378+
* @param includesOwnedAudienceGroups true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager
437379
*
438380
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list"> Documentation</a>
439381
*/
@@ -443,6 +385,7 @@ export class ManageAudienceClient {
443385
status?: AudienceGroupStatus,
444386
size?: number,
445387
createRoute?: AudienceGroupCreateRoute,
388+
includesOwnedAudienceGroups?: boolean,
446389
): Promise<GetSharedAudienceGroupsResponse> {
447390
return (
448391
await this.getSharedAudienceGroupsWithHttpInfo(
@@ -451,6 +394,7 @@ export class ManageAudienceClient {
451394
status,
452395
size,
453396
createRoute,
397+
includesOwnedAudienceGroups,
454398
)
455399
).body;
456400
}
@@ -463,6 +407,7 @@ export class ManageAudienceClient {
463407
* @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.
464408
* @param size The number of audiences per page. Default: 20 Max: 40
465409
* @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.
410+
* @param includesOwnedAudienceGroups true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager
466411
*
467412
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list"> Documentation</a>
468413
*/
@@ -472,13 +417,15 @@ export class ManageAudienceClient {
472417
status?: AudienceGroupStatus,
473418
size?: number,
474419
createRoute?: AudienceGroupCreateRoute,
420+
includesOwnedAudienceGroups?: boolean,
475421
): Promise<Types.ApiResponseType<GetSharedAudienceGroupsResponse>> {
476422
const queryParams = {
477423
page: page,
478424
description: description,
479425
status: status,
480426
size: size,
481427
createRoute: createRoute,
428+
includesOwnedAudienceGroups: includesOwnedAudienceGroups,
482429
};
483430
Object.keys(queryParams).forEach((key: keyof typeof queryParams) => {
484431
if (queryParams[key] === undefined) {
@@ -494,42 +441,6 @@ export class ManageAudienceClient {
494441
const parsedBody = text ? JSON.parse(text) : null;
495442
return { httpResponse: res, body: parsedBody };
496443
}
497-
/**
498-
* Change the authority level of the audience
499-
* @param updateAudienceGroupAuthorityLevelRequest
500-
*
501-
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#change-authority-level"> Documentation</a>
502-
*/
503-
public async updateAudienceGroupAuthorityLevel(
504-
updateAudienceGroupAuthorityLevelRequest: UpdateAudienceGroupAuthorityLevelRequest,
505-
): Promise<Types.MessageAPIResponseBase> {
506-
return (
507-
await this.updateAudienceGroupAuthorityLevelWithHttpInfo(
508-
updateAudienceGroupAuthorityLevelRequest,
509-
)
510-
).body;
511-
}
512-
513-
/**
514-
* Change the authority level of the audience.
515-
* This method includes HttpInfo object to return additional information.
516-
* @param updateAudienceGroupAuthorityLevelRequest
517-
*
518-
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#change-authority-level"> Documentation</a>
519-
*/
520-
public async updateAudienceGroupAuthorityLevelWithHttpInfo(
521-
updateAudienceGroupAuthorityLevelRequest: UpdateAudienceGroupAuthorityLevelRequest,
522-
): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
523-
const params = updateAudienceGroupAuthorityLevelRequest;
524-
525-
const res = await this.httpClient.put(
526-
"/v2/bot/audienceGroup/authorityLevel",
527-
params,
528-
);
529-
const text = await res.text();
530-
const parsedBody = text ? JSON.parse(text) : null;
531-
return { httpResponse: res, body: parsedBody };
532-
}
533444
/**
534445
* Renames an existing audience.
535446
* @param audienceGroupId The audience ID.

lib/manage-audience/model/audienceGroupAuthorityLevel.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

lib/manage-audience/model/getAudienceGroupAuthorityLevelResponse.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

lib/manage-audience/model/models.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ export * from "./adaccount.js";
22
export * from "./addAudienceToAudienceGroupRequest.js";
33
export * from "./audience.js";
44
export * from "./audienceGroup.js";
5-
export * from "./audienceGroupAuthorityLevel.js";
65
export * from "./audienceGroupCreateRoute.js";
76
export * from "./audienceGroupFailedType.js";
87
export * from "./audienceGroupJob.js";
@@ -22,9 +21,7 @@ export * from "./detailedOwner.js";
2221
export * from "./errorDetail.js";
2322
export * from "./errorResponse.js";
2423
export * from "./getAudienceDataResponse.js";
25-
export * from "./getAudienceGroupAuthorityLevelResponse.js";
2624
export * from "./getAudienceGroupsResponse.js";
2725
export * from "./getSharedAudienceDataResponse.js";
2826
export * from "./getSharedAudienceGroupsResponse.js";
29-
export * from "./updateAudienceGroupAuthorityLevelRequest.js";
3027
export * from "./updateAudienceGroupDescriptionRequest.js";

lib/manage-audience/model/updateAudienceGroupAuthorityLevelRequest.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)