简体   繁体   English

使用应用程序访问令牌在Facebook页面上发布

[英]Post on Facebook Page with Application Access Token

I have a facebook page, a facebook app and an administrator facebook account of that page. 我有一个Facebook页面,一个Facebook应用程序和该页面的管理员Facebook帐户。

Now i want to publish a link on that page (i don't care how). 现在,我想在该页面上发布一个链接(我不在乎如何)。

Since now i did that by getting a user access token of the admin for my app, then get the page, get a access token for that and then post with the admin on the page via my app. 从现在开始,我通过获取我应用程序管理员的用户访问令牌,然后获取页面,获取该对象的访问令牌,然后通过我的应用程序与管理员一起发布在页面上来做到这一点。

Now the token expired and i read in the documentation that i can: 现在令牌已过期,我阅读了可以进行以下操作的文档:

For example, if a user granted your app publish_stream permissions, your app can use an app access token to publish a status update on their behalf. 例如,如果某个用户授予了您的应用publish_stream权限,则您的应用可以使用应用访问令牌代表他们发布状态更新。

So i got the application access token. 所以我得到了应用程序访问令牌。

But now i don't know how to go on, how can i publish on the page's wall with that token ? 但是现在我不知道如何进行下去,如何使用该令牌将其发布在页面的墙上?

I believe the application access token is for publishing on behalf of users . 我相信应用程序访问令牌是用于代表用户发布的。 For pages, you should be using the page access token. 对于页面,您应该使用页面访问令牌。

https://developers.facebook.com/docs/reference/api/page/ https://developers.facebook.com/docs/reference/api/page/

As described in the link above 如以上链接所述

To perform the following operations as a Page, and not the current user, you must use the Page's access token, not the user access token commonly used for reading Graph API objects. 要以页面(而不是当前用户)身份执行以下操作,您必须使用页面的访问令牌,而不是通常用于读取Graph API对象的用户访问令牌。 This access token can be retrieved by issuing an HTTP GET to /USER_ID/accounts with the manage_pages permission. 可以通过向具有/ manage_pages权限的/ USER_ID / accounts发出HTTP GET来检索此访问令牌。 This will return a list of Pages (including application profile Pages) to which the user has administrative access, along with access_tokens for those Pages. 这将返回用户具有管理访问权限的页面列表(包括应用程序配置文件页面),以及这些页面的access_tokens。 Alternatively, you can get a page access token for a single, specific, page by issuing an HTTP GET to /PAGE_ID?fields=access_token with the manage_pages permission, as described above. 或者,您可以通过使用/ manage_pages权限向/ PAGE_ID?fields = access_token发出HTTP GET来获得单个特定页面的页面访问令牌,如上所述。 Publishing to a Page also requires the publish_stream permission, unless otherwise noted. 除非另有说明,否则发布到Page还需要publish_stream权限。

After more research i think there is no way to publish on pages with only a app token. 经过更多研究,我认为仅使用应用程序令牌就无法在页面上发布。

It is still possible to post on the wall of the users that authorized the app, but not on their pages ... 仍然可以在授权该应用程序的用户墙上张贴,但不能在他们的页面上张贴...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM