开发者

How to delete a Facebook comment post using the Facebook GRAPH API?

I started researching this because I wanted to be able to delete a comment on the wall of a Facebook Event, because the "Remove post" doesn't seem to be applicable to comments on an Event wall. However, since I don't know if it is even possible I decided to see if I could mannually delete a post I made to my own wall first since that is possible. Note I am NOT using any SDK; I am just building the URL and entering it in the address bar in Firefox v3.6.17.

These posts have helped me alot since I am now starting: Delete facebook post with Graph API - trouble getting this to work and Facebook SDK and Graph API Comment Deleting Error

I can see the comment data and all its field via the following:

https://graph.facebook.com/[POST_ID]?access_token=[ACCESS_TOKEN]  
`where [POST_ID] and [ACCESS_TOKEN] were got using the graph API.`

However, where do I put the "method=delete" command in the URL? I tried putting it at the end, like

https://grap开发者_运维技巧h.facebook.com/[POST_ID]?access_token=[ACCESS_TOKEN]?method=delete 

but that results in a OAuthException stating "Invalid access token signature" because it seems to read the method as part of the access token.

I tried putting it after the post_id like

https://graph.facebook.com/[POST_ID}?method=delete?access_token=[ACCESS_TOKEN] 

but that results in an Exception (Unsupported method) because it thinks "access_token=[ACCESS_TOKEN]" is part of the method being called.

I see one of the posts cited above states I have to prepend the userid to the object ID when deleting by using

DELETE https://graph.facebook.com/673509687_104812882909249?access_token={access_token} 
`where 673509687 is my userID and 104812882909249 is the objectID`  

But when I enter

DELETE https://graph.facebook.com/[POST_ID}?access_token=[ACCESS_TOKEN]

in the Firefox address bar it doesn't recognize it (I didn't think it would anyway) and uses it as a google search query.

How do I delete a comment if I have the comment_id and my access_token using the web browser?


You have a big problem with your urls :

https://graph.facebook.com/[POST_ID]?access_token=[ACCESS_TOKEN]?method=delete

Should be :

https://graph.facebook.com/[POST_ID]?access_token=[ACCESS_TOKEN] & method=delete

Identically,

https://graph.facebook.com/[POST_ID}?method=delete?access_token=[ACCESS_TOKEN]

should be :

https://graph.facebook.com/[POST_ID}?method=delete  & access_token=[ACCESS_TOKEN]

So you have to use the ? before entering your parameters and then & between each parameter and the order should not have any importance ..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜