For the complete documentation index, see llms.txt. This page is also available as Markdown.

💬Send message via PUSH API

Overview

When you need to send personalized messages to specific users, you can integrate using FIRST LINE's PUSH API. This integration method allows you to deliver messages more effectively.

In addition, using the PUSH API can help you save time and resources, because you don't need to build a messaging delivery system from scratch yourself. With just a few simple steps, you can start sending personalized messages to your users.

API

curl -X POST "https://{API_HOST}/api/v1/message/push" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "contactable_type": "App\\LineContact",
    "contactable_id": 123,
    "type": "text",
    "message": "Hello, this is a notification sent by FIRST LINE.",
    "is_force": 0
  }'

Response

It is returned in JSON format, and the HTTP status code 200 indicates success.

JSON Request Body

Parameter
Description

contactable_type

Channel types include the following options:

  • Live Chat:App\LivechatContact

  • LINE OA:App\LineContact

  • Facebook Messenger:App\FbContact

  • Instagram:App\IgContact

  • Telegram:App\TelegramContact

  • Viber:App\ViberContact

  • WeChat:App\WechatContact

contactable_id

The system identifier for the contact corresponding to each messaging channel, usually available in Contact API the social media-related data returned.

type

Message types are divided into the following:

  • text: Text

  • carousel: Carousel

  • image_carousel: Image carousel

  • button: Button

  • quickreply: Quick reply

message

message The information is content defined according to different message types. For example, when type set to text when,message the content may be 'Hi! How are you!'.

is_force

When a conversation is in certain states, such as when the customer is talking with an agent, sending messages via the API is disallowed by default. But if the value is set to 1, messages will be forced to send even if the conversation has already started.

Message field message format

Text message

Button

Attribute
Description

explain_text

Body description

options[].label

Text description of the button or option

options[].value

Message value to send

options[].type

Option type (such as text, phonenumber, url)

options[].number

Phone number (exists only when type is phonenumber)

options[].url

URL to open (exists only when type is url)

Quick Reply

Attribute
Description

explain_text

Body message, text field

options[].label

Option label

options[].value

Option value

options[].type

Option type, e.g. url or text

options[].url

When the option type is url, the corresponding URL for that option (exists only when type is url)

Used to send carousel content that can be swiped left and right. Each carousel item includes an image, a brief description, and buttons.

Attribute
Description

alt_text

Prompt message or sent when the message format is not supported

columns[].image_url

URL address of the background image

columns[].title

Title

columns[].text

Text description

columns[].actions[].text

Text for the action button or link

columns[].actions[].value

Value of the action button or link

columns[].actions[].url

URL of the action button or link (exists only when type is url)

columns[].actions[].type

Type of the action button or link, e.g. url or text

columns[].actions[].label

Label of the action button or link (if present)

Last updated