既然publish\u actions权限已被弃用,如何使用API作为Facebook页面发布?(自2018年4月24日起)

2024-04-19 21:04:19 发布

您现在位置:Python中文网/ 问答频道 /正文

我读过几篇关于如何通过pythonapi发布Facebook帖子的教程。关于this link的文档说明-

As of April 24,2018, the pubish_actions permission has been removed. Please see the Breaking Changes Changelog for more details. To provide a way for your app users to share content to Facebook, we encourage you to use our Sharing products instead.

仍然遵循以下步骤:

  1. 创建了一个Facebook应用程序
  2. 生成了一个没有过期限制的长期访问令牌,该令牌具有我可以授予该应用的所有可能权限(manage_pages,pages_manage_cta,pages_show_list,pages_messaging_phone number,pages_messaging_subscriptions,public_profile)

尝试使用图形API资源管理器工具请求发布_页会导致此错误-

Invalid Scopes: publish_pages. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read the documentation for valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions

  1. 尝试使用图形API请求创建帖子:

    curl -i -X POST \
     -d "url=https://www.facebook.com/images/fb_icon_325x325.png" \
     -d "caption=test photo upload" \
     -d "access_token=<user_photos_user_access_token>" \
     "https://graph.facebook.com/v3.0/me/photos"
    

此请求导致以下错误消息-

This endpoint is deprecated since the required permissions manage_pages,publish_pages are deprecated

既然publish_pages权限已被弃用,那么如何使用API将文章发布为Facebook页面?在


Tags: ofthetohttpscomapipermissionsfor
1条回答
网友
1楼 · 发布于 2024-04-19 21:04:19

您需要查看更新的API和权限manage_pages和{},这些可以在文档here中看到。在

您需要这两个权限才能作为页面发布。{a2还需要对这些应用程序进行详细的权限检查。在

编辑以回答评论中的其他问题: 正如链接文档中所说,令牌在一个小时后过期,您必须请求一个新的令牌。请参阅tokens页的底部。在

相关问题 更多 >