0

I cannot understand the FB API. I feel the problem is because I cannot understand the protocals OAouth draft page (source, page 19). Well firstly it was so but now I understand that OAouth 1.0 and OAuth 2.0 are totally different protocols although for the same goal, apparently..

Perhaps the most essential stuff are FB docs about authentication here and a blog post here. I am trying to categorize here threads to dig deeper into the FB API.

Community
  • 1
  • 1
hhh
  • 50,788
  • 62
  • 179
  • 282

2 Answers2

0

I cannot find things such as picture or friends in the Graph API -object

That’s because you didn’t ask for them …

To get a user’s friends, you have to query the /userid/friends connection.

And for the user’s picture, you can just use the address https://graph.facebook.com/userid/picture as the image src – this will redirect to the actual picture.

It’s all described here: https://developers.facebook.com/docs/reference/api/user/ under „Connections”

CBroe
  • 91,630
  • 14
  • 92
  • 150
  • The method `"https://graph.facebook.com/userid/picture"` is the TRIAL 1, working. TRIAL 2 is because FB does not like bloat so not putting everything under the FB -objecct, got that. `"/userid/friends"` is the TRIAL 3, an access-token -err, investigating. – hhh Jun 05 '12 at 22:14
  • 1
    You have to ask for the necessary permissions first, via the login method. That gives you the access token you need to proceed. Please go find same basic tutorial on this stuff somewhere – otherwise we’ll probably be discussing pure basics here to no end. – CBroe Jun 05 '12 at 22:16
0

I am trying to organize here things.

Trials and some Confusing Points with Questions

Some code here and in history. Logs in history.

  1. [solved] Trial 1 shows a cover picture from FB but not using FB API. FB -object does not store the picture URL! You need to use the POST -url.

  2. [solved] Trial 2 with /userId does not request friends (thanks to one answer) but now a new problem with authorization, solved by this answer here.

  3. [solved] Trial 3 with /userID/friends does not work due to no access-token. Solution here.

  4. [solved] how do the many inner-most FB.login here to get the access token? Moved this q here.

  5. [solved] what does the __PROTO__ mean? -Unreliable, you are not going to use it (according to the chat -msg in history).

THIRD-PARTY MATERIAL

Manuals

  1. Graph API here

  2. JS SDK here

  3. The OAuth draft paper about the webserver flow here.

  4. FB.login here

Perhaps related

  1. [URL -method] facebook graph api picture

  2. [URL -method] facebook graph api photos retrieve

  3. [URL -method] facebook graph api retrieve wall photos

  4. [PHP] How to use Facebook graph API to retrieve fan photos uploaded to wall of fan page?

  5. [PHP] Pulling in photos via Facebook Graph API

  6. [Unsolved] https://stackoverflow.com/questions/7819091/can-i-retrieve-facebook-photos-through-graph-api-that-are-only-shared-with-frien

Community
  • 1
  • 1
hhh
  • 50,788
  • 62
  • 179
  • 282