How do I change facebook messenger bot webhook?
Asked Answered
R

3

51

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?

enter image description here

Richma answered 18/4, 2016 at 3:55 Comment(0)
E
126

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. enter image description here

Engrain answered 16/6, 2016 at 8:18 Comment(8)
Ah at last I found it. Thanks for your answer. This should be the correct answer.Impaste
When you click the webhooks as shown above, you will see a edit subscription button, click on it and you will be shown with screen where you can edit your parameters and then click verify and saveThessalonians
How long does the change take to be in effect? I changed it and keep getting a reply from the old server.Dylandylana
@FernandoAndré How long did it take? I've been waiting for 15h, and it's always linking with the old webhooks.Prepense
@Prepense just put ur app in development mode and publish again..this works for me :)Sletten
Nice gem!! Saved me a lot of time!Postpone
I don't have 'Page' as an option.Diagnostician
@Diagnostician : same here, it was there before, but disappeared somewhere last week. Changed it manually by doing a POST request to the subscriptions (More information here: developers.facebook.com/docs/graph-api/reference/app/…). Before you can do this, you need to generate an application access token first: developers.facebook.com/docs/facebook-login/…Emmery
I
4

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.

Iridotomy answered 18/3, 2018 at 16:23 Comment(0)
A
3

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

enter image description here

Arnulfo answered 18/4, 2016 at 7:47 Comment(2)
Can't find that menu. Did someone find a solution to change webhook's url?Engrain
goto this url : developers.facebook.com/apps/558392797857560/messenger/settingsSletten

© 2022 - 2024 — McMap. All rights reserved.