How do I change facebook messenger bot webhook?

只愿长相守 提交于 2019-12-04 14:55:54

问题


I have successfully implemented a facebook bot. It's working fine. I was trying to change the webhook url now as I have to port it to a different server with a new domain.

There is an option to change the events but I could not find and option to change the webhook. How do I change it?


回答1:


You can't edit the link directy from the "Messenger" product. On the left menu, after selecting your application, you have to click "+ add product" and add also webhooks. From webhooks then you can edit also messenger's webhook.

To edit the webhook, click on Edit Subscription button on the page. Make sure that the dropdown at the top has the option Page selected.




回答2:


You can change webhook under "webhooks" in menu (picture).




回答3:


Besides setting from UI, you can also use subscriptions API to achieve this:

Docs: https://developers.facebook.com/docs/graph-api/reference/app/subscriptions

For example:

POST /v2.12/{app-id}/subscriptions HTTP/1.1
Host: graph.facebook.com

object=page&callback_url=http%3A%2F%2Fexample.com%2Fcallback%2F&fields=about%2C+picture&include_values=true&verify_token=thisisaverifystring

callback_url is what you want to change. Make sure you have correct field and verify_token setting too.



来源:https://stackoverflow.com/questions/36685220/how-do-i-change-facebook-messenger-bot-webhook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!