Skip to content

v10.2.0 Support templated LINE notification messages (PNP) and custom aggregation units

Latest

Choose a tag to compare

@github-actions github-actions released this 29 Sep 07:28
· 22 commits to master since this release
Immutable release. Only release title and notes can be modified.
9a5abd1

This version adds the templated LINE notification message (PNP) API, and lets you assign a custom aggregation unit (CAU) to LINE notification messages.

Schema changes: line/line-openapi#131

What's new

  • Templated PNP
    • Send — send a message built from a template registered in advance, by specifying a templateKey and substituting values into the template's emphasizedItem, items, and buttons. New endpoint: POST /v2/bot/message/pnp/templated/push.
    • Analytics — get the number of sent templated notification messages. New endpoint: GET /v2/bot/message/delivery/pnp/templated.
  • Custom aggregation unit — assign a custom aggregation unit to LINE notification messages (both templated and flexible) via customAggregationUnits, so their delivery can be aggregated per unit with the existing unit-based statistics APIs.

This is a partner-only feature that requires an application. For more details, see:

Example: send a templated LINE notification message

import com.linecorp.bot.messaging.client.MessagingApiClient;
import com.linecorp.bot.messaging.model.PnpTemplatedMessageRequest;
import com.linecorp.bot.messaging.model.PnpTemplatedMessageBody;
import com.linecorp.bot.messaging.model.PnpTemplatedEmphasizedItem;
import com.linecorp.bot.messaging.model.PnpTemplatedItem;
import com.linecorp.bot.messaging.model.PnpTemplatedButton;

import java.util.List;

MessagingApiClient client = MessagingApiClient.builder("MY_OWN_TOKEN").build();

PnpTemplatedMessageBody body = new PnpTemplatedMessageBody.Builder()
        .emphasizedItem(new PnpTemplatedEmphasizedItem.Builder("amount", "$42.00").build())
        .items(List.of(
                new PnpTemplatedItem.Builder("order_id", "A1234567").build(),
                new PnpTemplatedItem.Builder("shop_name", "LINE Store").build()))
        .buttons(List.of(
                new PnpTemplatedButton.Builder("detail", "https://example.com/orders/A1234567").build()))
        .build();

PnpTemplatedMessageRequest request = new PnpTemplatedMessageRequest.Builder(
                // "to" must be an E.164-normalized phone number hashed with SHA256
                "0123...hashed_phone_number...cdef",
                "order_confirmation") // templateKey
        .body(body)
        .customAggregationUnits(List.of("promotion_a"))
        .build();

// The first argument is the X-Line-Delivery-Tag header (16-100 chars),
// which is returned in the delivery completion webhook so you can tell which message was delivered.
client.pushTemplatedMessagesByPhone("order-A1234567-0001", request).get();

Example: get the number of sent templated notification messages

import com.linecorp.bot.client.base.Result;
import com.linecorp.bot.messaging.client.MessagingApiClient;
import com.linecorp.bot.messaging.model.NumberOfMessagesResponse;

MessagingApiClient client = MessagingApiClient.builder("MY_OWN_TOKEN").build();

// GET /v2/bot/message/delivery/pnp/templated?date=20240916 (yyyyMMdd, UTC+9)
Result<NumberOfMessagesResponse> result = client.getPNPTemplatedMessageStatistics("20240916").get();
NumberOfMessagesResponse response = result.body();

System.out.println(response.status()); // READY / UNREADY / UNAVAILABLE_FOR_PRIVACY / OUT_OF_SERVICE
if (response.status() == NumberOfMessagesResponse.Status.READY) {
    System.out.println(response.success());
}

What's Changed

line-openapi updates

  • chore(deps): update line-openapi digest to de8bd9e by @renovate[bot] in #1949
  • Fix access_token description in revokeChannelToken by @github-actions[bot] in #1950
  • Add Templated LINE notification message API and custom aggregation units for PNP by @github-actions[bot] in #1985

Dependency updates

  • fix(deps): update dependency com.github.bbottema:java-socks-proxy-server to v4.2.0 by @renovate[bot] in #1933
  • chore(deps): update actions/setup-java action to v5.5.0 by @renovate[bot] in #1935
  • fix(deps): update jackson monorepo to v2.22.1 by @renovate[bot] in #1934
  • fix(deps): update dependency ch.qos.logback:logback-classic to v1.5.38 by @renovate[bot] in #1936
  • chore(deps): update actions/stale action to v10.4.0 by @renovate[bot] in #1937
  • fix(deps): update junit-framework monorepo to v6.1.2 by @renovate[bot] in #1938
  • chore(deps): update dependency com.github.spotbugs.snom:spotbugs-gradle-plugin to v6.5.9 by @renovate[bot] in #1939
  • chore(deps): update actions/setup-node action to v6.5.0 by @renovate[bot] in #1940
  • chore(deps): update actions/setup-node action to v7 by @renovate[bot] in #1941
  • chore(deps): update actions/setup-java action to v5.6.0 by @renovate[bot] in #1943
  • chore(deps): update kotlin monorepo to v2.4.10 by @renovate[bot] in #1942
  • chore(deps): update dependency org.apache.maven.plugins:maven-jar-plugin to v3.5.1 by @renovate[bot] in #1944
  • chore(deps): update dependency org.openapitools:openapi-generator to v7.24.0 by @renovate[bot] in #1945
  • chore(deps): update dependency org.openapitools:openapi-generator-gradle-plugin to v7.24.0 by @renovate[bot] in #1946
  • fix(deps): update openapi-generator-version to v7.24.0 by @renovate[bot] in #1947
  • chore(deps): update actions/checkout action to v7.0.1 by @renovate[bot] in #1948
  • fix(deps): update dependency ch.qos.logback:logback-classic to v1.6.0 by @renovate[bot] in #1951
  • chore(deps): update actions/stale action to v11 by @renovate[bot] in #1953
  • fix(deps): update dependency ch.qos.logback:logback-classic to v1.6.1 by @renovate[bot] in #1955
  • chore(deps): update actions/setup-java action to v5.7.0 by @renovate[bot] in #1957
  • chore(deps): update gradle/actions action to v6.3.0 by @renovate[bot] in #1958
  • chore(deps): update dependency com.github.spotbugs.snom:spotbugs-gradle-plugin to v6.5.10 by @renovate[bot] in #1959
  • chore(deps): update gradle to v9.7.0 by @renovate[bot] in #1960
  • fix(deps): update dependency io.github.littleproxy:littleproxy to v2.9.0 by @renovate[bot] in #1961
  • fix(deps): update junit-framework monorepo to v6.1.3 by @renovate[bot] in #1962
  • fix(deps): update dependency ch.qos.logback:logback-classic to v1.6.2 by @renovate[bot] in #1963
  • fix(deps): update dependency ch.qos.logback:logback-classic to v1.6.3 by @renovate[bot] in #1964
  • fix(deps): update okhttp3 to v5.5.0 by @renovate[bot] in #1966
  • fix(deps): update jackson monorepo to v2.22.2 by @renovate[bot] in #1965
  • chore(deps): update gradle to v9.7.1 by @renovate[bot] in #1967
  • chore(deps): update dependency com.github.spotbugs.snom:spotbugs-gradle-plugin to v6.5.11 by @renovate[bot] in #1968
  • chore(deps): update dependency org.springframework.boot:spring-boot-gradle-plugin to v4.1.1 by @renovate[bot] in #1969
  • fix(deps): update openapi-generator-version to v7.25.0 by @renovate[bot] in #1972
  • chore(deps): update actions/setup-java action to v6 by @renovate[bot] in #1973
  • chore(deps): update dependency org.openapitools:openapi-generator to v7.25.0 by @renovate[bot] in #1970
  • chore(deps): update dependency org.openapitools:openapi-generator-gradle-plugin to v7.25.0 by @renovate[bot] in #1971
  • fix(deps): update dependency io.github.littleproxy:littleproxy to v2.9.1 by @renovate[bot] in #1974
  • chore(deps): update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.16.0 by @renovate[bot] in #1975
  • chore(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.6.0 by @renovate[bot] in #1976
  • fix(deps): update slf4j monorepo to v2.0.19 by @renovate[bot] in #1977
  • chore(deps): update plugin org.jetbrains.kotlin.plugin.spring to v2.4.20 by @renovate[bot] in #1979
  • chore(deps): update plugin org.jetbrains.kotlin.jvm to v2.4.20 by @renovate[bot] in #1978
  • chore(deps): update actions/setup-java action to v6.0.1 by @renovate[bot] in #1981
  • chore(deps): update dependency org.codehaus.mojo:build-helper-maven-plugin to v3.6.2 by @renovate[bot] in #1982
  • fix(deps): update dependency com.nimbusds:nimbus-jose-jwt to v10.10 by @renovate[bot] in #1983
  • fix(deps): update jackson monorepo to v2.22.3 by @renovate[bot] in #1984

Other Changes

Full Changelog: v10.1.0...v10.2.0


This release is prepared by @mokuzon