Kneemin
Kneemin

Reputation: 868

Remove facebook user from within the application

Prior to the may updates (we were using the offline tokens because they did not expire), I was able to send a delete request to facebook and remove the user's facebook link from within our software, after turning the disable offline access to enabled (disabled the old functionality), this no longer works. I am trying to figure out what may have changed. There are no current posts on the subject and all the posts I do find are VERY conflicting in answers.

i.e.

Remove the application from a user using graph API

vs

Facebook account delink or deauthorize facebook app and check status of linking from facebook app

This is also documented on the graph documentation as saying this command should work, I have tried a few different syntaxes (its not actually stated which syntax to use in the documentation - nice job Facebook, it just says "send a delete request").

Long story short, does this work? I keep getting the 400 error "bad request" when attempting to fix this feature.

I have tried the following two urls:

https://graph.facebook.com/userId/permissions?access_token=someToken&method=delete https://graph.facebook.com/me/permissions?access_token=someToken&method=delete

Upvotes: 2

Views: 5465

Answers (2)

Kneemin
Kneemin

Reputation: 868

Sorry for having answered my own question:

Apparently I was actually getting random errors rather than actual errors.

I am unsure if /me/ works, because I did not go back to re-test it, but I am certain now that using the format:

https://graph.facebook.com/userId/permissions&access_token=someToken

Does indeed work correctly for deauthorizing your own application in facebook.

Upvotes: 0

Igy
Igy

Reputation: 43816

Those questions aren't inconsistent, one of them was answered before the Graph API had support for this

https://developers.facebook.com/docs/reference/api/user/#permissions is the documentation, the example is: (javascript)

FB.api("/me/permissions","DELETE",function callback());

I've done this many times and it definitely works

Upvotes: 7

Related Questions