postman 使用Freshchat自定义应用程序发送WhatsApp模板

az31mfrm  于 2024-01-07  发布在  Postman
关注(0)|答案(1)|浏览(331)

我在Freshchat中创建了一个自定义应用程序来发送WhatsApp模板,并遇到了上述错误,它在Postman中正常工作。

  1. <html>
  2. <head><title>405 Not Allowed</title></head>
  3. <body>
  4. <center><h1>405 Not Allowed</h1></center>
  5. <hr><center>nginx</center>
  6. </body>
  7. </html>

字符串
12月:
文本
请求代码:

  1. {
  2. "send_msg":{
  3. "schema":{
  4. "method":"POST",
  5. "host":"api.freshchat.com",
  6. "path":"/api/v2/outbound-messages/whatsapp",
  7. "headers": {
  8. "Authorization": "Bearer xxxxxxxxx",
  9. "Content-Type": "application/json"
  10. }
  11. }
  12. }
  13. }


感谢您的善意支持,以完成它,并删 debugging 误,并发送messsage。
我要正确的密码。

bvhaajcl

bvhaajcl1#

如果你想在ruby中使用,你可以使用这个gem https://rubygems.org/gems/freshchat_whatsapp
如果你想使用curl,你可以使用

  1. curl --location 'https://example.freshchat.com/v2/outbound-messages/whatsapp' \
  2. --header 'accept: application/json' \
  3. --header 'Authorization: Bearer token' \
  4. --header 'Content-Type: application/json' \
  5. --data '{
  6. '\''from'\'': {
  7. '\''phone_number'\'': '\''+919198XXXXXXXX'\''
  8. },
  9. '\''to'\'': [
  10. {
  11. '\''phone_number'\'': '\''+9198XXXXXXXX'\''
  12. }
  13. ],
  14. '\''data'\'': {
  15. '\''message_template'\'': {
  16. '\''storage'\'': '\''conversation'\'',
  17. '\''namespace'\'': '\''namespace'\'',
  18. '\''template_name'\'': '\''corporate_sales_client_phone_number_verification'\'',
  19. '\''language'\'': {
  20. '\''policy'\'': '\''deterministic'\'',
  21. '\''code'\'': '\''en'\''
  22. },
  23. '\''rich_template_data'\'': {
  24. '\''button'\'': {
  25. '\''subType'\'': '\''url'\'',
  26. '\''params'\'': [
  27. {
  28. '\''data'\'': '\''/en/testing2123123$#'\''
  29. }
  30. ]
  31. },
  32. '\''body'\'': {
  33. '\''params'\'': [
  34. {
  35. '\''data'\'': '\''Test data'\''
  36. }
  37. ]
  38. }
  39. }
  40. }
  41. }
  42. }'

字符串

展开查看全部

相关问题