- FB Developer Page
- FB API explore
- FB API auto reply (只有粉絲團有這個功能)
- Graph API (私訊回覆使用者, 只能回覆一次)
- https://developers.facebook.com/docs/graph-api/reference/v2.10/page/feed
- Get
119604345416731/feed
取得所有文章 (上限 100 篇) - POST
119604345416731/feed
發文- message = 'Post testing'
- 加入
scheduled_publish_time
(unix timestamp) &published
= false 設定排程發文
- Messenger Platform - 聊天機器人
- Quick start - https://developers.facebook.com/docs/messenger-platform/getting-started/quick-start
- webhook url 需要 ssl
- Quick replies - 按鈕回覆 (透過 payload 傳回字串給 webhook)
- Message Attachment 傳檔案
- https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes
- 可傳 Text, Audio, Image, Video, File 給使用者 (by setting content-type)
- Webview userId - 取得使用者資訊 (first name, last name)
- Quick start - https://developers.facebook.com/docs/messenger-platform/getting-started/quick-start
Ref
- https://www.slideshare.net/how2945ard/messenger-platform-api
- https://blog.arvinh.info/2016/04/17/%E8%B6%85%E7%B0%A1%E6%98%93-Messenger-API-%E5%88%9D%E6%8E%A2/
- Blocks -> JSON API
- [GET] /home/mag5323/public_html/try.php
- GET 欄位 = user attribute. e.g. $_GET['last_user_freeform_input'], $_GET['first_name']
- Response json with format like this:
$msg = [ 'meesages' => [ 'text' => 'Hi, ' . $_GET['first_name'], 'text' => 'You just said ' . $_GET['last_user_freeform_input'], ], ]; echo json_encode($msg);
Ref