facebookfacebook-graph-apifacebook-javascript-sdk

delete facebook requests via graph api


I am getting latest apprequest like this:

FB.api('/me/apprequests', function(response){

if (response.data[0]) {     
// code here
};

How to delete apprequest using the same graph api method , I know this is possible with request containing access_token ... but in this case I am caching html and didn't know how

Thanks


Solution

  • Please use the following code (PHP):

    file_get_contents('https://graph.facebook.com/'.$rid.'?access_token='.$token.'&method=DELETE') == "true";   
    
    // $rid: Request Id
    // $token: Access Token
    
    // The response is generally just the text "true"