脸书Python SDK
如何使用 Facebook Python SDK 向 Facebook 发帖?我尝试使用以下方法来做到这一点:
self.Facebook = facebooksdk.GraphAPI(oauth_token)
self.Facebook.put_object("me", "feed", message="Hello World.")
这是我的回溯:
Traceback (most recent call last):
File "epistle.py", line 559, in send
self.Facebook.put_object("me", "feed", message="Hello World.")
File "/home/logan/epistle/facebooksdk.py", line 124, in put_object
return self.request(parent_object + "/" + connection_name, post_args=data)
File "/home/logan/epistle/facebooksdk.py", line 177, in request
response["error"]["message"])
facebooksdk.GraphAPIError: Bad signature
任何人都可以帮我解决这个问题吗?
How do you post to Facebook using the Facebook Python SDK? I tried to do it using:
self.Facebook = facebooksdk.GraphAPI(oauth_token)
self.Facebook.put_object("me", "feed", message="Hello World.")
And here's my traceback:
Traceback (most recent call last):
File "epistle.py", line 559, in send
self.Facebook.put_object("me", "feed", message="Hello World.")
File "/home/logan/epistle/facebooksdk.py", line 124, in put_object
return self.request(parent_object + "/" + connection_name, post_args=data)
File "/home/logan/epistle/facebooksdk.py", line 177, in request
response["error"]["message"])
facebooksdk.GraphAPIError: Bad signature
Can anyone help me figure this out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否正确获取了
oauth_token
值?错误签名表示 SDK 签署了发送给 Facebook 的请求,但令牌与 Facebook 的 API 服务器所期望的不匹配。当您从 Facebook cookie 中提取oauth_token
时(如果您使用 Javascript SDK 登录 Facebook),或者您的 OAuth 握手是否正确,我会检查您是否使用了正确的 Facebook 应用程序密钥和密码。正确执行。Are you correctly obtaining the
oauth_token
value? Bad signature indicates the the SDK signed the request to Facebook but the token didn't match what Facebook's API servers were expecting. I would check that you are using the correct Facebook application key and secret when you extract theoauth_token
from the Facebook cookie (if you're using the Javascript SDK to log into Facebook) or that your OAuth handshake was properly performed.