Facebook错误(#200)用户尚未授权应用程序执行此操作 [英] Facebook Error (#200) The user hasn't authorized the application to perform this action
问题描述
我有以下内容:
// my facebook page
var pageId = facebookPageId;
var app = new FacebookClient();
dynamic fbResult = app.Get("oauth/access_token", new {
client_id = facebookAppId,
client_secret = facebookAppSecret,
grant_type = "client_credentials"
});
app.AccessToken = fbResult.access_token;
dynamic messagePost = new ExpandoObject();
messagePost.access_token = app.AccessToken;
messagePost.link = "www.google.com";
messagePost.name = "some name";
messagePost.caption = "{test actor} " + "Test message"; //<---{*actor*} is the user (i.e.: Aaron)
messagePost.description = "Test description";
try {
var result = app.Post("/" + pageId + "/feed", messagePost);
} catch (FacebookOAuthException ex) {
var test = ex;
} catch (FacebookApiException ex) {
var test = ex;
}
但是我总是得到(#200)用户没有授权应用程序执行此操作
。我究竟做错了什么?这是我拥有的一个页面 - 但是我看不到如何将POST权限授予我的应用程序。
Yet I always get (#200) The user hasn't authorized the application to perform this action
as a result. What am I doing wrong? It's a page that I own - but I don't see how to go about granting POST permissions to my app.
推荐答案
用户需要 publish_actions
权限。
实施登录对话框供用户授予 publish_actions
您正在使用应用程序访问令牌。
You are using an application access token.
- https://developers.facebook.com/docs/facebook-login/permissions/v2.2
- https://developers.facebook.com/docs/graph-api/reference/ v2.2 / page / feed#publish
- https://developers.facebook.com/docs/facebook-login/permissions/v2.2
- https://developers.facebook.com/docs/graph-api/reference/v2.2/page/feed#publish
要授予权限通过Graph API资源管理器
To grant permissions via the Graph API Explorer
从下拉菜单中选择您的应用程序
Select your app from the dropdown menu
然后通过单击获取访问令牌选择权限,然后选择 publish_actions
<扩展权限下,最后点击get token。
Then select the permission by clicking "Get Access Token" then selecting publish_actions
under Extended Permissions, and finally click get token.
这篇关于Facebook错误(#200)用户尚未授权应用程序执行此操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!