Can't delete photo via Facebook API?

前端 未结 3 1141
后悔当初
后悔当初 2020-12-19 11:17

Suddenly, I can\'t delete Facebook photos via the API. I get this error:

Array ( [error] => Array ( [type] => OAuthException [message] => (#3) Appli         


        
相关标签:
3条回答
  • 2020-12-19 12:01

    I paste this comment here to someone easy to find

    "Actually apps can delete photos they created by simply calling a delete method on the resource ID. Using a curl/file_get_contents on https://graph.facebook.com/ID?method=DELETE&access_token=TOKEN where ID is the photo id and TOKEN the access token for the user-application pair. – mariomc Dec 17 '12 at 17:07"

    I tested, it worked like a charm, thank you

    $delete = file_get_contents('https://graph.facebook.com/<id photo>?method=DELETE&access_token=<access_token>');
    echo $delete;
    die;
    

    you can find access_token at https://developers.facebook.com/tools/access_token/, copy token can access to photo or page's photo.

    0 讨论(0)
  • 2020-12-19 12:12

    You are correct; there is currently no public access to delete photos from an album via the Facebook API.

    This is intentional and there are no known workarounds. An App can delete open graph actions or Feed stories that it has made, but not most other types of content, including photos.

    0 讨论(0)
  • 2020-12-19 12:12

    As of December 2012, apps can only delete photos they created.

    This deletion is done by simply calling a delete method on the resource ID. Using, for instance, a curl/file_get_contents on http://graph.facebook.com/[ID]?method=DELETE&access_token=[TOKEN] where [ID] is the photo id and [TOKEN] the access token for the user-application pair.

    0 讨论(0)
提交回复
热议问题