Get the name of the album from a tagged photo using Graph API - facebook

I am able to grab album name and photos uploaded by the user using the graph api.
When I use "https://graph.facebook.com/me/photos?access_token=".$access_token", I get all the tagged photos of the user. Is there a way to get the name of the album of a photo, which has not been uploaded by the user but by his friend?
Thanks

I don't think you can get that directly, but using the "link" attribute you can quickly suss it out, as seen in this example:
"link": "http://www.facebook.com/photo.php?fbid=10150154222339657&set=a.358879884656.199726.249427954656&type=1"
That set parameter and fbid tell you much more about the photo.
You can view more details about the photo by going to the page for it. It will tell you the position in the album, though it still won't have the album:
http://graph.facebook.com/10150154222339657
You can however determine the album id from the set parameter, the album id is the between the a. and the second ., so in this example the album id is 358879884656
So, the album info would be available at:
http://graph.facebook.com/358879884656

Related

Link between current profile picture and the original photo in the profile album

I want to have a link between the currently used profile picture and the original source in the profile album.
I'm getting the profile picture with:
/me/picture?redirect=false
Which will return url, width & height but unfortunately no id. (https://developers.facebook.com/docs/graph-api/reference/profile-picture-source/)
I'm getting all the albums with:
/me/albums?fields=id,type
Then I'm iterating through all the albums to find the one with the type=='profile' and then retrieve all the photos of this album:
/{albumId}/photos?fields=width,height,id,images
How can I identify the photo used as the profile picture?
Since we have no id returned from the /me/picture endpoint I don't see a way to make the link between the two objects.
Also, I'm not sure that we can rely on CDN urls to parse them and try to find the profile picture id.

FB Photo Application and Album creation linkage

I have a sample application that uploads photos to a user's FB account. Of course, FB creates an album with the name of the app and loads the photos in that album.
If the user changes the name of the album, then FB still uploads photos to the same album (although the album has been renamed).
How does FB know which album belongs to my application? There are no obvious signs of linkage between my appid and the album ids / links that FB creates for the album.
Thanks in advance.
SS
There's likely an association on the backend between the AppID and the AlbumID.
There's no simple way to know your app albumID.
Three suggestions for you:
Allow the user to choose the album to upload the photo to. You can do this by uploading to albumid/photos instead of me/photos.
If you want to know your album, once you have uploaded one photo, you can use the returned ID along with FQL to query the photo table. This works independently of album and will let you query on object_id and return the album object id. e.g., SELECT album_object_id from photo where object_id = '(yourobjectid)' Store this, it won't change.
Upload a tiny test photo and use the method from 2 above. This will let you know your current album id. Then delete the tiny test photo.
Hope this helps.

Facebook Graph API wont return photo source for photos uploaded by apps

When getting the "me/home" stream there is a difference between the photo objects i get in return. Some of them are returned with the source field (URL to the actual picture) and some not.
After investigating i learned that for photos uploaded to Facebook using the website itself there is the source and images fields in the object,
But for photos uploaded to Facebook by some kind of app (has the "application" field) there are no source/images fields, only a "link" field which direct me to the photo page (whole page, not just the photo)
Does that means i cant get the actual picture file for pics uploaded by apps ? am i missing something?
Update: The photos without the source field are "public".
You can use FQL to get very detailed information about the photo
SELECT src_big FROM photo WHERE pid='{photoId}'
For more information on what you can get from the FQL table see: http://developers.facebook.com/docs/reference/fql/photo/
Note: the quotes around the photo id is required as it is a string value

How to get cover photo of album and photos of the album using FBGraph Api

I am working with FBGraphAPI in my project. I managed to get the list of albums. I tried to get picutre (cover_photo) and photos in albums. But somehow i stuck in it.
Which inbuilt method i need to use to get cover_photo and photos in the album? And how to use it?
To get the cover_photo, you need to use
https://graph.facebook.com/<id>/picture?type=album&access_token=<token>
where id is the cover_photo from your album returned in the album list.
and token is your current session token
Note. It needs to be https and you need to specify the token. This is what makes it different than, for example, rendering a user's photo.
By photos in album, not sure if you mean the list of photos or the actual photo itself?
The basic process is to use the id of the album returned and then call
https://graph.facebook.com/<id>/photos
This will return a list of photos in the album.
Within this list will be 'source' which contains the url of the photo.
Also a dictionary of different photo resolutions.

Use graph.facebook.com to get URL's and Names of Photos

I need to get the URL's and names of the Photos contained in a Facebook Photo Album.
I know this is possible through graph.facebook.com but I don't know where to find the ID of an Album.
As an example you can use this Album: http://www.facebook.com/media/set/?set=a.210725979538.130908.69116329538
Which one of the Numbers is the Album ID? And How do I get the Photo URL's with name??
Thank you in advance.
Just get the /albums relationship. For your example:
http://developers.facebook.com/tools/explorer/?method=GET&path=thebeatles%2Falbums
Then use 10150213069439539/photos to get the photos of the first album (or any other album you want, just change the id based on what you got from /albums).
I suggest you to read the whole Graph API Core Concepts page and trying its examples.
And also read the album and photo documentation.