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

dmulter
  • 2,608
  • 3
  • 15
  • 24
delsanic
  • 777
  • 1
  • 5
  • 14

3 Answers3

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

Suhas
  • 7,919
  • 5
  • 34
  • 54
sabrina
  • 1,567
  • 2
  • 12
  • 15
  • 6
    Ah at last I found it. Thanks for your answer. This should be the correct answer. – moshfiqur Jun 18 '16 at 09:56
  • 1
    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 save – Chetan May 01 '17 at 10:58
  • How long does the change take to be in effect? I changed it and keep getting a reply from the old server. – Fernando André May 30 '17 at 19:08
  • @FernandoAndré How long did it take? I've been waiting for 15h, and it's always linking with the old webhooks. – Neabfi Nov 14 '17 at 14:28
  • @Neabfi just put ur app in development mode and publish again..this works for me :) – Kishan Oza Mar 06 '18 at 11:30
  • Nice gem!! Saved me a lot of time! – jhnferraris Mar 19 '18 at 13:35
  • 3
    I don't have 'Page' as an option. – Matt Mar 25 '18 at 01:22
  • 1
    @Matt : 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: https://developers.facebook.com/docs/graph-api/reference/app/subscriptions). Before you can do this, you need to generate an application access token first: https://developers.facebook.com/docs/facebook-login/access-tokens#apptokens – Christophe Geers Mar 26 '18 at 07:30
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.

Chen-Tsu Lin
  • 22,876
  • 16
  • 53
  • 63
3

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

enter image description here

fritak
  • 191
  • 3