Skip to content

LINE

LINE is one of the world’s most popular instant messaging platforms, used by hundreds of millions of monthly active users. Through this platform, brands can engage with their customers with rich and two-way messaging.

The Braze and LINE integration allows you to leverage Braze webhooks, advanced segmentation, personalization, and triggering features to message your users in LINE through the LINE messaging API.

Prerequisites

LINE allows both promotional and non-promotional messaging to users as long your brand has secured users’ consent. To send messages to users, you must meet one of two conditions:

  • Users who have added your LINE official account as a friend
  • Users who haven’t added your LINE official account as a friend but have sent a message to your LINE official account (excluding users who have blocked your LINE official account).

Requirement Description
LINE business account A LINE official business account is required to take advantage of this partnership.

When sending LINE messages, your messages will all be associated with your LINE official account, resulting in users seeing your account name and page.
Messaging API channel When enabling the use of the messaging API in the LINE official account manager, a messaging API channel is created. This will be the channel you use to communicate with your customers.
Channel access tokens The channel access token will allow you to send messages to users that have added your LINE official account as a friend. This token can be found in the LINE Developer Console under the Messaging API tab.
LINE user IDs You will need to have users’ LINE IDs (this ID is different from users’ usernames) to send messages on LINE.

Once a user adds your LINE official account as a friend, you can access the user’s LINE ID through LINE’s Users API.

Integration

Step 1: Collect customer LINE IDs

To send messages in LINE, you need to collect your users’ LINE IDs to identify your user and interact with them consistently. LINE IDs are not the same as the user’s LINE usernames. LINE IDs are generated by LINE and can be used when interacting with LINE’s APIs.

LINE IDs can be obtained using the LINE User ID API. This endpoint will return a list of LINE IDs for all users who have friended your LINE official account or sent your account a message and have not blocked you.

When making a GET request to the endpoint https://api.line.me/v2/bot/followers/ids, you will get the following:

1
2
3
4
5
6
7
8
{
   "userIds":[
      "U4af4980629...",
      "U0c229f96c4...",
      "U95afb1d4df..."
   ],
   "next":"yANU9IA..."
}

Once you obtain a list of LINE IDs, you will send them to Braze as a line_id custom attribute.

Step 2: Send IDs to Braze as custom attributes

Coordinate and share this with your developers to send the line_id to Braze as custom attributes.

Step 3: Set your channel access token as a Content Block.

In Braze, navigate to Templates & Media > Content Blocks Library > + Create Content Block and create a Braze Content Block. Name this Content Block LINE_Channel_AccessToken.

Next, paste your channel access token in the Content Block body, and save it.

An image the Content Block showing the Content Block name, Liquid tag, and censored channel access token.

Once you’ve set the channel access token inside a Content Block, you will be able to use the LINE webhook template to send messages to users.

Step 4: Select a webhook template

From Templates & Media, go to Webhook Templates and choose one of the following LINE Messenger webhook templates:

A selection of available predesigned webhook templates.

The LINE text webhook template will allow you to send text-based messages that support emojis.

The line messaging UI with two examples of what a text message will look like on their platform.

The LINE sticker template will allow you to send sticker messages. Stickers can be used to make your bot app more expressive and engaging for your users.

To send a sticker, include the sticker’s package ID and sticker ID in the message object. See the list of available stickers that can be sent with the Messaging API.

The line messaging UI with several examples of what sticker messages look like. These examples include a bear celebrating, a rabbit giving a thumbs up, and a yellow duck.

The LINE image template allows you to send images to your LINE users.

To send images, include URLs of the original image and a smaller preview image in the message object. The preview image is displayed in the chat, and the full image is opened when the image is tapped. Note that the URLs must use HTTPS over TLS 1.2 or later.

The line messaging UI showing what an image message will look like on their platform.

Step 5: Set up your webhook template

In your webhook template, provide a template name and add teams and tags, as necessary. Next, enter your message, sticker ID, or image depending on the LINE template type you selected.

The custom attribute LINE ID should be templated in the message body’s To: field. If not, include the LINE ID as a custom attribute. This can be done by using the blue and white + button in the corner of the Request Body box.

Previewing and Testing Your Webhook

Before you send your message, test your webhook. Make sure your LINE ID is saved in Braze (or find it and test as a customized user), and use the preview to send the test message:

Test tab in the Braze webhook builder that shows you can preview the message by sending it to an existing user.

If you receive the message successfully, you can start to configure its delivery settings.

Using this integration

Once set up, use this integration to target LINE users. First, create a segment for all users for whom the LINE ID exists as a custom attribute and turn on analytics tracking to track your Messenger subscription rates over time.

Segment filter "line_id" set to "is not blank".

If you choose not to create a specific segment for Messenger subscribers, make sure to include a filter for LINE ID existing to avoid errors.

You may also use other segmentation to target your LINE campaigns and the rest of the campaign creation process, as is with any other campaign.

WAS THIS PAGE HELPFUL?
New Stuff!