如何让line api bot按钮连接到数据库?

时间:2017-08-08 14:41:31

标签: php api

我正在使用line api创建一个行机器人。我做了按钮,它的成功,但我想,如果有人点击按钮,它将插入/更新值数据库

以下是api的例子(https://devdocs.line.me/en/#template-messages

{
  "type": "template",
  "altText": "this is a buttons template",
  "template": {
      "type": "buttons",
      "thumbnailImageUrl": "https://example.com/bot/images/image.jpg",
      "title": "Menu",
      "text": "Please select",
      "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"
          }
      ]
  }
}

帮帮我?

0 个答案:

没有答案