I use the casting API for TwitPic , and when I try to upload the image, I get a 401 error with the message "You could not authenticate (header rejected by twitter)."
My headers (extracted from the HTTP Request2 object):
Array ( [user-agent] => HTTP_Request2/2.0.0 (http://pear.php.net/package/http_request2) PHP/5.2.17 [x-verify-credentials-authorization] => OAuth realm="http://api.twitter.com/", oauth_consumer_key="****************", oauth_signature_method="HMAC-SHA1", oauth_token="#########-******************", oauth_timestamp="1325192643", oauth_nonce="***********", oauth_version="1.0", oauth_signature="****************%3D" [x-auth-service-provider] => https://api.twitter.com/1/account/verify_credentials.json [content-type] => multipart/form-data )
I made sure the verify_credentials signature uses GET and I see no other problems.
What am I doing wrong?
Thanks:)
EDIT : Here is my source code.
$venue = $this->Venue->findById($venueId); $twitterData = json_decode($venue['Venue']['twitter_data']); $token = $twitterData->token; $secret = $twitterData->secret; $this->Twitter->loginTwitterUser($token, $secret); require_once(WWW_ROOT.'twitpic/TwitPic.php'); $twitpic = new TwitPic('**********', '*******', '*********', $token, $secret); $result['result'] = $twitpic->upload(array('media'=> '/home/todays/public_html/tsm/app/webroot/files/uploads/LOGOA7V1_10.png', 'message'=> 'test'));
And I'm sure that the credentials of the token, secrets and applications are correct, as they work in my Twitter API without any problems. I also double checked the Twitpic API key.
source share