Skip to content

Add Templated LINE notification message API and custom aggregation units for PNP - #131

Merged
mokuzon merged 2 commits into
mainfrom
users/mokuson/pnp-templated-and-cau
Sep 29, 2026
Merged

mokuzon merged 2 commits into
mainfrom
users/mokuson/pnp-templated-and-cau

Conversation

@mokuzon

@mokuzon mokuzon commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

This adds the Templated LINE notification message (PNP) API and enables custom aggregation units (CAU) for LINE notification messages.

Changes

Templated LINE notification message (PNP)

  • Add POST /v2/bot/message/pnp/templated/push to send a notification message built from a pre-registered template (templateKey + body with emphasizedItem / items / buttons).
  • Add GET /v2/bot/message/delivery/pnp/templated to get the number of sent templated notification messages (reuses NumberOfMessagesResponse).
  • Add schemas: PnpTemplatedMessageRequest, PnpTemplatedMessageBody, PnpTemplatedEmphasizedItem, PnpTemplatedItem, PnpTemplatedButton.

Custom aggregation units (CAU) for PNP

  • Add customAggregationUnits to the flexible PNP request (PnpMessagesRequest) and to the new templated PNP request, so their delivery can be aggregated per unit via the existing unit-based statistics APIs.

References

…its for PNP

Add the Templated LINE notification message (PNP) endpoints and support
custom aggregation units (CAU) for LINE notification messages:

- Add POST /v2/bot/message/pnp/templated/push to send a notification
  message built from a pre-registered template. Only to and templateKey
  are required (body and body.emphasizedItem are optional); success
  returns 202 Accepted.
- Add GET /v2/bot/message/delivery/pnp/templated to get the number of
  sent templated notification messages.
- Add customAggregationUnits to the flexible PNP request and the new
  templated PNP request so their statistics can be aggregated per unit.

Refs:
- https://developers.line.biz/en/reference/line-notification-messages/
- https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/
- https://developers.line.biz/en/docs/messaging-api/unit-based-statistics-aggregation/
@mokuzon
mokuzon force-pushed the users/mokuson/pnp-templated-and-cau branch from 1108071 to 9b096bd Compare September 29, 2026 00:50
@mokuzon
mokuzon marked this pull request as ready for review September 29, 2026 01:00
@mokuzon
mokuzon requested a review from a team September 29, 2026 01:00
@mokuzon
mokuzon enabled auto-merge September 29, 2026 01:00

@Yang-33 Yang-33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost LGTM

Comment thread messaging-api.yml Outdated

PnpTemplatedMessageRequest:
externalDocs:
url: https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template

can you consider other externalDocs links to reference page, not guide for api body/response?

Comment thread messaging-api.yml Outdated
description: "Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256."
templateKey:
type: string
description: "Key of the template to use. The template must be registered in advance and authorized for the bot."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template says this, so how about using this?

Specify the Key of the template you want to send.
See Templates for available Key.

and embedding
https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#templates help developers?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same applies to the other properties as well! hope improving description and externalDocs !

@mokuzon
mokuzon force-pushed the users/mokuson/pnp-templated-and-cau branch from 4eac07d to 8447bba Compare September 29, 2026 03:41
@github-actions

Copy link
Copy Markdown

NODEJS

You can check generated code in nodejs

Check the diff here

@github-actions

Copy link
Copy Markdown

PYTHON

You can check generated code in python

Check the diff here

@github-actions

Copy link
Copy Markdown

JAVA

You can check generated code in java

Check the diff here

@github-actions

Copy link
Copy Markdown

PHP

You can check generated code in php

Check the diff here

@github-actions

Copy link
Copy Markdown

GO

You can check generated code in go

Check the diff here

@github-actions

Copy link
Copy Markdown

RUBY

You can check generated code in ruby

Check the diff here

@mokuzon

mokuzon commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

@Yang-33 Thank you for reviewing!
I improved description and externalDocs.
8447bba

@mokuzon
mokuzon requested a review from Yang-33 September 29, 2026 03:50

@Yang-33 Yang-33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect the release notes to follow the guide and be user-friendly~

@mokuzon
mokuzon added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit fa5577c Sep 29, 2026
23 checks passed
@mokuzon
mokuzon deleted the users/mokuson/pnp-templated-and-cau branch September 29, 2026 04:05
takumi3488 pushed a commit to takumi3488/dead-or-line that referenced this pull request Oct 2, 2026
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) | Type |
Update |
|---|---|---|---|---|---|
|
[github.com/line/line-bot-sdk-go/v8](https://redirect.github.com/line/line-bot-sdk-go)
| `v8.22.0` → `v8.23.0` |
![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fline%2fline-bot-sdk-go%2fv8/v8.23.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fline%2fline-bot-sdk-go%2fv8/v8.22.0/v8.23.0?slim=true)
| require | minor |
| [golang](https://hub.docker.com/_/golang)
([source](https://redirect.github.com/docker-library/golang)) |
`1.26.0-alpine` → `1.27.1-alpine` |
![age](https://developer.mend.io/api/mc/badges/age/docker/golang/1.27.1?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/docker/golang/1.26.0/1.27.1?slim=true)
| stage | minor |

---

### Release Notes

<details>
<summary>line/line-bot-sdk-go
(github.com/line/line-bot-sdk-go/v8)</summary>

###
[`v8.23.0`](https://redirect.github.com/line/line-bot-sdk-go/releases/tag/v8.23.0):
Support templated LINE notification messages (PNP) and custom
aggregation units

[Compare
Source](https://redirect.github.com/line/line-bot-sdk-go/compare/v8.22.0...v8.23.0)

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](https://redirect.github.com/line/line-openapi/pull/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:

- 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

```go
package main

import (
	"log"

	"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api"
)

func main() {
	client, err := messaging_api.NewMessagingApiAPI("YOUR_CHANNEL_ACCESS_TOKEN")
	if err != nil {
		log.Fatal(err)
	}

	_, err = client.PushTemplatedMessagesByPhone(
		&messaging_api.PnpTemplatedMessageRequest{
			// SHA256 hash of the E.164-normalized destination phone number.
			To:          "0123...hashed_phone_number...cdef",
			TemplateKey: "order_confirmation",
			Body: &messaging_api.PnpTemplatedMessageBody{
				EmphasizedItem: &messaging_api.PnpTemplatedEmphasizedItem{
					ItemKey: "amount",
					Content: "$42.00",
				},
				Items: []messaging_api.PnpTemplatedItem{
					{ItemKey: "order_id", Content: "A1234567"},
					{ItemKey: "shop_name", Content: "LINE Store"},
				},
				Buttons: []messaging_api.PnpTemplatedButton{
					{ButtonKey: "detail", Url: "https://example.com/orders/A1234567"},
				},
			},
			CustomAggregationUnits: []string{"promotion_a"},
		},
		// xLineDeliveryTag (16-100 chars) is returned in the delivery completion webhook
		"order-A1234567-0001",
	)
	if err != nil {
		log.Fatal(err)
	}
}
```

##### Example: get the number of sent templated notification messages

```go
package main

import (
	"fmt"
	"log"

	"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api"
)

func main() {
	client, err := messaging_api.NewMessagingApiAPI("YOUR_CHANNEL_ACCESS_TOKEN")
	if err != nil {
		log.Fatal(err)
	}

	// GET /v2/bot/message/delivery/pnp/templated (date: yyyyMMdd, UTC+9)
	resp, err := client.GetPNPTemplatedMessageStatistics("20240916")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("status: %s\n", resp.Status)
	if resp.Status == messaging_api.NumberOfMessagesResponseSTATUS_READY {
		fmt.Printf("success: %d\n", resp.Success)
	}
}
```

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed

##### line-openapi updates

- Fix access\_token description in revokeChannelToken by
[@&#8203;github-actions](https://redirect.github.com/github-actions)\[bot]
in
[#&#8203;723](https://redirect.github.com/line/line-bot-sdk-go/pull/723)
- Add Templated LINE notification message API and custom aggregation
units for PNP by
[@&#8203;github-actions](https://redirect.github.com/github-actions)\[bot]
in
[#&#8203;733](https://redirect.github.com/line/line-bot-sdk-go/pull/733)

##### Dependency updates

- chore(deps): update actions/stale action to v10.4.0 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;712](https://redirect.github.com/line/line-bot-sdk-go/pull/712)
- chore(deps): update junit-framework monorepo to v6.1.2 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;713](https://redirect.github.com/line/line-bot-sdk-go/pull/713)
- chore(deps): update actions/setup-node action to v6.5.0 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;714](https://redirect.github.com/line/line-bot-sdk-go/pull/714)
- chore(deps): update actions/setup-node action to v7 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;715](https://redirect.github.com/line/line-bot-sdk-go/pull/715)
- chore(deps): update actions/setup-go action to v7 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;716](https://redirect.github.com/line/line-bot-sdk-go/pull/716)
- chore(deps): update dependency
org.apache.maven.plugins:maven-jar-plugin to v3.5.1 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;717](https://redirect.github.com/line/line-bot-sdk-go/pull/717)
- chore(deps): update actions/setup-python action to v7 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;718](https://redirect.github.com/line/line-bot-sdk-go/pull/718)
- fix(deps): update dependency org.openapitools:openapi-generator to
v7.24.0 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;719](https://redirect.github.com/line/line-bot-sdk-go/pull/719)
- chore(deps): update actions/checkout action to v7.0.1 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;720](https://redirect.github.com/line/line-bot-sdk-go/pull/720)
- chore(deps): update actions/stale action to v11 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;722](https://redirect.github.com/line/line-bot-sdk-go/pull/722)
- chore(deps): update junit-framework monorepo to v6.1.3 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;725](https://redirect.github.com/line/line-bot-sdk-go/pull/725)
- chore(deps): update dependency
org.apache.maven.plugins:maven-compiler-plugin to v3.16.0 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;730](https://redirect.github.com/line/line-bot-sdk-go/pull/730)
- fix(deps): update dependency org.openapitools:openapi-generator to
v7.25.0 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;729](https://redirect.github.com/line/line-bot-sdk-go/pull/729)
- chore(deps): update dependency
org.apache.maven.plugins:maven-surefire-plugin to v3.6.0 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;731](https://redirect.github.com/line/line-bot-sdk-go/pull/731)
- chore(deps): update dependency
org.codehaus.mojo:build-helper-maven-plugin to v3.6.2 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;732](https://redirect.github.com/line/line-bot-sdk-go/pull/732)

##### Other Changes

- Prevent path traversal by
[@&#8203;Yang-33](https://redirect.github.com/Yang-33) in
[#&#8203;724](https://redirect.github.com/line/line-bot-sdk-go/pull/724)
- Drop go 1.25 by [@&#8203;Yang-33](https://redirect.github.com/Yang-33)
in
[#&#8203;728](https://redirect.github.com/line/line-bot-sdk-go/pull/728)

**Full Changelog**:
<line/line-bot-sdk-go@v8.22.0...v8.23.0>

***

This release is prepared by
[@&#8203;mokuzon](https://redirect.github.com/mokuzon)

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/takumi3488/dead-or-line).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMjUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjEyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants