kubido
kubido

Reputation: 568

Facebook graph real-time updates, verify callback_url on local

In my development enviroment (localhost of course). Based on this documentation I've sucessfully created a apps token with this:

https://graph.facebook.com/oauth/access_token?client_id=<app-id>&client_secret=<app-secret>&grant_type=client_credentials

then make post request to verify my callback_url to FB graph, like this

https://graph.facebook.com/<app-id>/subscriptions?access_token=my_apps_access_token=user&fields=first_name&callback_url=http://localhost:3000&verify_token=mystringtoken

but it's always return :

 {"error":{"message":"(#2200) callback verification failed: ","type":"OAuthException"}}

(I've try using lvh.me:3000)

Is there possible to verify the callback_url using localhost?

Upvotes: 0

Views: 1710

Answers (2)

user7543
user7543

Reputation: 25

Here is How to . I've explained the proccess.

Upvotes: 0

DMCS
DMCS

Reputation: 31860

From the API documentation:

Your callback server must handle two types of requests.

Facebook servers will make a single HTTP GET to your callback URL when you try to add or modify a subscription. After a successful subscription, Facebook servers will notify your server of changes by issuing HTTP POST requests to the same URL.

From this statement, I would presume that you must provide a publicly accessible URL.

Upvotes: 1

Related Questions