HI, Thanks for the reply.
My problem yet not solved. I’m tring to register using PHP. Here is the code.
function getParamas(){
$params = array(
‘oauth_consumer_key’ => ‘Consumer Key (API Key)’,
‘oauth_signature_method’ => ‘HMAC-SHA1’,
‘oauth_timestamp’ => time(),
‘oauth_nonce’ => time(),
‘url’ => ‘base64 encoded Callback URL’
);
$post_string = '';
foreach($params as $key => $value)
{
$post_string .= $key.'='.($value).'&';
}
$post_string = rtrim($post_string, '&');
$base_string = rawurlencode($post_string);
$signature = base64_encode(hash_hmac('sha1', $base_string, 'Consumer Secret (API Secret)', true));
$params['oauth_signature'] = $signature;
return $params;
}
$ch = curl_init();
$curlConfig = array(
CURLOPT_URL => “https://api.twitter.com/1.1/account_activity/webhooks.json”,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => getParamas(),
);
curl_setopt_array($ch, $curlConfig);
$result = curl_exec($ch);
curl_close($ch);
This throws {“errors”:[{“code”:215,“message”:“Bad Authentication data.”}]} error. Not getting where I’m going wrong.