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?
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.
You can change webhook under "webhooks" in menu (picture).
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.