Facebook FQL does not find photo privacy for photos on wall album - facebook-fql

I am trying to get the privacy values (from privacy table) for photos that are on the Wall Album. For photos on a Wall album, the privacy can be set independently for each photo (which is not the case for other albums).
The following query returns empty for all wall photos:
select id, value from privacy where id=<photo_id_here>
Does anyone else have this problem? I have been granted all permissions before trying this query on Graph API Explorer.

hope you follow your post..
use the object_id instead of pid and id. its done

Related

How to get Facebook images in which my friend is tagged

I am developing a web application using Java. I need to access my friends photos and need to select the photo in which he is tagged. ( i.e ) His face should be there in that photo.
How to do it with Facebook Api's? I have searched and got few SO posts for taking profile picture of friends like this link1 link2, but I couldn't get anything related to accessing friends photos and getting their images in which they are tagged/ friends face is available.
Can someone help me out on how to accomplish the above case?
See https://developers.facebook.com/docs/reference/fql/photo_tag/
To get links you have to run query like
select link from photo where object_id in
(select object_id from photo_tag where subject=me())
Of courset instead of me() you have to write your friend id.
Note, that
To read the photo_tag table you need the following permissions:
User:
user_photos permissions to access photo tag information that a user is tagged in.
friends_photos permissions to access photo tag information that a friend is tagged in.
BTW you will receive photos on which the person is tagged, but these photos may contain no real image of person.

Facebook Graph API returns question mark picture, post picture is visible on post page directly

I am working on Facebook Canvas application.
Application purpose is to access to user's accounts, collect posts and preview them posts are photo type.
It also allows same user to see other user's posts.
If user is looking other users' posts, preview on some of posts is question mark picture instead of image in post. If user opens post directly to post Facebook page, picture is visible.
I am using Graph API to retrieve pictures from posts for preview.
Current syntax is
https://graph.facebook.com/<OBJECT_ID>/picture?type=normal&access_token=<ACCESS_TOKEN>
I tried to use page access token as well long living user access token.
In both cases I got question mark picture.
My questions are:
Why is it not possible to see real image through application when user gave permissions to pictures?
Is it possible to detect if image is question mark picture?
EDIT
I use OBJECT_ID, not post ID. Preview is for photo posts. object_id in post is picture id, which can be used in pictures Graph API.
EDIT 2
Only Graph API must be used, nothing else.
EDIT 3
These are permissions that are requested from user: "email", "user_photos", "manage_pages", "read_stream", "read_insights", "user_hometown", "user_location", "user_birthday".
get needed permissions (user_photos & friends_photos)
if you want to get users pics(or friends) try fql its much better in my opinion
https://developers.facebook.com/docs/reference/fql/
or graph api & dont forget to get needed permissions
here are two fql examples
SELECT src_big FROM photo WHERE aid IN ( SELECT aid FROM album WHERE owner IN (SELECT uid2 FROM friend WHERE uid1=me()) AND modified_major > 1349374365) ORDER BY created DESC
SELECT src_big FROM photo WHERE owner IN (SELECT uid2 FROM friend WHERE uid1= 100001785452297 ORDER BY rand() LIMIT 0,20 ) ORDER BY created DESC
at last i recommend you to use facebook sdk for your programming language

Using the Facebook Graphi API, how can I retrieve paginated photos in which my friends are tagged from a specific album?

I want to show the photos of an album in my app. Using the graph API i am able to filter and page by month, like below, which is great. I loop trough the results and get the photo for each id. Best of all, the GRAPH API also gives me a 'next' and 'previous' paging link. Very useful.
http://graph.facebook.com/[photo-album-id]/photos/?fields=id&limit=6&since=last month
But now i want to retrieve only those ids filter in two ways:
Only retrieve those in which the user is tagged
Only retrieve those in which the user & his/her friends are tagged.
I couldn't find any way to do this, with the graph API. Is there an alternative via FQL, that still has the paging in there?
Last alternative I can think of is program is in FQL, and do the paging myself.
p.s. I am doing this in Javascript currently.
You can retrieve photos the current user is tagged in in a specific album with this FQL call:
select object_id, src, album_object_id from photo where pid in (select pid from photo_tag where subject=me()) and and album_object_id=somenumber
To retrieve photos in which the user's friends are tagged, for a specific album:
select object_id, src, album_object_id from photo where pid in (select pid from photo_tag where subject in (select uid2 FROM friend WHERE uid1 = me())) and album_object_id=somenumber
As far as I know these results will not be paginated. For a detailed take on how to paginate fb queries see the Facebook Developer Blog: How-To: Paging with the Graph API and FQL
After a little play with the Graph Explorer (https://developers.facebook.com/tools/explorer/) I come up with this solution. You can make a call to Graph API as follows
/me?fields=friends.limit(5).fields(photos.limit(5))
The first limit is for how many friends you want to get and the second limit is how many photos you want from each friend.
At the end of the data there already is the next page URL.
I only tested on the explorer but should work.
Hope that helps,
Doruk

Fql, fetching "photos of me"

In my facebook page, when someone who's not the admin posts a photo, it goes into an album called "photos of me" that is different from other albums made by me.
It has no 'aid'... its url is:
http://www.facebook.com/photo.php?fbid=1760432628996&set=o.373236069382570&type=1&permPage=1
Photos are public, you can see them even if you're not registered on facebook.
I'm able to fetch photos in other albums of my page using this FQL:
SELECT pid, src, caption FROM photo WHERE aid = 'MY_ALBUM_ID' ORDER BY created DESC
But I can't fetch photos in "photos of me" album because there's not 'aid'. I tried to query the stream but I got only pictures I posted on my wall.
Could someone paste me the correct FQL to fetch photos on the album above?
These are photos you've been tagged in, so they aren't your photos. That's why they don't show up in any of your albums.
This query gets them:
SELECT pid, object_id, src, caption FROM photo WHERE object_id IN
(SELECT object_id FROM photo_tag WHERE subject='373236069382570')
According to the developer reference, FB prefers object_id to pid now. You might want to work with object_ids to prevent breaking your code if FB deprecates pid.

How can I get all the photo uploaded by user using Facebook Graph API?

I've read all of the Graph API document but nowhere mention to the photo uploaded by user.
I've found that for video uploaded by user, I can use: https://graph.facebook.com/me/videos/uploaded
But what about photo? Is it possible?
Thanks, and sorry for my bad English (cause English is not my native language :) )
I'm not sure how you couldn't find it.
Anyway you need to query two tables to get what you want, the album and photo FQL tables:
SELECT pid
FROM photo
WHERE aid IN (
SELECT aid
FROM album
WHERE owner=me()
)
You can get whatever you want from the photo table obviously. Also you may change me() to a user id.
I suppose that you need the user_photos or friends_photos permissions depending on your needs.