0

I am trying to get realtime updates from facebook for my application as documented in https://developers.facebook.com/docs/reference/api/realtime/. I am struggling now when it comes back to the Subscription Verification. I have set up a callback server which accepts both GET and POST requests. I verified that the server works by making curl requests to it.

However, I stil get this error when attempting to create a subscription issuing the POSt request below

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

From what I read in the documentation and other threads, I assume that this means that the single GET request to my callback URL fails. The callback url does not get requested by neither GET nor POST requests indeed. I suppose that facebook is somehow blocked from accessing the endpoint. However, I am able to auth as a user using the auth dialog (https://developers.facebook.com/docs/reference/dialogs/oauth/) where I pass a callback url on the same server as well. The server runs http (for now).

This is the curl I am using to post the subscription. Host file has an entry to redirect dev.minggler.com to localhost =>( 127.0.0.1 dev.minggler.com)

curl -XPOST 'https://graph.facebook.com/256139341164822/subscriptions?callback_url=http%3A%2F%2Fdev.minggler.com%3A3000%2Ffacebook%2Frealtimeupdates&object=user&fields=friends&verify_token=abcd123&access_token=$MYTOKEN'

Can anybody help me out on this?

forste
  • 1,103
  • 3
  • 14
  • 33
  • But you have set up your callback URL to answer the first GET call used for _Subscription Verification_ in the way described in the docs, right? – CBroe Aug 23 '12 at 15:57
  • yes, I am using node.js with express. Here is the code https://gist.github.com/3438935. When I run curl -XGET 'http://dev.minggler.com:3000/facebook/realtimeupdates' I get logging as expected ("subscription verification called", etc.) – forste Aug 23 '12 at 17:23
  • My question was, does your script __answer__ the verification call in the expected way? – CBroe Aug 24 '12 at 08:15
  • in the code posted above it doesn't since it only return the string 'challenge'. However, I tested it with returning the challenge as described in the documentation and that didn't work either. The endpoint/my script does not even called, so I don't think that's the problem – forste Aug 24 '12 at 11:28
  • 2
    And your server is publicly reachable on the internet under the address `dev.minggler.com:3000`? – CBroe Aug 24 '12 at 12:05

1 Answers1

0

finally found the problem. the server wasn't reachable from outside. resolving it solved the problem

forste
  • 1,103
  • 3
  • 14
  • 33