Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Facebook FQL error in Node.js HTTPS GET

Facebook FQL error in Node.js HTTPS GET

Problem

I'm using node.js to get the facebook friends of a logged in user with a valid facebook AccessToken.

I'm using the node.js https module, to do that with this options:

var query = 'q=SELECT uid, name, is_app_user FROM user WHERE uid IN (SELECT uid1 FROM friend WHERE uid2=me()) and is_app_user=1';
var options = {
    host: 'graph.facebook.com',
    port: 443,
    path: 'fql?' + encodeURI(query) + '&method=GET&metadata=true&format=json&access_token=' + accessToken
};

sometimes I can get the data with my friends, but sometime i'm getting an error message from facebook that said Invalid URL.

My facebook application is in Sandbox mode and my server ip is in application whitelist

Any ideas why this is happens?

Thanks!

Problem courtesy of: udidu

Solution

Problem solved.

I changed the path: 'fql?'... to path: '/fql?'... with the / at the beginning..

Solution courtesy of: udidu

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Facebook FQL error in Node.js HTTPS GET

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×