How can I get the url of the picture I just uploaded to facebook through the API?
I need the user to make it its profile picture and I want to give him a fast link to go there.
How can I get the url of the picture I just uploaded to facebook through the API?
I need the user to make it its profile picture and I want to give him a fast link to go there.
Alright, so using the Graph API you need to do this:
Here's how you do it:
First you call: https://graph.facebook.com/me/albums
Which gives you a list a list of all the albums, each album has a key called "updated_time". Loop through all the albums and compare them to see which one is the most recent one.
When you have found the most recent one you take the id of that album and call: https://graph.facebook.com/{ the album id }/photos
This will give you a list of all the photos in that album. Each photo has a key called "created_time". Use that to determine which photo is the most recently created. When you have done that you can just take the value in the key "source" which is an url to the full scale of the picture.
If you want a smaller picture there's a key called "images" which contains a list of 4 different sizes; 590x480, 221x180, 130x105 and 92x75. Each of those items in the list has the "source" key.