使用 Python 发布到 Facebook

问题描述 投票:0回答:1

我正在尝试使用 Jupyter 笔记本创建 Facebook 帖子。

import facebook as fb

# Initialize the Graph API with your access token
access_token = 'code'
graph = fb.GraphAPI(access_token)

# Test API call
user_info = graph.get_object('me')
print(user_info)

# Create the post
post_message = "testing"
graph.put_object(parent_object='me', connection_name='feed', message=post_message)

但是,有一个 GraphAPIError: (#200)。

在我的 Graph API Explorer 中,我拥有具有以下权限的用户令牌:user_events、user_photo、user_videos、user_post、public_profile。

我可以知道我还缺少什么吗?

python facebook-graph-api
1个回答
0
投票

尝试在 GraphAPI 中添加撇号('access_token')

© www.soinside.com 2019 - 2024. All rights reserved.