0

I am trying to delete Facebook post by using php-graph-sdk using post_id (Same post created by same Facebook application.

I am using new API v2.9 I tried to delete post but it shows me error.

$parameters['deleteResponse'] = $fb->delete('/'. $parameters['facebook_post_id'], array(), $parameters['access_token']);

and error is `exception

Facebook\Exceptions\FacebookAuthenticationException' with message 'Unsupported delete request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api

I check Facebook api and it shows the same way i construct delete function but doesn't work at all...

Swap-IOS-Android
  • 4,363
  • 6
  • 49
  • 77
  • You likely need to use the “full” post id, same as when reading individual posts, see https://stackoverflow.com/a/31354218/1427878 – CBroe Jul 10 '17 at 11:22
  • @CBroe Yes I am already using post_id which consist of userId_postId but still no luck – Swap-IOS-Android Jul 10 '17 at 11:26
  • If it is a post made by a user profile, then your app needs the user’s permission to _read_ their posts in the first place. – CBroe Jul 10 '17 at 11:27
  • @CBroe yes I can read that particular post by passing id to get request and it returns me message and created time and all other information. https://developers.facebook.com/docs/php/Facebook/5.0.0 this says you just need to pass "$fb->delete('/{node-id}', '{access-token}')" – Swap-IOS-Android Jul 10 '17 at 11:33
  • You are not calling `$fb->delete('/{node-id}', '{access-token}')` here, you are passing an empty array as second parameter ... – CBroe Jul 10 '17 at 11:43
  • @CBroe yes I am passing empty array as parameter because graph-php sdk required 2nd parameter as array. as indicating this post https://github.com/facebook/php-graph-sdk/issues/580 – Swap-IOS-Android Jul 10 '17 at 11:45
  • This app created the post you try to delete? If not this will not work... – Norbert Jul 10 '17 at 11:52

0 Answers0