Facebook Python SDK [英] Facebook Python SDK

查看:304
本文介绍了Facebook Python SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Facebook Python SDK发布到Facebook?我试图使用:

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?

推荐答案

你正确地获取了 oauth_token 值? SDK的签名表示SDK已经向Facebook签署了该请求,但令牌与Facebook的API服务器所期望的不符。当您从Facebook Cookie(如果您使用Javascript SDK登录Facebook)解压缩 oauth_token 时,我会检查您使用的是正确的Facebook应用程序密钥和密码。或者您的OAuth握手正确执行。

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 the oauth_token from the Facebook cookie (if you're using the Javascript SDK to log into Facebook) or that your OAuth handshake was properly performed.

这篇关于Facebook Python SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆