2

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

Community
  • 1
  • 1
Kneemin
  • 813
  • 10
  • 14

2 Answers2

7

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

Igy
  • 43,710
  • 8
  • 89
  • 115
  • I had a feeling that despite their dates being relatively close, that the function was added sometime in between, but I was unable to find the addition documented anywhere, so to me they were indeed inconsistent. Anyway, we perform all these functions in the server-side code. So a javascript solution would not help. I did find out what my specific problem was and will update though. + For verification that it at least works in JS. I'll try to remember to + you when I hit 15 rep and can do that, lol. – Kneemin Jun 01 '12 at 19:35
  • You can definitely make the call with the PHP SDK; the app access token or a currently-valid access token for that user will do it – Igy Jun 01 '12 at 19:39
  • The integration code is all in C#. All these problems had arisen due to using legacy code that never implemented an open source SDK for it. Also I noticed that the facebook C# SDK is deprecated anyway :/. Thanks though, I only went back to re-check because you said it should work. – Kneemin Jun 01 '12 at 19:50
  • Alright well what about this issue - It worked fine when I had posted back and now it doesn't work at all, again. We get these kinds of issues with facebook's integration ALL the time. Right now any time I try to unlink anything it just gives the 400 Bad Request error with no real information included....Even an SDK is useless if the requests are denied. – Kneemin Jun 04 '12 at 15:30
  • I don't know why, but the callback is never triggered. I'm using the same code as yours. Do you know why the callback is not triggered? – Felipe Mosso Sep 17 '15 at 00:26
0

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.

Kneemin
  • 813
  • 10
  • 14