I am using twitter api using Auth 1.0 and it is working well when using url = 'https://api.twitter.com/1.1/statuses/home_timeline.json' but when I am using https://api.twitter.com/1.1/search/tweets.json?q=nasa&result_type=popular api its returning
{
"errors": [
{
"code": 32,
"message": "Could not authenticate you."
}
]
}
Now I am not understanding why it is happening... Following is the header I am making:
function buildRequestHeader(httpMethod, URL) {
parameters = {
oauth_consumer_key: CONSUMER_KEY,
oauth_token: ACCESS_TOKEN,
oauth_nonce: getNonce(),
oauth_timestamp: getTimestamp(),
oauth_signature_method: 'HMAC-SHA1',
oauth_version: '1.0',
},
signature = oauthSignature.generate(httpMethod, URL, parameters, CONSUMER_SECRET, ACCESS_TOKEN_SECRET,{ encodeSignature: false }),
authString = 'OAuth oauth_consumer_key=' + parameters.oauth_consumer_key + ',oauth_token=' + parameters.oauth_token + ',oauth_signature_method=HMAC-SHA1,oauth_timestamp=' + parameters.oauth_timestamp + ',oauth_nonce=' + parameters.oauth_nonce + ',oauth_version=1.0,oauth_signature=' + encodeURIComponent(signature);
return authString;
console.log('>>>>>>>', authString);
}
It is returning me header for twitter which is working well for url = 'https://api.twitter.com/1.1/statuses/home_timeline.json' but error code 32 for https://api.twitter.com/1.1/search/tweets.json?q=nasa&result_type=popular api.Thank you .Any help will be appr