I followed the instructions in the manual, and I don’t get any errors, but the php cURL function isn’t returning JSON. It just returns 1. Any ideas?
Thanks.
Here is the code I am using:
$consumerKey = urlencode('consumerKey');
$consumerSecret = urlencode('consumerSecret');
$consumerConcatination = $consumerKey . ':' . $consumerSecret;
$encoded = base64_encode($consumerConcatination);
$array['grant_type'] = 'client_credentials';
$ch = curl_init("https://api.twitter.com/oauth2/token");
curl_setopt($ch, CURLOPT_USERAGENT, 'TweetWordCount v0.1');
curl_setopt($ch, CURLOPT_POSTFIELDS, $array);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Basic $encoded Content-Type: application/x-www-form-urlencoded;charset=UTF-8",'Content-Length:500'));
curl_exec($ch);
curl_close($ch);