sku*_*erk 1 facebook facebook-messenger-bot
我正在尝试在我的messenger机器人中实现购买按钮,但是得到这两个错误:
{"error":{"message":"(#-1) Send API unexpected internal error","type":"OAuthException","code":-1,"error_subcode":2018012,"fbtrace_id":"BN47MpNqWNN"}}
{"error":{"message":"(#100) Invalid button type","type":"OAuthException","code":100,"error_subcode":2018037,"fbtrace_id":"Agfk\/h+cEta"}}
Run Code Online (Sandbox Code Playgroud)
任何想法可能是什么问题?我在哪里可以查找这些错误代码?这是我发送给Facebook的Messenger API的消息:
{'message': {'attachment': {'type': 'template', 'payload': {'text': 'Please checkout.', 'template_type': 'button', 'buttons': [{'payment_summary': {'merchant_name': "Peter's Apparel", 'currency': 'USD', 'payment_type': 'FIXED_AMOUNT', 'price_list': [{'amount': '29.99', 'label': 'Subtotal'}, {'amount': '2.47', 'label': 'Taxes'}], 'requested_user_info': ['contact_name'], 'is_test_payment': True}, 'type': 'payment', 'payload': 'DEVELOPER_DEFINED_PAYLOAD', 'title': 'buy'}, {'type': 'postback', 'payload': '{"title": "Confirm Order", "event_value": "", "event_name": "confirm_order"}', 'title': 'Confirm Order'}, {'type': 'postback', 'payload': '{"title": "Add Coupon Code", "event_value": "", "event_name": "add_coupon"}', 'title': 'Add Coupon Code'}]}}}, 'recipient': {'id': '1232211580183568'}}
Run Code Online (Sandbox Code Playgroud)
"购买按钮仅适用于通用模板和列表模板,它必须是第一个按钮."
您的模板类型是"按钮".尝试将template_type更改为generic或list.此外,请确保您可以访问付款测试计划.
参考:https://developers.facebook.com/docs/messenger-platform/send-api-reference/buy-button
| 归档时间: |
|
| 查看次数: |
484 次 |
| 最近记录: |