Skip to content

Commit d4ee02c

Browse files
github-actions[bot]github-actions
and
github-actions
authored
Add /v2/bot/audienceGroup/shared path (#1160)
line/line-openapi#85 # Shared Audiences in Business Manager API Support We have added and supported new API endpoints related to Shared Audiences in Business Manager. ## API to Get Shared Audience Information You can obtain detailed information about a specific audience shared in Business Manager by calling the endpoint: - GET `https://api.line.me/v2/bot/audienceGroup/shared/{audienceGroupId}` ## API to Get List of Shared Audiences You can acquire a list of audiences shared in Business Manager using the following endpoint: - GET `https://api.line.me/v2/bot/audienceGroup/shared/list` By using the "Get Shared Audience Information" endpoint, you can retrieve more detailed data about each audience. ## Documents and Reference - News Announcement: [Shared Audience Feature Release](https://developers.line.biz/en/news/2025/02/12/shared-audience/) - API Reference: - [Get List of Shared Audiences](https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list) - [Get Shared Audience Information](https://developers.line.biz/en/reference/messaging-api/#get-shared-audience) - Documentation on Audience Sharing: [Using Audience Sharing](https://developers.line.biz/en/docs/messaging-api/using-audience/#audience-sharing) For more information, please refer to the links provided above. Co-authored-by: github-actions <[email protected]>
1 parent 434d884 commit d4ee02c

10 files changed

+544
-1
lines changed

Diff for: lib/manage-audience/.openapi-generator/FILES

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ api.ts
33
api/apis.ts
44
api/manageAudienceBlobClient.ts
55
api/manageAudienceClient.ts
6+
model/adaccount.ts
67
model/addAudienceToAudienceGroupRequest.ts
78
model/audience.ts
89
model/audienceGroup.ts
@@ -22,11 +23,14 @@ model/createClickBasedAudienceGroupRequest.ts
2223
model/createClickBasedAudienceGroupResponse.ts
2324
model/createImpBasedAudienceGroupRequest.ts
2425
model/createImpBasedAudienceGroupResponse.ts
26+
model/detailedOwner.ts
2527
model/errorDetail.ts
2628
model/errorResponse.ts
2729
model/getAudienceDataResponse.ts
2830
model/getAudienceGroupAuthorityLevelResponse.ts
2931
model/getAudienceGroupsResponse.ts
32+
model/getSharedAudienceDataResponse.ts
33+
model/getSharedAudienceGroupsResponse.ts
3034
model/models.ts
3135
model/updateAudienceGroupAuthorityLevelRequest.ts
3236
model/updateAudienceGroupDescriptionRequest.ts

Diff for: lib/manage-audience/api/manageAudienceClient.ts

+101
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import { ErrorResponse } from "../model/errorResponse.js";
2424
import { GetAudienceDataResponse } from "../model/getAudienceDataResponse.js";
2525
import { GetAudienceGroupAuthorityLevelResponse } from "../model/getAudienceGroupAuthorityLevelResponse.js";
2626
import { GetAudienceGroupsResponse } from "../model/getAudienceGroupsResponse.js";
27+
import { GetSharedAudienceDataResponse } from "../model/getSharedAudienceDataResponse.js";
28+
import { GetSharedAudienceGroupsResponse } from "../model/getSharedAudienceGroupsResponse.js";
2729
import { UpdateAudienceGroupAuthorityLevelRequest } from "../model/updateAudienceGroupAuthorityLevelRequest.js";
2830
import { UpdateAudienceGroupDescriptionRequest } from "../model/updateAudienceGroupDescriptionRequest.js";
2931

@@ -404,6 +406,105 @@ export class ManageAudienceClient {
404406
const parsedBody = text ? JSON.parse(text) : null;
405407
return { httpResponse: res, body: parsedBody };
406408
}
409+
/**
410+
* Gets audience data.
411+
* @param audienceGroupId The audience ID.
412+
*
413+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience"> Documentation</a>
414+
*/
415+
public async getSharedAudienceData(
416+
audienceGroupId: number,
417+
): Promise<GetSharedAudienceDataResponse> {
418+
return (await this.getSharedAudienceDataWithHttpInfo(audienceGroupId)).body;
419+
}
420+
421+
/**
422+
* Gets audience data..
423+
* This method includes HttpInfo object to return additional information.
424+
* @param audienceGroupId The audience ID.
425+
*
426+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience"> Documentation</a>
427+
*/
428+
public async getSharedAudienceDataWithHttpInfo(
429+
audienceGroupId: number,
430+
): Promise<Types.ApiResponseType<GetSharedAudienceDataResponse>> {
431+
const res = await this.httpClient.get(
432+
"/v2/bot/audienceGroup/shared/{audienceGroupId}".replace(
433+
"{audienceGroupId}",
434+
String(audienceGroupId),
435+
),
436+
);
437+
const text = await res.text();
438+
const parsedBody = text ? JSON.parse(text) : null;
439+
return { httpResponse: res, body: parsedBody };
440+
}
441+
/**
442+
* Gets data for more than one audience, including those shared by the Business Manager.
443+
* @param page The page to return when getting (paginated) results. Must be 1 or higher.
444+
* @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.
445+
* @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.
446+
* @param size The number of audiences per page. Default: 20 Max: 40
447+
* @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.
448+
*
449+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list"> Documentation</a>
450+
*/
451+
public async getSharedAudienceGroups(
452+
page: number,
453+
description?: string,
454+
status?: AudienceGroupStatus,
455+
size?: number,
456+
createRoute?: AudienceGroupCreateRoute,
457+
): Promise<GetSharedAudienceGroupsResponse> {
458+
return (
459+
await this.getSharedAudienceGroupsWithHttpInfo(
460+
page,
461+
description,
462+
status,
463+
size,
464+
createRoute,
465+
)
466+
).body;
467+
}
468+
469+
/**
470+
* Gets data for more than one audience, including those shared by the Business Manager..
471+
* This method includes HttpInfo object to return additional information.
472+
* @param page The page to return when getting (paginated) results. Must be 1 or higher.
473+
* @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.
474+
* @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.
475+
* @param size The number of audiences per page. Default: 20 Max: 40
476+
* @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.
477+
*
478+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list"> Documentation</a>
479+
*/
480+
public async getSharedAudienceGroupsWithHttpInfo(
481+
page: number,
482+
description?: string,
483+
status?: AudienceGroupStatus,
484+
size?: number,
485+
createRoute?: AudienceGroupCreateRoute,
486+
): Promise<Types.ApiResponseType<GetSharedAudienceGroupsResponse>> {
487+
const queryParams = {
488+
page: page,
489+
description: description,
490+
status: status,
491+
size: size,
492+
createRoute: createRoute,
493+
};
494+
Object.keys(queryParams).forEach((key: keyof typeof queryParams) => {
495+
if (queryParams[key] === undefined) {
496+
delete queryParams[key];
497+
}
498+
});
499+
500+
const res = await this.httpClient.get(
501+
"/v2/bot/audienceGroup/shared/list",
502+
queryParams,
503+
);
504+
const text = await res.text();
505+
const parsedBody = text ? JSON.parse(text) : null;
506+
return { httpResponse: res, body: parsedBody };
507+
}
407508
/**
408509
* Change the authority level of the audience
409510
* @param updateAudienceGroupAuthorityLevelRequest

Diff for: lib/manage-audience/model/adaccount.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* LINE Messaging API
3+
* This document describes LINE Messaging API.
4+
*
5+
* The version of the OpenAPI document: 0.0.1
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
/**
14+
* Adaccount
15+
*/
16+
export type Adaccount = {
17+
/**
18+
* Ad account name.
19+
*/
20+
name?: string /**/;
21+
};

Diff for: lib/manage-audience/model/detailedOwner.ts

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* LINE Messaging API
3+
* This document describes LINE Messaging API.
4+
*
5+
* The version of the OpenAPI document: 0.0.1
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
/**
14+
* Owner of this audience group.
15+
*/
16+
export type DetailedOwner = {
17+
/**
18+
* Service name where the audience group has been created.
19+
*/
20+
serviceType?: string /**/;
21+
/**
22+
* Owner ID in the service.
23+
*/
24+
id?: string /**/;
25+
/**
26+
* Owner account name.
27+
*/
28+
name?: string /**/;
29+
};

Diff for: lib/manage-audience/model/getAudienceDataResponse.ts

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* Do not edit the class manually.
1111
*/
1212

13+
import { Adaccount } from "./adaccount.js";
1314
import { AudienceGroup } from "./audienceGroup.js";
1415
import { AudienceGroupJob } from "./audienceGroupJob.js";
1516

@@ -28,4 +29,9 @@ export type GetAudienceDataResponse = {
2829
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-group">jobs Documentation</a>
2930
*/
3031
jobs?: Array<AudienceGroupJob> /**/;
32+
/**
33+
*
34+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-group">adaccount Documentation</a>
35+
*/
36+
adaccount?: Adaccount /**/;
3137
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* LINE Messaging API
3+
* This document describes LINE Messaging API.
4+
*
5+
* The version of the OpenAPI document: 0.0.1
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
import { AudienceGroup } from "./audienceGroup.js";
14+
import { AudienceGroupJob } from "./audienceGroupJob.js";
15+
import { DetailedOwner } from "./detailedOwner.js";
16+
17+
/**
18+
* Get audience data
19+
*/
20+
export type GetSharedAudienceDataResponse = {
21+
/**
22+
*
23+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-group">audienceGroup Documentation</a>
24+
*/
25+
audienceGroup?: AudienceGroup /**/;
26+
/**
27+
* An array of jobs. This array is used to keep track of each attempt to add new user IDs or IFAs to an audience for uploading user IDs. Empty array is returned for any other type of audience. Max: 50
28+
*
29+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-group">jobs Documentation</a>
30+
*/
31+
jobs?: Array<AudienceGroupJob> /**/;
32+
/**
33+
*
34+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-group">owner Documentation</a>
35+
*/
36+
owner?: DetailedOwner /**/;
37+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/**
2+
* LINE Messaging API
3+
* This document describes LINE Messaging API.
4+
*
5+
* The version of the OpenAPI document: 0.0.1
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
import { AudienceGroup } from "./audienceGroup.js";
14+
15+
/**
16+
* Gets data for more than one audience.
17+
*/
18+
export type GetSharedAudienceGroupsResponse = {
19+
/**
20+
* An array of audience data. If there are no audiences that match the specified filter, an empty array will be returned.
21+
*
22+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-groups">audienceGroups Documentation</a>
23+
*/
24+
audienceGroups?: Array<AudienceGroup> /**/;
25+
/**
26+
* true when this is not the last page.
27+
*
28+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-groups">hasNextPage Documentation</a>
29+
*/
30+
hasNextPage?: boolean /**/;
31+
/**
32+
* The total number of audiences that can be returned with the specified filter.
33+
*
34+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-groups">totalCount Documentation</a>
35+
*/
36+
totalCount?: number /**/;
37+
/**
38+
* Of the audiences you can get with the specified filter, the number of audiences with the update permission set to READ_WRITE.
39+
*
40+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-groups">readWriteAudienceGroupTotalCount Documentation</a>
41+
*/
42+
readWriteAudienceGroupTotalCount?: number /**/;
43+
/**
44+
* The current page number.
45+
*
46+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-groups">page Documentation</a>
47+
*/
48+
page?: number /**/;
49+
/**
50+
* The maximum number of audiences on the current page.
51+
*
52+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-groups">size Documentation</a>
53+
*/
54+
size?: number /**/;
55+
};

Diff for: lib/manage-audience/model/models.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export * from "./adaccount.js";
12
export * from "./addAudienceToAudienceGroupRequest.js";
23
export * from "./audience.js";
34
export * from "./audienceGroup.js";
@@ -17,10 +18,13 @@ export * from "./createClickBasedAudienceGroupRequest.js";
1718
export * from "./createClickBasedAudienceGroupResponse.js";
1819
export * from "./createImpBasedAudienceGroupRequest.js";
1920
export * from "./createImpBasedAudienceGroupResponse.js";
21+
export * from "./detailedOwner.js";
2022
export * from "./errorDetail.js";
2123
export * from "./errorResponse.js";
2224
export * from "./getAudienceDataResponse.js";
2325
export * from "./getAudienceGroupAuthorityLevelResponse.js";
2426
export * from "./getAudienceGroupsResponse.js";
27+
export * from "./getSharedAudienceDataResponse.js";
28+
export * from "./getSharedAudienceGroupsResponse.js";
2529
export * from "./updateAudienceGroupAuthorityLevelRequest.js";
2630
export * from "./updateAudienceGroupDescriptionRequest.js";

0 commit comments

Comments
 (0)