Giter Site home page Giter Site logo

fbsamples / graph-api-webhooks-samples Goto Github PK

View Code? Open in Web Editor NEW
221.0 221.0 442.0 47 KB

These are sample clients for Facebook's Graph API Webhooks and Instagram's Real-time Photo Updates API.

Home Page: https://developers.facebook.com/docs/graph-api/webhooks

License: Other

CoffeeScript 59.96% JavaScript 40.04%

graph-api-webhooks-samples's People

Contributors

adamgross42 avatar anuishark avatar bedfordsean avatar kilenaitor avatar mduppes avatar msufa avatar zardra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graph-api-webhooks-samples's Issues

MiddleWare problem

When i deploy the cloud code on parse server i get the following error on log:
Error: Most middleware (like bodyParser) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
at Function.Object.defineProperty.get (/usr/src/app/node_modules/express/lib/express.js:99:13)
at Object. (/usr/src/app/data/cloud/main.js:12:16)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/usr/src/app/cloudCodeWrapper.js:4:20)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at new ParseServer (/usr/src/app/node_modules/parse-server/lib/ParseServer.js:365:9)

No Message provided

I get 'No Message provided' when the webhook is called from the Facebook App. (on line 'console.log(req.body);'
main.txt

.

Warning - request header X-Hub-Signature not present or invalid

Using the heroku example results in the issue even though req.headers reveal the following:
'x-hub-signature': 'sha1=XXXXXXXXXXXXXXXXXXXXXXXXXX'

I might however have found the issue:

app.use(bodyParser.json());
app.use(xhub({ algorithm: 'sha1', secret: process.env.APP_SECRET }));

Should be like this according to Express X-Hub README:

app.use(xhub({ algorithm: 'sha1', secret: process.env.APP_SECRET }));
app.use(bodyParser.json());

Because the README specifies that it should be added before bodyParser:

Then add the middleware to Express.js. It needs to be one of the first and before bodyParser().

Bad request

Followed the guide and got following error from facebook webhook validation: The URL couldn't be validated. Callback verification failed with the following errors: HTTP Status Code = 400; HTTP Message = Bad Request
I've deployed using heroku. Any idea?

PHP example

Hi,

am looking for , PHP example for real time updates on my Facebook insights page changes(likes , feed, feedComments)

Call back URL gives 404 error

I have created a Web app in Azure using the node js code provided in this repository. My web app is unable to process the GET request from Facebook. It is giving me the below error message.

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

In the logs I can see that I am getting the below error:

2019-04-09 05:19:41 TEST-INSTAAPP GET /facebook hub.mode=subscribe&hub.challenge=1608055879&hub.verify_token=abcdefg12345&X-ARR-LOG-ID=74a3c3bb-390f-4de0-8e4d-700f576993b6 443 - 66.220.149.37 facebookplatform/1.0+(+http://developers.facebook.com) - - test-instaapp.azurewebsites.net 404 0 2 419 1106 15

Can anyone please advice me on how to resolve this issue?

Problems with POST requests on Heroku

Hi,
I created a subscription to my Heroku instance and i manage to receive POST requests, but when i check up the logs in the server i see there is a failure on the server:
2017-03-10T17:01:34.134333+00:00 app[web.1]: Facebook request body: 2017-03-10T17:01:34.134352+00:00 app[web.1]: request header X-Hub-Signature found, validating 2017-03-10T17:01:34.135641+00:00 app[web.1]: Error: No Secret Found 2017-03-10T17:01:34.135643+00:00 app[web.1]: at Signature.isValid (/app/node_modules/express-x-hub/lib/signature.js:20:30) 2017-03-10T17:01:34.135644+00:00 app[web.1]: at IncomingMessage.req.isXHubValid (/app/node_modules/express-x-hub/lib/signature.js:15:16) 2017-03-10T17:01:34.135645+00:00 app[web.1]: at /app/heroku/index.js:41:13 2017-03-10T17:01:34.135645+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) 2017-03-10T17:01:34.135646+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:131:13) 2017-03-10T17:01:34.135647+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3) 2017-03-10T17:01:34.135648+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) 2017-03-10T17:01:34.135648+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:277:22 2017-03-10T17:01:34.135649+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:330:12) 2017-03-10T17:01:34.135650+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:271:10) 2017-03-10T17:01:34.126719+00:00 heroku[router]: at=info method=POST path="/facebook" host=xxx.herokuapp.com request_id=xxxxxxxxxxxxxxxxxxxxxxxxxxx fwd="31.13.98.112" dyno=web.1 connect=0ms service=2ms status=500 bytes=232 protocol=https

Empty entry on Parse

When a new post is published by Page I get like an empty array from Page-Feed webhook subscribed.
On console I see:

Facebook request body:
{"entry":[{}],"object":"page"}

Callback endpoint is on Parse. Im using the example here.

How to validate the facebook app

I have done everything but facebook does'nt allow me to publish the app to live cuz they can see where i m requesting my facebook token cuz its a server side integration/

any help?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.