loganfynne
loganfynne

Reputation: 97

Facebook Python SDK

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?

Upvotes: 1

Views: 2114

Answers (1)

Femi
Femi

Reputation: 64700

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.

Upvotes: 1

Related Questions