支援的訊息格式

1.1 輪播訊息 Gallery

用於傳送可水平捲動的輪播項目,每個項目都由圖像、簡短說明及按鈕所組成,可搭配快速回覆選單。

{
"type": "gallery",
"cards": [
{
"title": "標題1",
"subtitle": "副標題2",
"imageUrl": "https://i.imgur.com/hAGm4iF.jpg"
},
{
"title": "標題2(必要)",
"subtitle": "副標題2",
"imageUrl": "https://i.imgur.com/hAGm4iF.jpg",
"buttons": [
{
"title": "按鈕1",
"type": "postback",
"value": "module-ry49xXQU2"
},
{
"title": "按鈕2",
"type": "web_url",
"value": "http://google.com"
}
]
}
],
"quickReplies": [
{
"payload": "module-HkI2FKv84e",
"title": "瞭解更多 Bonnie",
"type": "text"
}
]
}

1.2 圖像訊息 Image

由單張圖像組成,支援的格式為 jpg、png 和 gif,可搭配快速回覆選單。(不支援按鈕)

{
"type": "image",
"imageUrl": "https://i.imgur.com/hAGm4iF.jpg",
"quickReplies": [
{
"payload": "module-Sk2zR5LGg",
"title": "快速回覆1",
"type": "text"
}
]
}

1.3 文字訊息 Text

由純文字組成,文字長度最多 320 字元,可搭配按鈕或快速回覆選單。

{
"type": "text",
"text": "文字描述",
"buttons": [
{
"title": "按鈕1",
"type": "postback",
"value": "module-ry49xXQU2"
},
{
"title": "按鈕2",
"type": "web_url",
"value": "http://google.com"
}
],
"quickReplies": [
{
"title": "快速回覆1",
"type": "text",
"payload": "module-SkHJnEqZl"
},
{
"title": "快速回覆2",
"type": "text",
"payload": "module-KkHJaEqZl"
}
]
}

1.4 影片訊息 Video

由影片組成,支援的格式為 mp4,可搭配快速回覆選單。

{
"type": "video",
"videoUrl": "https://d1dh985a59yv80.cloudfront.net/video/WK_30s.mp4",
"quickReplies": [
{
"payload": "module-Sk2zR5LGg",
"title": "快速回覆1",
"type": "text"
}
]
}

1.5 語音訊息 Audio

由音訊組成,支援的格式為 mp3,可搭配快速回覆選單。

{
"type": "audio",
"audioUrl": "https://d1dh985a59yv80.cloudfront.net/audio/sodagreen.mp3",
"quickReplies": [
{
"payload": "module-Sk2zR5LGg",
"title": "快速回覆1",
"type": "text"
}
]
}

1.6 媒體訊息 Media

目前僅支援 Facebook Messenger。 可支援圖片/影片訊息,可以選用一個按鈕與快速回覆。

Facebook URL

媒體種類

媒體來源

URL 格式

Video

Facebook 粉絲頁

https://business.facebook.com/<PAGE_NAME>/videos/<NUMERIC_ID>

Video

Facebook 帳號

https://www.facebook.com/<USERNAME>/videos/<NUMERIC_ID>/

Image

Facebook 粉絲頁

https://business.facebook.com/<PAGE_NAME>/photos/<NUMERIC_ID>

Image

Facebook 帳號

https://www.facebook.com/photo.php?fbid=<NUMERIC_ID>

{
"type": "media",
"mediaType": "<image|video>",
"url": "<FACEBOOK_URL>",
"buttons": [
{
"title": "唯一的按鈕",
"type": "postback",
"value": "module-ry49xXQU2"
}
]
}