I am using themattharris’ OAuth PHP library (which works perfectly by the way), but I stumbled upon a problem during the OAuth authentication.
When I try to tweet something, I get the following error message;
stdClass Object ( [error] => Could not authenticate with OAuth. [request] => /1/statuses/update.json )
I am using the following code to tweet;
<?php require 'tmh/tmhOAuth.php'; require 'tmh/tmhUtilities.php'; $tmhOAuth = new tmhOAuth(array( 'consumer_key' => 'XXXXXXXXXXX', 'consumer_secret' => 'XXXXXXXXXXXXXXXXXXXXXX', 'user_token' => 'XXXX-XXXXXXXXXXXXXXXXXXX', 'user_secret' => 'XXXXXXXXXXXXXXXXXXXXXX')); $code = $tmhOAuth->request('POST', $tmhOAuth->url('1/statuses/update'), array('status' => 'My Twitter Message')); tmhUtilities::pr(json_decode($tmhOAuth->response['response'])); ?>
I copied all tokens, keys & secrets from the My Applications page into the file, but it does not seem to work.
What’s going wrong here? I am almost 100% certain it has nothing to do with the library.
Any help is much appreciated!