开发者

Posting to a Group page of which I am an admin....fails with (OAuthException) (#200) The user hasn't authorized the application to perform this action

I can post to my own wall, and I can pull information from the Group wall - but I cannot post to the Group wall (of which I am admin) and I get the error:

(OAuthException) (#200) The user hasn't authorized the application to perform this action

I have all the correct permissions set:

email,publish_stream,create_event,offline_access,publish_checkins,read_stream,sms,manage_pages

I can post anything to my own wall - but when I try and post to the Group wall it fails.

Now I see some mentions of the manage_groups in the developer.facebook.com site which apparantly is used to get more granular permissions, but I am at a loss as to how to use this and get the correct token to post to the Group (if that is indeed where I am going wrong).

Any pointers?

Regards

Richard

------------Sample of my test code below (in vb using the FB v5 C# Api)

    Dim fb = New FacebookOAuthClient()
    fb.ClientId = "XXXXXXXXXXXXXXXXXXXX"
    fb.ClientSecret = "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
    Dim result = fb.GetApplicationAccessToken()

    Dim fbapp = New FacebookClient(result.access_token.ToString)

    Dim parameters As Object = New ExpandoObject()
    parameters.message = "Test Post"

    ' I can pull from the Group feed ok
    Console.Write(fbapp.Get("XXXXXXXXXXXXX"))

    ' But when I try and post...the error pops up.
    Console.Write(fbapp.Post("XXXXXXXXXXXXX/feed", parameters))
开发者_如何学Go


You can't use the application access token to perform this action. You must use the user's access token. Change your code to the following:

Dim authorizer = New Authorizer();

Dim fbapp = New FacebookClient(authorizer.Session.AccessToken)

Dim parameters As Object = New ExpandoObject()
parameters.message = "Test Post"

' I can pull from the Group feed ok
Console.Write(fbapp.Get("XXXXXXXXXXXXX"))

' But when I try and post...the error pops up.
Console.Write(fbapp.Post("XXXXXXXXXXXXX/feed", parameters))
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜