开发者

Facebook Python SDK

开发者 https://www.devze.com 2023-03-04 14:55 出处:网络
How do you post to Facebook using the Facebook Python SDK? I tried to do it using: self.Faceboo开发者_如何学Pythonk = facebooksdk.GraphAPI(oauth_token)

How do you post to Facebook using the Facebook Python SDK? I tried to do it using:

self.Faceboo开发者_如何学Pythonk = 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消