Unable to delete Facebook app invitation after accepting

I looked at this site and looked at the documents on Facebook, but I can’t delete the invitation after a friend has agreed. So what happens: 1. Steve invites John to the game. 2. John receives an invitation and clicks. 3. John is sent to the game, but the invitation message is not deleted on his facebook page.

Facebook docs suggests adding "method = delete" when I post a message https://graph.facebook.com/[request_id]?access_token=xxxx

But this returns me "{"error":{"type":"OAuthException","message":"(#2) Invalid parameter: Unknown error"}} ". I am sure I am using the latest access_token.

Can someone provide me with a sample code that removes the application prompt after the user accepts?

EDIT: I also tried DELETE ie DELETE https://graph.facebook.com/ [request_id]?access_token=xxxx And I get the same error

Thanks.

+4
source share
2 answers

Brief examples at https://developers.facebook.com/docs/reference/dialogs/requests/ and a longer example https://developers.facebook.com/blog/post/464/ that show how to do this.

It sounds from your comments on fjsj's answer that you know what you should do - it definitely looks good to me.

You may have encountered some kind of error, but I think that in this case it is more likely that the user access token will be sent in some way or there is a small error in the way you access the API. If there is a specific error message that you are returning? perhaps post what is here, if any.

Two things to check:

  • Is the request you are trying to delete repeated when you make a GET request to /<request id> ? (using application access token)

  • Are requests sent using the dialog boxes of newer requests 2.0? If you are using an older request system, the instructions are basically the same, but the connection you are accessing the requests is the endpoint [currently undocumented] /<USER>/platformrequests (unlike /<USER>/apprequests

+3
source

Try doing DELETE HTTP instead of POST. About it speaks.

0
source

All Articles