HTTP/1.1 401 Authorization Required - https://stream.twitter.com/1.1/statuses/filter.json

authorization

#1

I’m trying to post it using https://stream.twitter.com/1.1/statuses/filter.json.

$m_oauth_signature_method = ‘HMAC-SHA1’;
$this->m_oauth_nonce = md5(mt_rand());
$this->m_oauth_timestamp = time();
$this->m_oauth_version = ‘1.0’;

$base_string = ‘POST&’ .
rawurlencode(‘https://stream.twitter.com/1.1/statuses/filter.json’) . ‘&’ .
rawurlencode(‘oauth_consumer_key=’ . $this->m_oauth_consumer_key . ‘&’ .
‘oauth_nonce=’ . $this->m_oauth_nonce . ‘&’ .
‘oauth_signature_method=’ . $this->m_oauth_signature_method . ‘&’ .
‘oauth_timestamp=’ . $this->m_oauth_timestamp . ‘&’ .
‘oauth_token=’ . $this->m_oauth_token . ‘&’ .
‘oauth_version=’ . $this->m_oauth_version . ‘&’ .
$data);
still getting error,HTTP/1.1 401 Authorization Required why ? please help me


#2

This does indeed sound like an authorization issue.
Are you using the proper auth keys generated from a Twitter app and generating oauth nonce , oauth_signature , and oauth_timestamp properly?