Where is the documentation about facebook requests and responses?

I think I’m loosing my mind, since it can’t be that the simplest thing can not be found.

Is there no place online that document all the types of requests I can make with facebook.request() and exactly what is returned in reply?

Yes, I’ve seen facebook.request(“me/friends”), and simple enough, but where is the information about how to request specific information about specific friend? how to request information for a list of specific friends? how to request my own information??? I need my own user id after I login to facebook to save in my db after I register to my app (for example), where is that id visible? and if it’s not, how to I request it?

If this information is available somewhere online, it would seem my searching skill is not what it used to be, can anyone point me in the right direction??

Hi there,

The documentation you’re looking for is for Facebook’s Graph API.  Have a look here: https://developers.facebook.com/docs/getting-started/graphapi/ to get started.  I’ve also found the Graph API Explorer tool (https://developers.facebook.com/tools/explorer/) to be a very useful way to get familiar with possible requests you can make and the output you get.

For your question about getting your own facebook user ID, you’d be able to get that using facebook.request(“me”).

Hope this helps.

  • Andrew

Thanks Andrew, I found my problem with my information, I was treating it the same as “me/friends”, looking for an array called “data”, where the “me” request returns my information as a first level array. I hate it I can’t test facebook stuff in the simulator, on the device debugging options are so limited…

No problem, I actually made the same mistake with “me” versus “me/friends”.  The Graph API Explorer was quite helpful though, because you can test graph queries and see the results exactly as your app will receive them.

I agree it’d be handy to have the facebook APIs work in the simulator.  But to avoid building for the device all the time, what I do is detect whether the app is running in the simulator, and if it is, instead of calling the facebook API, I just call my facebook callback function with spoofed results (which I take from the Graph API Explorer).  That way I can still test in the simulator that the user flow is working correctly and that I’m processing the results correctly.

  • Andrew

There is a library in the community code area called lib_facebook that lets you sort of test in the simulator. It’s not perfect but it helps. It uses our Facebook API calls on device but makes its own REST calls in the simulator. It’s not ours so no warranties expressed or Implied. Your mileage may vary.

Yep, that is what I do as well, but at some point simulated results are not enough.

Thanks Rob, I’ve read it, and gave it a go a couple of projects ago, I don’t remember why, but I didn’t end up using it, I guess that for what I needed, the simulated results are good enough.

Hi there,

The documentation you’re looking for is for Facebook’s Graph API.  Have a look here: https://developers.facebook.com/docs/getting-started/graphapi/ to get started.  I’ve also found the Graph API Explorer tool (https://developers.facebook.com/tools/explorer/) to be a very useful way to get familiar with possible requests you can make and the output you get.

For your question about getting your own facebook user ID, you’d be able to get that using facebook.request(“me”).

Hope this helps.

  • Andrew

Thanks Andrew, I found my problem with my information, I was treating it the same as “me/friends”, looking for an array called “data”, where the “me” request returns my information as a first level array. I hate it I can’t test facebook stuff in the simulator, on the device debugging options are so limited…

No problem, I actually made the same mistake with “me” versus “me/friends”.  The Graph API Explorer was quite helpful though, because you can test graph queries and see the results exactly as your app will receive them.

I agree it’d be handy to have the facebook APIs work in the simulator.  But to avoid building for the device all the time, what I do is detect whether the app is running in the simulator, and if it is, instead of calling the facebook API, I just call my facebook callback function with spoofed results (which I take from the Graph API Explorer).  That way I can still test in the simulator that the user flow is working correctly and that I’m processing the results correctly.

  • Andrew

There is a library in the community code area called lib_facebook that lets you sort of test in the simulator. It’s not perfect but it helps. It uses our Facebook API calls on device but makes its own REST calls in the simulator. It’s not ours so no warranties expressed or Implied. Your mileage may vary.

Yep, that is what I do as well, but at some point simulated results are not enough.

Thanks Rob, I’ve read it, and gave it a go a couple of projects ago, I don’t remember why, but I didn’t end up using it, I guess that for what I needed, the simulated results are good enough.