πŸ’¬PUSH API send messages

circle-check

Overview

When you need to send personalized messages to specific users, you can integrate using FIRST LINE's PUSH API. This integration 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 system from scratch. With just a few simple steps, you can start sending personalized messages to your users.

API

curl -X POST
    -H "Content-Type: application/json"
    https://{API_HOST}/api/v1/message/push

Response

The response is in JSON format, and an HTTP status code of 200 indicates that the send was successful.

{}

URL Parameters

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 identifier in the contact system corresponding to each messaging channel, usually obtainable from Contact API the returned social media related data.

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 defined according to different message types. For example, when type is set to text ,message the content might be 'Hi! How are you!'.

is_force

When a conversation is in certain states, such as when the customer is talking to an agent, sending messages via the API is not allowed by default. But if the value is set to 1, it forces the message to be sent even if the conversation has already started.

Message field formats

Text message

Button

Property
Description

explain_text

Body description

options[].label

The text label of the button or option

options[].value

The message value to send

options[].type

The type of the option (e.g., text, phonenumber, url)

options[].number

Phone number (only present when type is phonenumber)

options[].url

URL to open (only present when type is url)

Quick Reply

Property
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 (only present when type is url)

Used to send horizontally scrollable carousel content. Each carousel item contains an image, a short description, and buttons.

Property
Description

alt_text

Fallback 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

The text of the action button or link

columns[].actions[].value

The value of the action button or link

columns[].actions[].url

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

columns[].actions[].type

The type of the action button or link, e.g.: url or text

columns[].actions[].label

The label of the action button or link (if present)

Property
Description

alt_text

Fallback message or sent when the message format is not supported

columns[].image_url

URL address of the background image

columns[].action.type

Type of the action (may be null), e.g.: url or text

columns[].action.url

URL address of the action (may be null)

columns[].action.value

Value of the action (may be null)

columns[].button.text

Text of the button

columns[].button.background_color

Button background color, as a HEX color code

columns[].button.border_color

Button border color, as a HEX color code

columns[].button.color

Button text color, as a HEX color code

columns[].badge.text

Badge text

columns[].badge.background_color

Badge background color, as a HEX color code

columns[].badge.border_color

Badge border color, as a HEX color code

columns[].badge.color

Badge text color, as a HEX color code

Last updated