Last updated
Last updated
GET
https://api.botbonnie.com/v1/api/message/history
使用者行為的紀錄類別包含 click, text, image, video, audio, file, sticker, follow, unfollow, open_url
reply 則為機器人回覆紀錄,push 為推播紀錄
reply/push 會包含的訊息種類有 text, image, video, audio, gallery (輪播訊息), imagemap (圖文訊息)
為使用者點擊按鈕時產生的事件紀錄
使用者發送文字訊息時的事件紀錄
使用者傳送圖片影片音訊檔案的類型的訊息時的事件紀錄
使用者傳送貼圖訊息時的事件紀錄
使用者追蹤官方帳號或封鎖時的事件紀錄
使用者開啟 url 時的事件紀錄
回覆文字訊息的紀錄
回覆影像/影片/音訊的訊息紀錄
回覆圖文訊息的紀錄
回覆輪播訊息的紀錄
Name
Type
Description
res
Object
見 Res 物件
status
Number
HTTP Status
Name
Type
Description
messages
Array[Message]
用戶訊息資料,見 Message 物件
desc
Boolean
是否為降冪排序
Name
Type
Description
category
String
紀錄分類
type
String
紀錄類型
data
Object
訊息內容, Data 物件
timestamp
Integer
紀錄發生時間,13 碼 timestamp
operatorId
Number
回覆的操作者 ID,只有在後台即時訊息單獨回覆使用者時才會存在
senderId
Number
使用者 ID
Name
Type
Description
type
String
訊息類型
text
String
訊息文字
payload
String
訊息內容
quickReplies
Array[quickReply]
快速回復按鈕, QuickReply 物件
buttons
Array[button]
按鈕列表,Button 物件
link
String
url
cards
Array[card]
輪播卡片, Card 物件
Name
Type
Description
title
String
按鈕文字
type
String
按鈕類型
Name
Type
Description
title
String
按鈕文字
type
String
按鈕類型
Name
Type
Description
title
String
標題
subtitle
String
描述文字
imageUrl
String
圖片網址
imageClickShortUrl
String
圖片點擊的縮址 url
imageClickOrignUrl
String
圖片點擊設定的 url
buttons
Array[button]
按鈕列表, Button 物件
botId
string
機器人 ID
pageId
string
粉專 ID
platform
integer
粉專平台 facebook 填 0, line 填 1
userId
string
欲查詢的使用者ID
from
integer
13 碼 timestamp 預設為 0
to
integer
13 碼 timestamp 預設為 current timestamp
limit
integer
回傳的訊息筆數,最大 100,預設 100
desc
boolean
true 為以時間做降冪排序,預設為 true
Authorization
string
Bearer {API Token}
本教學將說明如何透過 API 來取得一個機器人下的用戶訊息紀錄。