Reputation: 447
My app sent out a batch of posts tonight that were created erroneously. I would like to delete them, but I don't currently store the ids of posts that I create.
Is there a way to query for posts made after a certain time?
Once I have the ids I think I know how to delete them.
I'm using the Ruby gems facebooker2 and mogli.
Upvotes: 0
Views: 340
Reputation: 25918
You can retrieve the posts from feed
or home
connection of user
.
For using those connections to read users post you will need read_stream
permissions from user (which may be a bit problematic in your case if you not yet have this permission granted) and active access_token
(this one will be needed to remove the posts too).
feed
connection can be easily parsed to get posts from your application (since every post
object have application
property containing name and id)home
connection contain much more details to parse but you can filter results by application using filter
(like /USER_ID/home/filter=app_2305272732
).Once you discovered the posts you may delete 'em by issuing DELETE
request to Graph API:
DELETE https://graph.facebook.com/POST_ID?access_token=...
Or several posts for same user:
DELETE https://graph.facebook.com/?ids=POST_ID_1,POST_ID_2,POST_ID_N?access_token=...
Notes:
Since you said you didn't stored ids of post that published, more problematic may be discovering the list of users who got posted.
Upvotes: 1