Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there ANY way to remove photo tags with facebook API?

There are some old posts related to this topic but the API has since changed, so I wanted to ask again. Is there any way to remove photo tags with the Facebook API?

I saw this documentation about deleting photo tags with the graph API.
https://developers.facebook.com/docs/reference/api/photo/#tags

You can delete a tag for a particular user in the photo by issuing a HTTP DELETE request to /PHOTO_ID/tags/USER_ID or PHOTO_ID/tags?to=USER_ID.

Deleting a tag on a photo requires the publish_stream permission and supports the following parameters.

Parameter    Description                                Type    Required

to           USER_ID of the User to tag; can also be    string  yes
             provided in URL path (see above).       

If the deletion is successful, you get the following return.

Description                 Type

If the deletion succeeded   boolean

It did not work when I tried it. Instead, I always get the following error:

{
  "error": {
    "message": "(#3) Application does not have the capability to make this API call.", 
    "type": "OAuthException", 
    "code": 3
  }
}

I submitted a bug report to Facebook and they seemed to acknowledge a bug by putting it into "triaged" status. Then a few weeks later, although several other developers had subscribed to the bug report, they closed the case with this explanation:

We are prioritizing bugs based on impact to the developer community. As this bug report has not received much attention from other developers, we are closing it so as to better focus on the top issues. There is a good chance your issue is due to an implementation problem in which case you can try to find help on Stack Overflow.

The bug report is here: https://developers.facebook.com/bugs/122135101317762

Can anyone help me figure out how to untag via the API? My app is currently written as a Web app, not as a mobile one.

Thank you in advance for any help on this.

like image 652
user2026318 Avatar asked May 29 '13 02:05

user2026318


People also ask

How do you mass remove tagged Photos on Facebook?

Tap Activity You're Tagged In. From here you can: Tap the circle on the left of each piece of content you'd like to untag. Tap Select All in the top left of your activity log to select all the content.


2 Answers

Update: As Christopher Blizzard explains in the accepted answer, this isn't in fact a bug, but intentional behaviour that was previously badly documented.

Before this was known, back when this answer was first posted, I investigated a little to try and figure out if there was any way around this restriction. The answer is no. I've left the detail of my findings below in case they are of interest to anybody in the future, but Christopher Blizzard's input makes most of this obsolete.

I'm reasonably confident that the answer is no, there's no way at all. I've exhausted all possible lines of investigation I can think of, and come up blank. Let me list my findings:

1) The bug affects both ways of deleting photo tags listed in the documentation.

Sending a delete request to https://graph.facebook.com/PHOTO_ID/tags/USER_ID/ and sending one to https://graph.facebook.com/PHOTO_ID/tags?to=USER_ID should both work, according to the documentation. However, in reality, both approaches fail with the following error, as you've already observed:

{
  "error": {
    "message": "(#3) Application does not have the capability to make this API call.", 
    "type": "OAuthException", 
    "code": 3
  }
}

2) It's got nothing to do with your app's permissions

Using Graph Explorer you can easily test this stuff out using an access token that grants you all possible permissions, and deleting tags still fails.

3) It's got nothing to do with the user's privacy settings

I tried creating a new user on Facebook and setting every single privacy setting in the settings menu to the most lenient option available. It made no difference.

4) It's not to do with the photo's owner or how the original tag was created

Even when the person whose access token you're using owns the photo that the tag is on and created the tag themselves, you still get the same error when trying to delete the tag. This applies whether they created the photo and tag through the normal Facebook user interface, or with your app through the Graph API.

5) There's no workaround using APIs other than Graph

FQL only allows data retrieval, not insertion, modification or deletion. Open Graph has no methods relating to photos or photo tags. The deprecated REST API - which is still functional, but which Facebook instructs us not to use, and whose documentation has been taken down - has functioning methods for getting and adding tags, but none for deleting them, as you can see in a a cached version of the documentation, via the Wayback Machine.

6) There doesn't seem to be any way to delete a tag using POST requests.

You can change the location of an existing tag, but that's it. Specifying an invalid location throws an error and doesn't affect the existing tag. Specifying the to field twice in a post request to try and change the target of a tag throws an error and has no effect.

7) Others have tried to solve the same problem before, and they have not succeeded.

I haven't found many posts about this issue, but there are these two, neither of which are helpful:

  • Delete photo tag from Graph API
  • http://queforum.com/facebook-applications/78655-facebook-untag-user-photo-via-facebook-graph-api.html

After testing all the points above, I'm out of ideas. Of course, there's no way I can say with certainty that this is impossible - we don't know what's going on on Facebook's back end or why the bug exists. I think these tests represent a pretty thorough examination of the problem, though, and they haven't revealed any solution.

like image 163
Mark Amery Avatar answered Nov 10 '22 15:11

Mark Amery


I just updated the documentation on developers.facebook.com, but the short version is that the delete tag API is whitelisted only for certain apps.

like image 27
Christopher Blizzard Avatar answered Nov 10 '22 15:11

Christopher Blizzard