Skip to content

Commit

Permalink
Add /v2/bot/audienceGroup/shared path (#1546)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
github-actions[bot] and github-actions authored Feb 12, 2025
1 parent b050d37 commit aaeef1a
Show file tree
Hide file tree
Showing 8 changed files with 350 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
src/main/java/com/linecorp/bot/audience/client/ManageAudienceBlobClient.java
src/main/java/com/linecorp/bot/audience/client/ManageAudienceClient.java
src/main/java/com/linecorp/bot/audience/model/Adaccount.java
src/main/java/com/linecorp/bot/audience/model/AddAudienceToAudienceGroupRequest.java
src/main/java/com/linecorp/bot/audience/model/Audience.java
src/main/java/com/linecorp/bot/audience/model/AudienceGroup.java
Expand All @@ -19,10 +20,13 @@ src/main/java/com/linecorp/bot/audience/model/CreateClickBasedAudienceGroupReque
src/main/java/com/linecorp/bot/audience/model/CreateClickBasedAudienceGroupResponse.java
src/main/java/com/linecorp/bot/audience/model/CreateImpBasedAudienceGroupRequest.java
src/main/java/com/linecorp/bot/audience/model/CreateImpBasedAudienceGroupResponse.java
src/main/java/com/linecorp/bot/audience/model/DetailedOwner.java
src/main/java/com/linecorp/bot/audience/model/ErrorDetail.java
src/main/java/com/linecorp/bot/audience/model/ErrorResponse.java
src/main/java/com/linecorp/bot/audience/model/GetAudienceDataResponse.java
src/main/java/com/linecorp/bot/audience/model/GetAudienceGroupAuthorityLevelResponse.java
src/main/java/com/linecorp/bot/audience/model/GetAudienceGroupsResponse.java
src/main/java/com/linecorp/bot/audience/model/GetSharedAudienceDataResponse.java
src/main/java/com/linecorp/bot/audience/model/GetSharedAudienceGroupsResponse.java
src/main/java/com/linecorp/bot/audience/model/UpdateAudienceGroupAuthorityLevelRequest.java
src/main/java/com/linecorp/bot/audience/model/UpdateAudienceGroupDescriptionRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import com.linecorp.bot.audience.model.GetAudienceDataResponse;
import com.linecorp.bot.audience.model.GetAudienceGroupAuthorityLevelResponse;
import com.linecorp.bot.audience.model.GetAudienceGroupsResponse;
import com.linecorp.bot.audience.model.GetSharedAudienceDataResponse;
import com.linecorp.bot.audience.model.GetSharedAudienceGroupsResponse;
import com.linecorp.bot.audience.model.UpdateAudienceGroupAuthorityLevelRequest;
import com.linecorp.bot.audience.model.UpdateAudienceGroupDescriptionRequest;
import com.linecorp.bot.client.base.ApiAuthenticatedClientBuilder;
Expand Down Expand Up @@ -166,6 +168,44 @@ CompletableFuture<Result<GetAudienceGroupsResponse>> getAudienceGroups(
@Query("includesExternalPublicGroups") Boolean includesExternalPublicGroups,
@Query("createRoute") AudienceGroupCreateRoute createRoute);

/**
* Gets audience data.
*
* @param audienceGroupId The audience ID. (required)
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience">
* Documentation</a>
*/
@GET("/v2/bot/audienceGroup/shared/{audienceGroupId}")
CompletableFuture<Result<GetSharedAudienceDataResponse>> getSharedAudienceData(
@Path("audienceGroupId") Long audienceGroupId);

/**
* Gets data for more than one audience, including those shared by the Business Manager.
*
* @param page The page to return when getting (paginated) results. Must be 1 or higher.
* (required)
* @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. (optional)
* @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. (optional)
* @param size The number of audiences per page. Default: 20 Max: 40 (optional)
* @param createRoute How the audience was created. If omitted, all audiences are included.
* &#x60;OA_MANAGER&#x60;: Return only audiences created with LINE Official Account Manager
* (opens new window). &#x60;MESSAGING_API&#x60;: Return only audiences created with Messaging
* API. (optional)
* @see <a
* href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list">
* Documentation</a>
*/
@GET("/v2/bot/audienceGroup/shared/list")
CompletableFuture<Result<GetSharedAudienceGroupsResponse>> getSharedAudienceGroups(
@Query("page") Long page,
@Query("description") String description,
@Query("status") AudienceGroupStatus status,
@Query("size") Long size,
@Query("createRoute") AudienceGroupCreateRoute createRoute);

/**
* Change the authority level of the audience
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright 2023 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech Do not edit the class manually.
*/
package com.linecorp.bot.audience.model;



import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Adaccount */
@JsonInclude(Include.NON_NULL)
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
public record Adaccount(
/** Ad account name. */
@JsonProperty("name") String name) {

public static class Builder {
private String name;

public Builder() {}

public Builder name(String name) {
this.name = name;
return this;
}

public Adaccount build() {
return new Adaccount(name);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Copyright 2023 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech Do not edit the class manually.
*/
package com.linecorp.bot.audience.model;



import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Owner of this audience group. */
@JsonInclude(Include.NON_NULL)
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
public record DetailedOwner(
/** Service name where the audience group has been created. */
@JsonProperty("serviceType") String serviceType,
/** Owner ID in the service. */
@JsonProperty("id") String id,
/** Owner account name. */
@JsonProperty("name") String name) {

public static class Builder {
private String serviceType;
private String id;
private String name;

public Builder() {}

public Builder serviceType(String serviceType) {
this.serviceType = serviceType;
return this;
}

public Builder id(String id) {
this.id = id;
return this;
}

public Builder name(String name) {
this.name = name;
return this;
}

public DetailedOwner build() {
return new DetailedOwner(serviceType, id, name);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,14 @@ public record GetAudienceDataResponse(
* IFAs to an audience for uploading user IDs. Empty array is returned for any other type of
* audience. Max: 50
*/
@JsonProperty("jobs") List<AudienceGroupJob> jobs) {
@JsonProperty("jobs") List<AudienceGroupJob> jobs,
/** Get adaccount */
@JsonProperty("adaccount") Adaccount adaccount) {

public static class Builder {
private AudienceGroup audienceGroup;
private List<AudienceGroupJob> jobs;
private Adaccount adaccount;

public Builder() {}

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

public Builder adaccount(Adaccount adaccount) {
this.adaccount = adaccount;
return this;
}

public GetAudienceDataResponse build() {
return new GetAudienceDataResponse(audienceGroup, jobs);
return new GetAudienceDataResponse(audienceGroup, jobs, adaccount);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright 2023 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech Do not edit the class manually.
*/
package com.linecorp.bot.audience.model;



import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/**
* Get audience data
*
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-group">
* Documentation</a>
*/
@JsonInclude(Include.NON_NULL)
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
public record GetSharedAudienceDataResponse(
/** Get audienceGroup */
@JsonProperty("audienceGroup") AudienceGroup audienceGroup,
/**
* 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
*/
@JsonProperty("jobs") List<AudienceGroupJob> jobs,
/** Get owner */
@JsonProperty("owner") DetailedOwner owner) {

public static class Builder {
private AudienceGroup audienceGroup;
private List<AudienceGroupJob> jobs;
private DetailedOwner owner;

public Builder() {}

public Builder audienceGroup(AudienceGroup audienceGroup) {
this.audienceGroup = audienceGroup;
return this;
}

public Builder jobs(List<AudienceGroupJob> jobs) {
this.jobs = jobs;
return this;
}

public Builder owner(DetailedOwner owner) {
this.owner = owner;
return this;
}

public GetSharedAudienceDataResponse build() {
return new GetSharedAudienceDataResponse(audienceGroup, jobs, owner);
}
}
}
Loading

0 comments on commit aaeef1a

Please sign in to comment.