How to change privacy settings for photos posted on Facebook via graph API?

how to change privacy settings for photos posted on facebook via graph API

  • When publishing a post on the user's wall (via the graph API) I know how to change the privacy settings using the "privacy" field, and it works fine. However, how do I do the same on a photo published into an album? Photos in albums also have privacy settings (you can set them manually so I guess you can set them via the API, or can't you?). The privacy field for the Photo object does not exist. I thought it may be undocumented so I tried it, but it doesn't work. So how do I change the privacy settings for a photo? (ideally at the very moment of publishing it) thanks m.

  • Answer:

    From what I've seen you can't set a Photo's privacy directly when publishing (the API seems to only take "source" and "message" values). However, if you create a new Album and pass in "visible" with a value of "everyone" then the album is "public". <form action="https://graph.facebook.com/me/albums?access_token=<?= $fb_access_token ?>" method="POST"> Album name <input name="name" type="text" value="Name of Album"><br/><br/> Album message <input name="message" type="text" value="Message on Album"><br/><br/> Album visible level <input name="visible" value="everyone" /><br/><br/> <input type="submit" value="Create"/> </form> If you then upload a Photo into that album then the Photo will also be "public". <form enctype="multipart/form-data" action="https://graph.facebook.com/[ALBUM_ID]/photos?access_token=<?= $fb_access_token ?>" method="POST"> Please choose a photo <input name="source" type="file"><br/><br/> Say something about this photo: <input name="message" type="text" value=""><br/><br/> <input type="submit" value="Upload"/> </form> To my knowledge the "visible" setting is undocumented... I found it in the FQL table: http://developers.facebook.com/docs/reference/fql/album/ You would think it accepted "privacy" but in my experience it does not. http://developers.facebook.com/docs/reference/api/album/

matteo at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.