Reputation: 847
I'm trying delete an request using the following code:
function deleteRequest(<request_id>_<user_id>) {
FB.api(<request_id>_<user_id>, 'delete', function(response) {
console.log(response);
});
}
But facebook returns the following error:
message: "(#2) User can't delete this request: Unknown error"
type: "OAuthException"
What is going on?
Upvotes: 2
Views: 694
Reputation: 2155
If user is not active user is not the one who received this request you can also use application access token (APPID|APPSECRET
), however use it ONLY(!) in backend (not in javascript!) because of security reasons.
Upvotes: 0
Reputation: 847
The problem was that I was passing the id of the User that generated the request, but the correct is pass user_id of the user that received request.
Upvotes: 0
Reputation: 25918
Since you removing request with JS-SDK and not providing access_token
explicitly (which means access_token
for current user is used) this may be related to couple of things:
Things to do:
FB.getAuthResponse().userID
is the same as <user_id>
Upvotes: 2