Our business messaging API supports sending and receiving LINE messages.

Being able to send LINE messages requires requesting access via the Channels portal. Without onboarding LINE via the portal, you can not make use of this part of the API.

Fact sheet

FeatureSupportRemarks
text messagesyesThe maximum length of a LINE message is 5.000 characters, and it must be UTF-8 encoded.
mediayesThe media name attribute should end in the proper file extension. Only one media file is allowed per message. When the linked media doesn't exist/can't be found, the message will not be sent at all.
media: imagesyesMaximum file size for an uploaded image is 10 MB. Supported formats: png, jpeg and jpg.
media: videosyesMaximum file size for an uploaded image is 200 MB. Supported formats: mp4.
media: audiono
rich card messageno
rich card carouselno
quick repliesno
sticker messageno
location messageno

Onboarding

Onboarding pages for LINE are in development, in the meantime you are welcome to onboard for LINE via your customer success manager.


Sending messages

Input matrix

TextMediaSuggestionsHeaderOutput
xxxxNot supported
xxxText message
xxxMedia message

Text

Direct message with plain text content

The example below will send a simple text-only LINE message.

{
    "messages": {
        "authentication": {
            "producttoken": "Your product token"
        },
        "msg": [
            {
                "from": "Your Channel ID",
                "to": [
                    {
                        "number": "Recipients ID"
                    }
                ],
                "allowedChannels": [
                    "Line"
                ],
                "body": {
                    "content": ""
                },
                "richContent": {
                    "conversation": [
                        {
                            "text": "CM.com - Be part of it."
                        }
                    ]
                }
            }
        ]
    }
}

Media

Media typeSupported formatsMime typeSupported size maximum
Imagepng, jpeg, jpgimage/png, image/jpeg, image/jpg10MB
Videomp4video/mp4200MB

Direct message with image

In the example below, we send a simple rich content message that contains an image.

{
    "messages": {
        "authentication": {
            "producttoken": "Your product token"
        },
        "msg": [
            {
                "from": "Your Channel ID",
                "to": [
                    {
                        "number": "Recipients ID"
                    }
                ],
                "body": {
                    "content": ""
                },
                "allowedChannels": [
                    "Line"
                ],
                "richContent": {
                    "conversation": [
                        {
                            "media": {
                                "mediaName": "cm.png",
                                "mediaUri": "https://www.cm.com/cdn/cm/cm.png",
                                "mimeType": "image/png"
                            }
                        }
                    ]
                }
            }
        ]
    }
}

Direct message with video

In the example below, we send a simple rich content message that contains a video.

{
    "messages": {
        "authentication": {
            "producttoken": "Your product token"
        },
        "msg": [
            {
                "from": "Your Channel ID",
                "to": [
                    {
                        "number": "Recipients ID"
                    }
                ],
                "body": {
                    "content": ""
                },
                "allowedChannels": [
                    "Line"
                ],
                "richContent": {
                    "conversation": [
                        {
                            "media": {
                                "mediaName": "your-video.mp4",
                                "mediaUri": "your-video-url.mp4",
                                "mimeType": "video/mp4"
                            }
                        }
                    ]
                }
            }
        ]
    }
}

Receiving messages / Inbound flow

Since LINE is used for 2-way communication (chat) it is important to also implement an Inbound flow. You can find more information about how to do this using our API documentation of the Inbound webhook.