πŸ’¬Send a single message using LINE User Id

Sending messages using LINE User Id and line_account

When you need to send personalized messages to specific LINE users, you can use this API and integrate by using LINE User Id together with line_account to complete the integration. This integration method allows you to communicate more effectively with users under a specified account.

In addition, using this Push API can help you save time and resources because you don't need to build the message delivery and friend synchronization system from scratch.

With just a few simple steps, the system will automatically help you:

  1. Check whether there is already corresponding user data

  2. If not, verify via the LINE API whether they are a valid friend and create the data

  3. Send the message immediately after completion


API

Endpoint

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

{line_account} is the LINE official account ID within the system (path parameter).

Example (curl)


Response

The return is in JSON format, and the HTTP status code 200indicates successful sending.


URL / Body Parameters

Path Parameter

Name
Type
Required
Description

line_account

int

Yes

LINE Account ID within the system

Body Parameters

Name
Type
Required
Description

user_id

string

Yes

LINE UserId. Fixed length 33, format U + 32 hex characters

type

string

Yes

Message type:text,image,carousel,image_carousel,carousel_for_products,button,quickreply

message

object / string

Yes

The content of the message type depending on

is_force

boolean

No

Whether to force send, even if currently in a conversation


Message field message format

Text message

(Other types such as image / carousel / button / quickreply can be expanded in the same style.)


System process description

  1. Find existing data

    • Using {line_account} + user_id to check whether there is a corresponding contact.

    • If found β†’ send the message directly using that contact.

  2. If not found, verify friend via LINE API

    • Call the LINE official API to check whether the user_id is a {line_account} valid friend of

    • If verification fails β†’ return an error (for example 400 / 422).

  3. If verification passes, create the contact and send

    • Add the corresponding contact data in the system.

    • After creation is complete, immediately use the newly created contact to send the PUSH message.

Last updated