Pergunta

Using the Facebook C# API release version from 12/20/2011, I'm calling the facebook client Delete command with "/{facebook id}/permissions" I get a 400 Bad request returned to me. I've tried the following variations too: "{facebook id}/permissions", "/{app id}/permissions", "{app id}/permissions", "/{facebook id}/permission", "me/permissions" and "/{app id}/permission". I've issues other delete commands (such as deleting a comment, removing a like, and deleting a feed posting) thru the C# API with success.

This documentation reference says you're to issue a delete command to {profile id}/permissions

https://developers.facebook.com/docs/reference/rest/auth.revokeAuthorization/

I've tried using {facebook id}/permissions on the delete command via the Graph Api Explorer (https://developers.facebook.com/tools/explorer?method=DELETE) and it works there. So I'm confused why I'm only getting a 400 bad request for the removal of authorization.

   at FluentHttp.HttpHelper.OpenRead() in C:\temp\FBSDK-5.4.1.0.src\FacebookCSharpSDK\Source\Facebook\FluentHttp\HttpHelper.cs:line 693
   at Facebook.FacebookClient.Api(String path, IDictionary`2 parameters, HttpMethod httpMethod, Type resultType) in C:\temp\FBSDK-5.4.1.0.src\FacebookCSharpSDK\Source\Facebook\FacebookClient.cs:line 458

   at Facebook.HttpWebRequestWrapper.GetResponse() in C:\temp\FBSDK-5.4.1.0.src\FacebookCSharpSDK\Source\Facebook\FluentHttp\HttpHelper.cs:line 321
   at FluentHttp.HttpHelper.OpenRead() in C:\temp\FBSDK-5.4.1.0.src\FacebookCSharpSDK\Source\Facebook\FluentHttp\HttpHelper.cs:line 672

https://graph.facebook.com:443/me/permissions?access_token=xxxx is the uri being passed into the CreateHttpWebRequest() method. Content type is "application/x-www-form-urlencoded". When _httpWebRequest.GetResponse(); is called, that's when a WebException is thrown in line 680 of HttpHelper.cs.

"The remote server returned an error: (400) Bad Request."

<HTML>
<HEAD> 
<TITLE>400 Bad Request</TITLE> 
</HEAD>
<BODY> 
<H1>Method Not Implemented</H1> 
Invalid method in request<P> 
</BODY>
</HTML>

Which is a strange response because I can run the delete of permissions from the graph API explorer without getting this error.

Foi útil?

Solução

Logged as a bug with the API

See facebooksdk.codeplex.com/workitem/5926

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top