Skip to content

Instantly share code, notes, and snippets.

@mag5323
Last active September 29, 2017 02:05
Show Gist options
  • Save mag5323/8a8660c678829ba42f40ffe7d0e15410 to your computer and use it in GitHub Desktop.
Save mag5323/8a8660c678829ba42f40ffe7d0e15410 to your computer and use it in GitHub Desktop.

運作分幾大類(auto reply、小精靈、按鈕、Filter text)

Ref

  1. https://www.slideshare.net/how2945ard/messenger-platform-api
  2. https://blog.arvinh.info/2016/04/17/%E8%B6%85%E7%B0%A1%E6%98%93-Messenger-API-%E5%88%9D%E6%8E%A2/

Chatfuel call api

  • 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

  1. http://docs.chatfuel.com/plugins/plugin-documentation/json-api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment