0

When I try delete a page tab, facebook throws me an error.

$facebook->api('/PAGE_ID/tabs/TAB_ID', 'post', array(
    'method' => 'delete',
    'access_token' => PAGE_TOKEN
));

Fatal error: Uncaught GraphMethodException: Unsupported post request.


$facebook->api('/PAGE_ID/tabs/TAB_ID', 'get', array(
    'method' => 'delete',
    'access_token' => PAGE_TOKEN
));

Fatal error: Uncaught GraphMethodException: Unsupported get request.


$facebook->api('/PAGE_ID/tabs/TAB_ID', 'delete', array(
    'access_token' => PAGE_TOKEN
));

Fatal error: Uncaught GraphMethodException: Unsupported delete request.


What am I doing wrong?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Datamosh
  • 126
  • 1
  • 7

1 Answers1

1

It should be a HTTP DELETE request.

Either change 'post' to 'delete' and remove the unnecessary 'method => delete' or change 'post' to 'get' and leave the 'method => delete' in place

Igy
  • 43,710
  • 8
  • 89
  • 115
  • With delete instead post, and without method: **Fatal error: Uncaught GraphMethodException: Unsupported delete request.**, Otherwise: **Fatal error: Uncaught GraphMethodException: Unsupported get request** :( – Datamosh Jul 06 '12 at 12:52
  • Are you sure you have the page ID and tab ID correct then? that error means 'you're trying to do something to an object that isn't supported' - it usually means using a GET when it should be a POST or vice-versa, but it could just be that your request is wrong – Igy Jul 06 '12 at 13:23
  • 1
    You're right. Sorry and THANKS! Final code: **$facebook->api('/PAGEID/tabs/app_TABID), 'delete', array('access_token' => PAGE_TOKEN));** – Datamosh Jul 06 '12 at 13:44