On page https://dev.twitter.com/oauth/application-only — SSL absolutely required
what does that mean? Do i have to have SSL and Certificate setup on my webhost account when sending out requests to twitter?
“peers should always be verified.” is that the reason i get "Unable to verify your credentials"
when trying to follow “Application-only authentication”, all i want to do is search stuff on twitter programmatically…
or is there any piggy back sites out there that share there urls with json responses, to search twitter, with out all this trouble…it was so easy a few years ago…any help would be a god sent…
[errors] => Array
 => Array
[label] => authenticity_token_error
[code] => 99
[message] => Unable to verify your credentials
public function getBearerToken()
$headers = array('POST'=> '/oauth2/token HTTP/1.1', 'Host'=> 'https://api.twitter.com', 'User-Agent'=> 'My Twitter App v1.0.23', 'Authorization'=>'Basic '.$this->encodeKeys(), 'Content-Type'=>'application/x-www-form-urlencoded;charset=UTF-8', 'Content-Length'=>strlen('Basic '.$this->encodeKeys()), 'Accept-Encoding'=>'gzip'); $url = "https://api.twitter.com/oauth2/token?grant_type=client_credentials"; $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST,TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER,TRUE); $result = curl_exec($ch); curl_close($ch); print_r(json_decode($result,TRUE)); }