如何通过图形API更改在Facebook上发布的照片​​的隐私设置

时间:2011-09-19 12:08:10

标签: facebook facebook-graph-api photo privacy

在用户的墙上发布帖子时(通过图谱API)我知道如何使用“隐私”字段更改隐私设置,并且工作正常。

但是,如何在发布到相册中的照片上执行相同的操作?相册中的照片也有隐私设置(您可以手动设置它们,所以我猜您可以通过API设置它们,或者不是吗?)。 Photo对象的隐私字段不存在。我认为它可能没有记录,所以我尝试了,但它不起作用。

那么如何更改照片的隐私设置? (理想情况是在发布它的那一刻)

感谢 米。

1 个答案:

答案 0 :(得分:2)

据我所见,您无法在发布时直接设置Photo的隐私(API似乎只采用“来源”和“消息”值)。

但是,如果您创建一个新专辑并传入“可见”且值为“everyone”,则该专辑将为“公开”。

    <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>

如果您然后将照片上传到该相册,那么照片也将是“公开的”。

    <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>

据我所知,“可见”设置没有记录......我在FQL表中找到了它:http://developers.facebook.com/docs/reference/fql/album/

你会认为它接受了“隐私”,但根据我的经验,它并没有。 http://developers.facebook.com/docs/reference/api/album/

相关问题