Repository navigation
v2.11.0 Support templated LINE notification messages (PNP) and custom aggregation units
Latest
·
30 commits
to master
since this release
Immutable
release. Only release title and notes can be modified.
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
templateKeyand substituting values into the template'semphasizedItem,items, andbuttons. 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.
- Send — send a message built from a template registered in advance, by specifying a
- 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:
- Templated LINE notification message: https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/
- LINE notification messages API reference: https://developers.line.biz/en/reference/line-notification-messages/
- Custom aggregation units: https://developers.line.biz/en/docs/messaging-api/unit-based-statistics-aggregation/
Example: send a templated LINE notification message
require 'line-bot-api'
client = Line::Bot::V2::MessagingApi::ApiClient.new(
channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN")
)
request = Line::Bot::V2::MessagingApi::PnpTemplatedMessageRequest.new(
# Phone number normalized to E.164 and hashed with SHA256
to: "0123...hashed_phone_number...cdef",
template_key: "order_confirmation",
body: Line::Bot::V2::MessagingApi::PnpTemplatedMessageBody.new(
emphasized_item: Line::Bot::V2::MessagingApi::PnpTemplatedEmphasizedItem.new(
item_key: "amount",
content: "$42.00"
),
items: [
Line::Bot::V2::MessagingApi::PnpTemplatedItem.new(item_key: "order_id", content: "A1234567"),
Line::Bot::V2::MessagingApi::PnpTemplatedItem.new(item_key: "shop_name", content: "LINE Store")
],
buttons: [
Line::Bot::V2::MessagingApi::PnpTemplatedButton.new(
button_key: "detail",
url: "https://example.com/orders/A1234567"
)
]
),
custom_aggregation_units: ["promotion_a"]
)
# x_line_delivery_tag (16-100 chars) is returned in the delivery completion webhook
client.push_templated_messages_by_phone(
pnp_templated_message_request: request,
x_line_delivery_tag: "order-A1234567-0001"
)Example: get the number of sent templated notification messages
require 'line-bot-api'
client = Line::Bot::V2::MessagingApi::ApiClient.new(
channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN")
)
# GET /v2/bot/message/delivery/pnp/templated (date: yyyyMMdd, UTC+9)
response = client.get_pnp_templated_message_statistics(date: "20240916")
puts response.status # "ready" / "unready" / "unavailable_for_privacy" / "out_of_service"
puts response.successWhat's Changed
line-openapi updates
- Update line-openapi digest to de8bd9e by @renovate[bot] in #878
- Add Templated LINE notification message API and custom aggregation units for PNP by @github-actions[bot] in #914
Dependency updates
- Update ruby/setup-ruby action to v1.315.0 by @renovate[bot] in #853
- Update dependency rubocop to v1.88.1 by @renovate[bot] in #854
- Update dependency line-bot-api to v2.9.0 by @renovate[bot] in #855
- Update ruby/setup-ruby action to v1.316.0 by @renovate[bot] in #856
- Update actions/setup-java action to v5.5.0 by @renovate[bot] in #857
- Update actions/stale action to v10.4.0 by @renovate[bot] in #858
- Lock file maintenance by @renovate[bot] in #859
- Update actions/setup-node action to v6.5.0 by @renovate[bot] in #860
- Update ruby/setup-ruby action to v1.317.0 by @renovate[bot] in #861
- Update actions/setup-node action to v7 by @renovate[bot] in #862
- Lock file maintenance by @renovate[bot] in #863
- Update dependency yard to v0.9.45 by @renovate[bot] in #864
- Update ruby/setup-ruby action to v1.318.0 by @renovate[bot] in #865
- Update ruby/setup-ruby action to v1.319.0 by @renovate[bot] in #866
- Update actions/setup-java action to v5.6.0 by @renovate[bot] in #867
- Lock file maintenance by @renovate[bot] in #868
- Update dependency org.apache.maven.plugins:maven-jar-plugin to v3.5.1 by @renovate[bot] in #870
- Lock file maintenance by @renovate[bot] in #869
- Lock file maintenance by @renovate[bot] in #871
- Update openapi-generator-version to v7.24.0 by @renovate[bot] in #872
- Update actions/checkout action to v7.0.1 by @renovate[bot] in #874
- Lock file maintenance by @renovate[bot] in #876
- Update ruby/setup-ruby action to v1.320.0 by @renovate[bot] in #879
- Update ruby/setup-ruby action to v1.321.0 by @renovate[bot] in #880
- Lock file maintenance by @renovate[bot] in #881
- Update actions/stale action to v11 by @renovate[bot] in #882
- Lock file maintenance by @renovate[bot] in #883
- Update actions/setup-java action to v5.7.0 by @renovate[bot] in #884
- Update dependency rubocop to '~> 1.89.0' by @renovate[bot] in #885
- Lock file maintenance by @renovate[bot] in #887
- Lock file maintenance by @renovate[bot] in #888
- Lock file maintenance by @renovate[bot] in #889
- Lock file maintenance by @renovate[bot] in #890
- Lock file maintenance by @renovate[bot] in #891
- Update dependency rack to v3.2.7 by @renovate[bot] in #892
- Lock file maintenance by @renovate[bot] in #893
- Update rubygems/release-gem action to v1.4.1 by @renovate[bot] in #894
- Lock file maintenance by @renovate[bot] in #895
- Update dependency webmock to v3.26.3 by @renovate[bot] in #896
- Update openapi-generator-version to v7.25.0 by @renovate[bot] in #898
- Update dependency rubocop to '~> 1.90.0' by @renovate[bot] in #897
- Update actions/setup-java action to v6 by @renovate[bot] in #899
- Update dependency webmock to v3.26.4 by @renovate[bot] in #901
- Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.16.0 by @renovate[bot] in #902
- Update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.6.0 by @renovate[bot] in #903
- Update actions/deploy-pages action to v5.0.1 by @renovate[bot] in #904
- Update dependency steep to '~> 2.1.0' by @renovate[bot] in #900
- Lock file maintenance by @renovate[bot] in #905
- Lock file maintenance by @renovate[bot] in #906
- Update actions/setup-java action to v6.0.1 by @renovate[bot] in #907
- Update dependency rubocop to '~> 1.91.0' by @renovate[bot] in #908
- Update dependency org.codehaus.mojo:build-helper-maven-plugin to v3.6.2 by @renovate[bot] in #909
- Update ruby/setup-ruby action to v1.323.0 by @renovate[bot] in #911
- Lock file maintenance by @renovate[bot] in #910
- Update ruby/setup-ruby action to v1.324.0 by @renovate[bot] in #912
- Lock file maintenance by @renovate[bot] in #913
- Update ruby/setup-ruby action to v1.325.0 by @renovate[bot] in #915
Full Changelog: v2.10.0...v2.11.0
This release is prepared by @mokuzon