【发布时间】:2022-06-14 05:08:27
【问题描述】:
您好,我想在我的网络应用程序中使用 WhatsApp 业务 API。我在邮递员中测试过。
只要在 WhatsApp 选项卡下的 Facebook 业务页面中运行示例 curl 代码, 它使用 Facebook 保存的模板将临时访问令牌和消息传递给收件人成功运行。 但是,当我只向收件人发送短信时,API 响应会通过消息 ID 成功,但消息尚未发送给收件人。
下面给出了我的 curl 代码示例
curl --location --request POST 'https://graph.facebook.com/v13.0/106433498743301/messages' \ --header 'Authorization: Bearer EAAOw8oNtvXkBAKk89CqJtyusjxk7c7qGSNS0quxqeZBRtjE5MYwZCK0USeGGLV4n56qNAuaRoRWZA2oCIS8zcz6U5UZAtQCOb6YQnjuXZBfLnyZAwsOZBpASpnNOvvz29T0Jn0aXgZAdo9VKmBv0CkNYuOeb1I7X0GZCEwLHPZBFpfOCj4K3S9CMPjBfYR5Jog06LC95P7UgCr5Fy2nqbRM5Ys' \ --header 'Content-Type: application/json' \ --data-raw '{ "messaging_product": "whatsapp", "preview_url": false, "recipient_type": "individual", "to": "xxxxxxx150", "type": "text", "text": { "body": "Test message" } }'
【问题讨论】:
标签: php curl facebook-graph-api whatsapp