Skip to content

Commit aaeef1a

Browse files
github-actions[bot]github-actions
and
github-actions
authored
Add /v2/bot/audienceGroup/shared path (#1546)
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 b050d37 commit aaeef1a

File tree

8 files changed

+350
-3
lines changed

8 files changed

+350
-3
lines changed

Diff for: clients/line-bot-manage-audience-client/.openapi-generator/FILES

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
src/main/java/com/linecorp/bot/audience/client/ManageAudienceBlobClient.java
22
src/main/java/com/linecorp/bot/audience/client/ManageAudienceClient.java
3+
src/main/java/com/linecorp/bot/audience/model/Adaccount.java
34
src/main/java/com/linecorp/bot/audience/model/AddAudienceToAudienceGroupRequest.java
45
src/main/java/com/linecorp/bot/audience/model/Audience.java
56
src/main/java/com/linecorp/bot/audience/model/AudienceGroup.java
@@ -19,10 +20,13 @@ src/main/java/com/linecorp/bot/audience/model/CreateClickBasedAudienceGroupReque
1920
src/main/java/com/linecorp/bot/audience/model/CreateClickBasedAudienceGroupResponse.java
2021
src/main/java/com/linecorp/bot/audience/model/CreateImpBasedAudienceGroupRequest.java
2122
src/main/java/com/linecorp/bot/audience/model/CreateImpBasedAudienceGroupResponse.java
23+
src/main/java/com/linecorp/bot/audience/model/DetailedOwner.java
2224
src/main/java/com/linecorp/bot/audience/model/ErrorDetail.java
2325
src/main/java/com/linecorp/bot/audience/model/ErrorResponse.java
2426
src/main/java/com/linecorp/bot/audience/model/GetAudienceDataResponse.java
2527
src/main/java/com/linecorp/bot/audience/model/GetAudienceGroupAuthorityLevelResponse.java
2628
src/main/java/com/linecorp/bot/audience/model/GetAudienceGroupsResponse.java
29+
src/main/java/com/linecorp/bot/audience/model/GetSharedAudienceDataResponse.java
30+
src/main/java/com/linecorp/bot/audience/model/GetSharedAudienceGroupsResponse.java
2731
src/main/java/com/linecorp/bot/audience/model/UpdateAudienceGroupAuthorityLevelRequest.java
2832
src/main/java/com/linecorp/bot/audience/model/UpdateAudienceGroupDescriptionRequest.java

Diff for: clients/line-bot-manage-audience-client/src/main/java/com/linecorp/bot/audience/client/ManageAudienceClient.java

+40
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
import com.linecorp.bot.audience.model.GetAudienceDataResponse;
3333
import com.linecorp.bot.audience.model.GetAudienceGroupAuthorityLevelResponse;
3434
import com.linecorp.bot.audience.model.GetAudienceGroupsResponse;
35+
import com.linecorp.bot.audience.model.GetSharedAudienceDataResponse;
36+
import com.linecorp.bot.audience.model.GetSharedAudienceGroupsResponse;
3537
import com.linecorp.bot.audience.model.UpdateAudienceGroupAuthorityLevelRequest;
3638
import com.linecorp.bot.audience.model.UpdateAudienceGroupDescriptionRequest;
3739
import com.linecorp.bot.client.base.ApiAuthenticatedClientBuilder;
@@ -166,6 +168,44 @@ CompletableFuture<Result<GetAudienceGroupsResponse>> getAudienceGroups(
166168
@Query("includesExternalPublicGroups") Boolean includesExternalPublicGroups,
167169
@Query("createRoute") AudienceGroupCreateRoute createRoute);
168170

171+
/**
172+
* Gets audience data.
173+
*
174+
* @param audienceGroupId The audience ID. (required)
175+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience">
176+
* Documentation</a>
177+
*/
178+
@GET("/v2/bot/audienceGroup/shared/{audienceGroupId}")
179+
CompletableFuture<Result<GetSharedAudienceDataResponse>> getSharedAudienceData(
180+
@Path("audienceGroupId") Long audienceGroupId);
181+
182+
/**
183+
* Gets data for more than one audience, including those shared by the Business Manager.
184+
*
185+
* @param page The page to return when getting (paginated) results. Must be 1 or higher.
186+
* (required)
187+
* @param description The name of the audience(s) to return. You can search for partial matches.
188+
* This is case-insensitive, meaning AUDIENCE and audience are considered identical. If
189+
* omitted, the name of the audience(s) will not be used as a search criterion. (optional)
190+
* @param status The status of the audience(s) to return. If omitted, the status of the
191+
* audience(s) will not be used as a search criterion. (optional)
192+
* @param size The number of audiences per page. Default: 20 Max: 40 (optional)
193+
* @param createRoute How the audience was created. If omitted, all audiences are included.
194+
* &#x60;OA_MANAGER&#x60;: Return only audiences created with LINE Official Account Manager
195+
* (opens new window). &#x60;MESSAGING_API&#x60;: Return only audiences created with Messaging
196+
* API. (optional)
197+
* @see <a
198+
* href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list">
199+
* Documentation</a>
200+
*/
201+
@GET("/v2/bot/audienceGroup/shared/list")
202+
CompletableFuture<Result<GetSharedAudienceGroupsResponse>> getSharedAudienceGroups(
203+
@Query("page") Long page,
204+
@Query("description") String description,
205+
@Query("status") AudienceGroupStatus status,
206+
@Query("size") Long size,
207+
@Query("createRoute") AudienceGroupCreateRoute createRoute);
208+
169209
/**
170210
* Change the authority level of the audience
171211
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright 2023 LINE Corporation
3+
*
4+
* LINE Corporation licenses this file to you under the Apache License,
5+
* version 2.0 (the "License"); you may not use this file except in compliance
6+
* with the License. You may obtain a copy of the License at:
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
/**
18+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19+
* https://openapi-generator.tech Do not edit the class manually.
20+
*/
21+
package com.linecorp.bot.audience.model;
22+
23+
24+
25+
import com.fasterxml.jackson.annotation.JsonInclude;
26+
import com.fasterxml.jackson.annotation.JsonInclude.Include;
27+
import com.fasterxml.jackson.annotation.JsonProperty;
28+
29+
/** Adaccount */
30+
@JsonInclude(Include.NON_NULL)
31+
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
32+
public record Adaccount(
33+
/** Ad account name. */
34+
@JsonProperty("name") String name) {
35+
36+
public static class Builder {
37+
private String name;
38+
39+
public Builder() {}
40+
41+
public Builder name(String name) {
42+
this.name = name;
43+
return this;
44+
}
45+
46+
public Adaccount build() {
47+
return new Adaccount(name);
48+
}
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright 2023 LINE Corporation
3+
*
4+
* LINE Corporation licenses this file to you under the Apache License,
5+
* version 2.0 (the "License"); you may not use this file except in compliance
6+
* with the License. You may obtain a copy of the License at:
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
/**
18+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19+
* https://openapi-generator.tech Do not edit the class manually.
20+
*/
21+
package com.linecorp.bot.audience.model;
22+
23+
24+
25+
import com.fasterxml.jackson.annotation.JsonInclude;
26+
import com.fasterxml.jackson.annotation.JsonInclude.Include;
27+
import com.fasterxml.jackson.annotation.JsonProperty;
28+
29+
/** Owner of this audience group. */
30+
@JsonInclude(Include.NON_NULL)
31+
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
32+
public record DetailedOwner(
33+
/** Service name where the audience group has been created. */
34+
@JsonProperty("serviceType") String serviceType,
35+
/** Owner ID in the service. */
36+
@JsonProperty("id") String id,
37+
/** Owner account name. */
38+
@JsonProperty("name") String name) {
39+
40+
public static class Builder {
41+
private String serviceType;
42+
private String id;
43+
private String name;
44+
45+
public Builder() {}
46+
47+
public Builder serviceType(String serviceType) {
48+
this.serviceType = serviceType;
49+
return this;
50+
}
51+
52+
public Builder id(String id) {
53+
this.id = id;
54+
return this;
55+
}
56+
57+
public Builder name(String name) {
58+
this.name = name;
59+
return this;
60+
}
61+
62+
public DetailedOwner build() {
63+
return new DetailedOwner(serviceType, id, name);
64+
}
65+
}
66+
}

Diff for: clients/line-bot-manage-audience-client/src/main/java/com/linecorp/bot/audience/model/GetAudienceDataResponse.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,14 @@ public record GetAudienceDataResponse(
4343
* IFAs to an audience for uploading user IDs. Empty array is returned for any other type of
4444
* audience. Max: 50
4545
*/
46-
@JsonProperty("jobs") List<AudienceGroupJob> jobs) {
46+
@JsonProperty("jobs") List<AudienceGroupJob> jobs,
47+
/** Get adaccount */
48+
@JsonProperty("adaccount") Adaccount adaccount) {
4749

4850
public static class Builder {
4951
private AudienceGroup audienceGroup;
5052
private List<AudienceGroupJob> jobs;
53+
private Adaccount adaccount;
5154

5255
public Builder() {}
5356

@@ -61,8 +64,13 @@ public Builder jobs(List<AudienceGroupJob> jobs) {
6164
return this;
6265
}
6366

67+
public Builder adaccount(Adaccount adaccount) {
68+
this.adaccount = adaccount;
69+
return this;
70+
}
71+
6472
public GetAudienceDataResponse build() {
65-
return new GetAudienceDataResponse(audienceGroup, jobs);
73+
return new GetAudienceDataResponse(audienceGroup, jobs, adaccount);
6674
}
6775
}
6876
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* Copyright 2023 LINE Corporation
3+
*
4+
* LINE Corporation licenses this file to you under the Apache License,
5+
* version 2.0 (the "License"); you may not use this file except in compliance
6+
* with the License. You may obtain a copy of the License at:
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
/**
18+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19+
* https://openapi-generator.tech Do not edit the class manually.
20+
*/
21+
package com.linecorp.bot.audience.model;
22+
23+
24+
25+
import com.fasterxml.jackson.annotation.JsonInclude;
26+
import com.fasterxml.jackson.annotation.JsonInclude.Include;
27+
import com.fasterxml.jackson.annotation.JsonProperty;
28+
import java.util.List;
29+
30+
/**
31+
* Get audience data
32+
*
33+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-group">
34+
* Documentation</a>
35+
*/
36+
@JsonInclude(Include.NON_NULL)
37+
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
38+
public record GetSharedAudienceDataResponse(
39+
/** Get audienceGroup */
40+
@JsonProperty("audienceGroup") AudienceGroup audienceGroup,
41+
/**
42+
* An array of jobs. This array is used to keep track of each attempt to add new user IDs or
43+
* IFAs to an audience for uploading user IDs. Empty array is returned for any other type of
44+
* audience. Max: 50
45+
*/
46+
@JsonProperty("jobs") List<AudienceGroupJob> jobs,
47+
/** Get owner */
48+
@JsonProperty("owner") DetailedOwner owner) {
49+
50+
public static class Builder {
51+
private AudienceGroup audienceGroup;
52+
private List<AudienceGroupJob> jobs;
53+
private DetailedOwner owner;
54+
55+
public Builder() {}
56+
57+
public Builder audienceGroup(AudienceGroup audienceGroup) {
58+
this.audienceGroup = audienceGroup;
59+
return this;
60+
}
61+
62+
public Builder jobs(List<AudienceGroupJob> jobs) {
63+
this.jobs = jobs;
64+
return this;
65+
}
66+
67+
public Builder owner(DetailedOwner owner) {
68+
this.owner = owner;
69+
return this;
70+
}
71+
72+
public GetSharedAudienceDataResponse build() {
73+
return new GetSharedAudienceDataResponse(audienceGroup, jobs, owner);
74+
}
75+
}
76+
}

0 commit comments

Comments
 (0)