Search code examples
facebookfacebook-graph-apihttp-postfacebook-android-sdkfacebook-ios-sdk

How to delete facebook post programmatically that has not been posted by your application?


How to delete Facebook post that is not posted by your application?

  1. Using graph API - according to docs

/* make the API call */
new GraphRequest( AccessToken.getCurrentAccessToken(), "/{post-id}", null, HttpMethod.DELETE, new GraphRequest.Callback() { public void onCompleted(GraphResponse response) { /* handle the result */ } } ).executeAsync();

Above code is not working.

It is giving error:-

{
  "error": {
    "message": "(#200) This post wasn't created by the application",
    "type": "OAuthException",
    "code": 200,
  }
}
  1. Or does there exist some other method?

Solution

  • According to the Graph API reference:

    An app can delete any post it published, or a page-management app can delete a Post published to a Page that the app manages.

    So it depends on what you are doing.