Facebook API : GraphMethodException – Unsupported delete request

{“error”:{“type”:”GraphMethodException”,”message”:”Unsupported delete request.”, “code”: “100”}}

When does this error happen?

Usually while trying to delete a action performed by people inside your app. For example you must have created a “read” action and the articles your users read are the objects. When the users wish to delete one of the articles he/she read, you’d have to do something like this :

$facebook->api('/id_created_when_the_user_read_the_article/', 'DELETE', array('access_token' => 'user_access_token'));

What does this error mean?

From my understanding, you are trying to delete something that you are not supposed to. Usually you are trying to deleting the object instead of the action. For example. When your user (for example. John) reads “Hello World” article in your website. You create a social activity like :

John read an article in Your Website

You’ll have bunch of IDs when you create this activity:

  1. ID that points to the “Hello World” article.
  2. ID of your application/website that created this action
  3. ID of the user who performed this action
  4. ID the points to the activity that the user (from point 3) have performed an action (i.e. read) on an object (from point 1) in your website/app (from point 2).

While deleting we need to delete the ID from point 4. When you try to delete IDs of any of the other, you get “Unsupported delete request”.

How to fix this ?

  • Go to Graph API Explorer
  • Paste the access token that you use to delete in the “Access Token” Field, leave the dropdown to “GET” and paste the ID you are trying to field in the text field next to “GET” dropdown
  • Click on submit and view the response. If you read the response, you will understand what you are trying to delete. Make sure that it is not ID of the user, or ID of the object/app/website.
  • Once you have the correct ID to delete, paste it in the field, change from GET to DELETE and click SUBMIT. This will delete the ID as you wanted. If you still get unsupported delete request, then I am sorry you are not really supposed to do that or you are still passing on the wrong ID.