YOCTOL.AI 使用說明
  • 歡迎使用 YOCTOL.AI
  • Seeker - 使用說明
    • 粉絲分析:類型&標籤&興趣
    • 如何查看貼文成效
    • 貼文工具:建立貼文,自動貼標回覆
    • 如何設定追蹤網址
    • 廣告篩選受眾& AI 精準名單
    • 訊息 & 關鍵字回覆設定
    • 權限介紹
    • 訊息推播
    • 常見問題
  • Creator - 建機器人指南
    • (1) 註冊 YOCTOL.AI 帳號
    • (2) 新增機器人&綁定
    • (3) 建立意圖 & 撰寫訓練句
    • (4) 訓練及測試
    • (5) 加入抽換詞類
    • (6) 編輯腳本
    • (7) 設定觸發條件
    • (8) 發布機器人
  • Creator - 進階設定
    • 設定轉真人客服功能 - Messenger
    • 應用 API 元件 - Messenger
    • 應用 API 元件 - LINE
    • Referral Link - Messenger
    • Extension
    • 顧客標籤
  • Creator - 行銷活動指南
    • 設定推播訊息
    • 使用貼文回覆活動
  • Creator - 常見問題
    • 如何改善機器人答錯狀況?
    • 如何啟用測試版機器人?
    • 找不到已建立的粉絲專頁
    • 如何回到真人回話模式?(LINE)
    • 下載、上傳機器人
    • 如何切換語言(中、英文)
  • Creator - 名詞解釋
    • 腳本
    • 節點
    • 元件
    • 意圖
    • 訓練句
    • 抽換詞類
    • 觸發條件
    • 正規表達式
    • 選單
    • 預設回覆
    • 歡迎訊息
    • 轉接真人
    • 權限管理
Powered by GitBook
On this page
  • 功能簡介
  • 回傳參考

Was this helpful?

  1. Creator - 進階設定

應用 API 元件 - LINE

Previous應用 API 元件 - MessengerNextReferral Link - Messenger

Last updated 6 years ago

Was this helpful?

功能簡介

您可以發送多種不同 HTTP 請求方法,讓機器人解析您的伺服器回應並回覆訊息。

具體而言,您將可以執行:

  1. 創建動態訊息

  2. 執行 postbacks

  3. 取得並設定使用者參數(即將到來)

  4. 轉向其他節點(即將到來)

回傳參考

我們將解析您回傳的 JSON,以此為根據發送訊息給您的顧客。更多訊息請參考 。

發送文字

以下回應將發送文字訊息。

{
  "messages": [
    {
      "type": "text",
      "text": "歡迎使用最聰明的聊天機器人平台 —— YOCTOL.AI"
    },
    {
      "type": "text",
      "text": "您打算創建怎樣的機器人呢?"
    }
  ]
}

發送圖片

目前圖片格式支援 JPG,以下回應將發送圖片訊息。

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

發送影片

以下回應將發送影片檔案。目前 LINE 僅支援 10MB 以下、1 分鐘以內的 MP4 檔網址。

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

發送語音

以下回應將發送語音檔案;目前 LINE 僅支援 10MB 以下、1 分鐘以內的 M4A 語音檔網址。

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

發送貼圖

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

按鈕

{
  "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"
          }
        ]
      }
    }
  ]
}

另外您也可以傳送特殊按鈕,例如打開相機。

{
  "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"
          }
        ]
      }
    }
  ]
}

快速回覆

以下回應將發送快速回覆。

{
  "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"
            }
          }
        ]
      }
    }
  ]
}

以下回應將發送貼圖。目前 LINE 支援的。

以下回應將發送按鈕。您可以設定各個按鈕的動作,例如打開網站。更多關於按鈕的用法,請參考 。

LINE API 文件
貼圖清單
LINE 按鈕