Thẻ JSON API

Cho phép cấu hình kịch bản chatbot gọi tới hệ thống khác qua API. Sử dụng phổ biến cho các trường hợp muốn tra cứu dữ liệu lưu tại hệ thống CRM ngoài.

Dữ liệu trả về từ API hỗ trợ các loại sau: 1. Tin nhắn văn bản 2. Tin nhắn văn bản có nút bấm 3. Tin nhắn hình ảnh 4. Tin nhắn video 5. Tin nhắn audio 6. Tin nhắn file 7. Tin nhắn slide ảnh 8. Tin nhắn phản hồi nhanh 9. Kịch bản chuyển tiếp tư vấn viên

Giao diện cấu hình thẻ JSON API trong chatbot

1. Tin nhắn văn bản

{
  "messages": [
    {
      "text": "Xin chào CareSoft!"
    },
    {
      "text": "Yêu cầu của bạn đang được xử lý!"
    }
  ]
}

2. Tin nhắn văn bản có nút bấm

{
  "messages":
  [{
    "attachment":{
      "type":"template",
      "payload":{
        "template_type":"button",
        "text":"What do you want to do next?",
        "buttons":[
          {
            "type":"postback",
            "Payload":"data sample",
            "title":"OK"
          },
          {
            "type":"web_url",
            "url":"https://caresoft.vn",
            "title":"Visit Website"
          },
          {
            "type":"phone_number",
            "title":"Call Now",
            "payload":"+842473048222"
          }
        ]
      }
    }
  }]
}

3. Tin nhắn hình ảnh

{
  "messages": [
    {
      "attachment": {
        "type": "image",
        "payload": {
          "url": "https://home.caresoft.vn/assets/logo.png"
        }
      }
    }
  ]
}

4. Tin nhắn video

{
  "messages": [
    {
      "attachment": {
        "type": "video",
        "payload": {
          "url": "https://caresoft.vn/assets/video.mp4"
        }
      }
    }
  ]
}

5. Tin nhắn audio

{
  "messages": [
    {
      "attachment": {
        "type": "audio",
        "payload": {
          "url": "https://caresoft.vn/assets/audio.mp3"
        }
      }
    }
  ]
}

6. Tin nhắn file

{
  "messages": [
    {
      "attachment": {
        "type": "file",
        "payload": {
          "url": "https://caresoft.vn/assets/guide.pdf"
        }
      }
    }
  ]
}

7. Tin nhắn slide ảnh

{
  "messages": [{
      "attachment":{
        "type":"template",
        "payload":{
          "template_type":"generic",
          "image_aspect_ratio": "square",
          "elements":[
            {
              "title":"Sample Image",
              "image_url":"https://home.caresoft.vn/wp-content/themes/3c/img/logo.png",
              "subtitle":"Size: M",
              "buttons":[
                {
                  "type":"web_url",
                  "url":"https://caresoft.vn",
                  "title":"View Item"
                }
              ]
            },
            {
              "title":"Logo CS",
              "image_url":"https://home.caresoft.vn/wp-content/themes/3c/img/logo.png",
              "subtitle":"Size: L",
              "default_action": {
                "type": "web_url",
                "url": "https://caresoft.vn",
                "messenger_extensions": true
              },
              "buttons":[
                {
                  "type":"web_url",
                  "url":"https://caresoft.vn",
                  "title":"View Item"
                }
              ]
            }
          ]
        }
      }
    }]
}

8. Tin nhắn phản hồi nhanh

{
  "messages": [
    {
      "text": "Chọn 1 đáp án:",
      "quick_replies": [
        {
          "content_type": "text",
          "title": "Call Center",
          "payload": "<POSTBACK_PAYLOAD>",
          "image_url": "http://example.com/img/red.png"
        },
        {
          "content_type": "text",
          "title": "Contact Center",
          "payload": "<POSTBACK_PAYLOAD>",
          "image_url": 'http://example.com/img/green.png"
        }
      ]
    }
  ]
}

9. Gặp tư vấn viên

Truyền vào danh sách ip phone của agent hoặc để rỗng nếu muốn gặp tất cả chuyên viên có kỹ năng
{
  "connect_to_list_agent": []
}

Last updated