YOCTOL.AI Document
  • Welcome Page
  • Seeker - Guideline
    • Fan analysis: Intimacy Level and Tag
    • Post & Analysis Dashboard
    • Publishing Tool: Create posts with auto tag and reply
    • How to set a Tracking URL
    • How to use Ads Audience tool
    • Message & Keyword Reply
    • Role Settings
    • Broadcast
    • FAQ
  • Creator - Chatbot Building Guide
    • (1) Create YOCTOL.AI Account
    • (2) Create Chatbot and Connect
    • (3) Create Intents and Utterances
    • (4) Train and Test
    • (5) Create Entity
    • (6) Edit Dialogue
    • (7) Set Rules
    • (8) Publish
  • Creator - Advanced Settings
    • Switch to Live Agent - Messenger
    • JSON API for Messenger
    • JSON API for LINE
    • Referral Link - Messenger
    • Extension
    • Tag
  • Creator - Campaign Promotion Guide
    • Set Broadcast Message
    • Auto Reply for Campaign
  • Creator - Common Issues
    • FAQ
    • How to improve my chatbot’s accuracy?
    • How to Activate a Staging Chatbot?
    • Can’t Find Existing Pages.
    • How to Switch back to Live Agent? (LINE)
    • Downloading and Uploading Chatbots
    • How to Switch Languages? (Chinese, English)
  • Creator - Term Translations
    • Dialogue
    • Message
    • Component
    • Intent
    • Utterance
    • Entity
    • Rule
    • Regular Expression
    • Menu
    • Default Reply
    • Welcome Message
    • Live Agent
    • Permission Management
Powered by GitBook
On this page
  • Response reference
  • Sending Text
  • Sending Image
  • Sending Video
  • Sending Voice Messages
  • Sending Sticker
  • Sending Buttons
  • Sending Quick Reply

Was this helpful?

  1. Creator - Advanced Settings

JSON API for LINE

PreviousJSON API for MessengerNextReferral Link - Messenger

Last updated 5 years ago

Was this helpful?

You can make many kinds of HTTP requests for your bot to analyze your backend and send responses.

To be specific, you can run:

  1. Create dynamic messages

  2. Execute “postbacks”

  3. Obtain and set up user arguments (coming soon)

  4. Redirecting to other messages (coming soon)

Response reference

We will parse the JSON response and send a message to the customer based on the response. For more information, please visit

Sending Text

The response below will send text to a customer.

{
  "messages": [
    {
      "type": "text",
      "text": "Welcome to the smartest bot building tool ever —— YOCTOL.AI"
    },
    {
      "type": "text",
      "text": "what kind of bot do you want  to build?"
    }
  ]
}

Sending Image

Image formats of JPG are supported as messages from JSON requests.

{
  "messages": [
    {
      "type": "image",
      "originalContentUrl": "https://example.com/original.jpg",
      "previewImageUrl": "https://example.com/preview.jpg"
    }
  ]
}

Sending Video

The following response is an example of using a video as message. Currently, LINE only supports MP4 files with size less than 10MB and time less than 1 minute.

{
  "messages": [
    {
      "type": "video",
      "originalContentUrl": "https://example.com/original.mp4",
      "previewImageUrl": "https://example.com/preview.jpg"
    }
  ]
}

Sending Voice Messages

The following response will send a voice message file. Currently, LINE only supports memo files with size less than 10MB, less than 1 minute and extensions of M4A.

{
  "messages": [
    {
      "attachment": {
        "type": "audio",
        "payload": {
          "url": "https://ccrma.stanford.edu/~jos/mp3/bachfugue.mp3"
        }
      }
    }
  ]

Sending Sticker

The following response will send a sticker.

{
  "messages": [
    {
      "type": "sticker",
      "packageId": "1",
      "stickerId": "1"
    }
  ]
}

Sending Buttons

{
  "messages": [
    {
      "type": "template",
      "altText": "This is a buttons template",
      "template": {
        "type": "buttons",
        "thumbnailImageUrl": "https://example.com/bot/images/image.jpg",
        "imageAspectRatio": "rectangle",
        "imageSize": "cover",
        "imageBackgroundColor": "#FFFFFF",
        "title": "Menu",
        "text": "Please select",
        "defaultAction": {
          "type": "uri",
          "label": "View detail",
          "uri": "http://example.com/page/123"
        },
        "actions": [
          {
            "type": "postback",
            "label": "Buy",
            "data": "action=buy&itemid=123"
          },
          {
            "type": "postback",
            "label": "Add to cart",
            "data": "action=add&itemid=123"
          },
          {
            "type": "uri",
            "label": "View detail",
            "uri": "http://example.com/page/123"
          }
        ]
      }
    }
  ]
}

You can also send special buttons for actions, such as open camera.

{
  "messages": [
    {
      "type": "template",
      "altText": "This is a buttons template",
      "template": {
        "type": "buttons",
        "text": "Please select",
        "actions": [
          {
            "type": "camera",
            "label": "Camera"
          },
          {
            "type": "cameraRoll",
            "label": "Camera roll"
          }
        ]
      }
    }
  ]
}

Sending Quick Reply

The following response provides text with quick reply buttons.

{
  "messages": [
    {
      "type": "text",
      "text": "Did you enjoy the last game of the CF Rockets?",
      "quickReply": {
        "items": [
          {
            "type": "action",
            "action": {
              "type": "cameraRoll",
              "label": "Send photo"
            }
          },
          {
            "type": "action",
            "action": {
              "type": "camera",
              "label": "Open camera"
            }
          }
        ]
      }
    }
  ]
}

The following response will send a button template. You can manually set up the actions for each button, for example prompting to another website. For more usages of buttons, visit

https://developers.line.biz/en/reference/messaging-api/
https://developers.line.biz/en/reference/messaging-api/#buttons