java - 使用应用程序访问 token 在 Facebook 页面上发帖

标签 java facebook facebook-graph-api facebook-apps restfb

我有一个 Facebook 页面、一个 Facebook 应用程序和该页面的管理员 Facebook 帐户。

现在我想在该页面上发布一个链接(我不关心如何发布)。

从现在开始,我通过获取应用程序管理员的用户访问 token 来做到这一点,然后获取页面,获取该页面的访问 token ,然后通过我的应用程序在页面上与管理员一起发布。

现在 token 已过期,我在文档中读到我可以:

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.

所以我得到了应用程序访问 token 。

但现在我不知道如何继续,如何使用该 token 在页面墙上发布?

最佳答案

我相信应用程序访问 token 是用于代表用户发布的。对于页面,您应该使用页面访问 token 。

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

如上面的链接所述

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. This access token can be retrieved by issuing an HTTP GET to /USER_ID/accounts with the manage_pages permission. 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. 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. Publishing to a Page also requires the publish_stream permission, unless otherwise noted.

关于java - 使用应用程序访问 token 在 Facebook 页面上发帖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13109198/

相关文章:

javascript - React 在 Internet Explorer 中不起作用

facebook - 无法使用 Graph API Explorer 读取数据

facebook - 在验证应用程序之前获取 Facebook 用户的个人资料图片

java-7 - 我如何访问这个特定的类(class)?

facebook - 使用提要对话框控制发布到 Facebook 的 swf 的大小

iOS Facebook SDK 批量请求,单个完成 block

ios - 如何更新/升级 Facebook API 版本?

java - EclipseLink:如何为 eclipselink 2.7.0 设置 SLF4J 记录器

java - 递归/多线程程序问题

java - 如何计算 "Java Project"中的行数