Вопрос

I have created a Facebook application that has the permission to post on wall, has offline access, and can store access tokens in the database.

The application only needs you to go to canvas page once, and then it will start serving you a "post" every 5 hours.

So as an upgrade, I need to delete the previous post (I have it's id) and post a new one so we don't get spam reports.

So how can i delete the Post using an access token and Post ID, like that on Shady Wallas post_id{"id":"1658870381_2143043309837"}

Here is some example data:

 https://graph.facebook.com/    Graph url   
 Shady.wallas                   Profile and User ID  
 1658870381_2143043309837       Post ID  
 "planbxe3qxdfghk......."       Access token  
Это было полезно?

Решение

The Facebook graph API documentation tells you:

You can delete objects in the graph by issuing HTTP DELETE requests to the object URLs, i.e,

DELETE https://graph.facebook.com/ID?access_token=... HTTP/1.1

Другие советы

As OffBySome stated, this is expressly covered in the Graph API Documentation, the example given for posts is at https://developers.facebook.com/docs/reference/api/post/#delete

You can delete a post as long as your application created the post. 
You delete a post by issuing an HTTP DELETE request to the POST_ID object
with publish_stream permission.

Note that publishing to a user's wall without their explicit consent is against Facebook policy, and will likely result in spam reports and trip anti spam systems regardless of whether you're subsequently removing the posts and replacing them with other, newer posts. If anything, it might result in more reports as users find content appearing and disappearing which is attributed to your application.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top