How to get Facebook photo privacy settings via GRAPH API - facebook

There is no mention of privacy for Photo object,-
https://developers.facebook.com/docs/reference/api/photo/
But its possible to get/set the same for each photo via FB website. So is it possible using GRAPH/FQL to get/set privacy settings for Photo?

For getting the value: see Lix's response.
For setting the value:
Without the column exposed via the API, it's not going to be possible to change/update its privacy. I can see this being a great bug for you to log at http://developers.facebook.com/bugs

Aside from two special albums, namely "mobile uploads" and "wall photos", photo privacy is governed by the album (same on Facebook web too so the bug request won't help here). If you post to me/photos then you are posting to an album auto created for your app. You can post to any album by posting to albumid/photos.
The good news is that you can set the album privacy for an album that you create via the Graph API. See the "albums" section on this page.

Related

Link posted by facebook graph api doesn't show title, thumbnail

I use facebook graph api to publish a link to group.
It works occasionally, many times the title, description and thumbnail won't be displayed.
But with that same link if i post by facebook, it works normally.
The link is tested with debugger tool.
Not sure any way to preload the link or guarantee all meta data will be published correctly through graph api?

Can you use Facebook Graph API to post a photo to a brand account as well as user account?

I am working on a project where a photo is taken and the user can share their photo on Facebook. We would use oAuth and the FB Graph API to post the photo and caption to the users' timeline. The client just made a request to also post it to their (the client's) photo album as well. So when the user submits a photo, it would post to the user's timeline as well as the client's timeline/album. Is this double post (to two different accounts) possible? Wouldn't that require that the client be logged in via oAuth as well? Also, are there any FB legal/regulation issues with this so long as the application has a disclaimer that it will be posted to two different places?
The entry for the user is a new photo to the apps album for that user. me/photos
However the entry that goes to your clients page... I don't think people can do id/photos of others or pages. (it's worth a shot)
You'll have to stick to id/feed and perhaps include a link to an image host.

Check Photo privacy for a user

My project is a Facebook application developed in asp.net MVC3. I want to check the privacy of a Facebook photo for a particular user.
I have Facebook userid and Facebook photo path. How can I check whether this user had permission to view this photo?
I finally found a solution for this issue. By using fql we can query all the privacy details of an object from table "privacy":
SELECT value, description FROM privacy WHERE id = 10150146071791729.
From here we can get privacy details of an fb object; please see this documentation reference.
But the one issue still exist is that I am unable to check the privacy of a fb photo whose owner is not my friend. I am still searching for that.
Found Graph API solution for getting privacy settings, but it's providing privacy settings of albums not for particular photos.
https://graph.facebook.com/me?fields=id,name,albums.fields(privacy)&access_token=ACCESS_TOKEN

Is there a way to associate the Like button with a Facebook photo or other post on Facebook.com?

If I have a Facebook photo, can I add a Facebook button in an application that when clicked inceases the likes for the photo?
The parameter for the like button is a url. What do I need to put there so when clicked, increases the like count for the photo on Facebook?
No this is not possible - it's always separate.
You could do this through graph API and make POST to <POST ID>/likes/ but the Like button plugin only works for Facebook pages or URLs off-Facebook.
It does not work with content on FAcebook.com
Via the Facebook Like Plugin, as you said is url so it will not work.
The Like Box is a social plugin that enables Facebook Page owners to attract and gain Likes from their own website.
Accoring to the documentation,
You will need to use the Facebook Graph API photo object by sending a HTTP request to photo_id/likes, where photo_id is the id of photo in question which you can also find from the photo link itself
https://www.facebook.com/photo.php?fbid=[photo_id]
You will also need to have the user grant publish_stream permissions.
You can try to use the Facebook Graph API explorer to try it, though I have not been able to get it working.

Post Privately to Facebook Application Wall Page

When you publish a post to your application's wall, is it possible to set the privacy of it?
As per the "privacy" option mentioned here:
http://developers.facebook.com/docs/reference/api/post/
Privacy seems to be ignored when I try it (and I am doing it as the application admin). It doesn't seem like this case is included in the paragraph below, but perhaps this is the reason (from the same page):
Note: This privacy setting only applies to posts to the current or specified user's own Wall. Facebook ignores this setting for targeted Wall posts (when the user is writing on the Wall of a friend, Page, event, group connected to the user). Consistent with behavior on Facebook, all targeted posts are viewable by anyone who can see the target's Wall.
What you should do is post to the applications wall page using a Page access token. See the "Page login" part of https://developers.facebook.com/docs/authentication/.