开发者

facebook status

开发者 https://www.devze.com 2023-04-07 20:20 出处:网络
I am trying to use the following code to post a message on facebook wall (Facebook C# SDK - https://github.com/facebook/csharp-sd开发者_StackOverflowk)

I am trying to use the following code to post a message on facebook wall (Facebook C# SDK - https://github.com/facebook/csharp-sd开发者_StackOverflowk)

Facebook.FacebookAPI api = new Facebook.FacebookAPI("my token");

JSONObject me = api.Get("/me");

var userId = me.Dictionary["id"].String;

Dictionary<string, string> postArgs = new Dictionary<string, string>();

postArgs["message"] = "Hello, world!";

api.Post("/" + userId + "/feed", postArgs);

I am able to pull the user profile information but while posting a message throwing an error message like below.

The remote server returned an error: (403) Forbidden. Description: An unhanded exception occurred during the execution of the current web request.

Exception Details: Facebook.FacebookAPIException: The remote server returned an error: (403) Forbidden.

What could be the issue ?


Make sure userId is the proper value and make sure you have publish_stream extended permissions granted from the user.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号