In 1.1 version, Bad Authentication data Problem


#1

this have been processed when i call the below url(Version 1.0)

http://api.twitter.com/1/statuses/user_timeline.json
?oauth_consumer_key=**********
&oauth_consumer_secret=*********
&oauth_nonce=******
&oauth_signature_method=HMAC-SHA1
&oauth_signature=********
&oauth_timestamp=******
&oauth_token=*****
&oauth_token_secret=*******
&oauth_version=1.0
&screen_name=*****

so,
it is the command when i call the below url(Version 1.1)
what is this error?

message: “Bad Authentication data”,
code: 215

http://api.twitter.com/1.1/statuses/user_timeline.json
?oauth_consumer_key=**********
&oauth_consumer_secret=*********
&oauth_nonce=******
&oauth_signature_method=HMAC-SHA1
&oauth_signature=********
&oauth_timestamp=******
&oauth_token=*****
&oauth_token_secret=*******
&oauth_version=1.1
&screen_name=*****

please, i need help
please, if you know the problem, can you tell me.


#2

1.1 is stricter about proper HTTP and OAuth. I strongly recommend using HTTP header-based auth instead of query-sting based.

Looking at what you’re presenting here, you’re passing an oauth_version of 1.1 – our OAuth version is stil 1.0, and that might be your trouble.


#3

thank you
I was replace the oauth_version
1.1 -> 1.0

after replace the oauth_version
the rest api version 1.0 is no problem.(http://api.twitter.com/1/statuses/user_timeline.json)

if processing the url(http://api.twitter.com/1.1/statuses/user_timeline.json)
, occured below command

message: “Could not authenticate you”,
code: 32
what is this error?

do I call the below url?

https://api.twitter.com/1.1/statuses/user_timeline.json
?oauth_consumer_key=W9tidd7HtSaIXCdQqS5Xyw
&oauth_nonce=-388262246
&oauth_signature_method=HMAC-SHA1
&oauth_timestamp=1360897877
&oauth_token=146323446-kDbSuVET38e0QmxgrpLCNNADJpVrIjxlnXrcu0bn
&oauth_version=1.0
&screen_name=*******


#4

sorry, url is the below query

http://api.twitter.com/1.1/statuses/user_timeline.json
?oauth_consumer_key=DC0sePOBbQ8bYdC8r4Smg
&oauth_signature_method=HMAC-SHA1
&oauth_timestamp=1361086380
&oauth_nonce=1617055614
&oauth_version=1.0
&oauth_token=146323446-vZ2MoxvQg07syAbgKgWtdFYbkddU1k4ybrMzFrfz
&oauth_signature=guToVCmCmv4KDiBRVtdzQ50z%2BV0%3D
&screen_name=jfluke_hyun_jin


#5

Are you able to make other API calls with this access token? What happens with /1.1/account/verify_credentials.json? It’s unfortunately not possible to know what’s going wrong with just this information – I do recommend switching to using HTTP headers for auth instead. What library are you using for this?


#6

FOUND A SOLUTION - using the Abraham TwitterOAuth library. If you are using an older implementation, the following lines should be added after the new TwitterOAuth object is instantiated:

$connection->host = "https://api.twitter.com/1.1/"; $connection->ssl_verifypeer = TRUE; $connection->content_type = 'application/x-www-form-urlencoded';

The first 2 lines are now documented in Abraham library Readme file, but the 3rd one is not. Also make sure that your oauth_version is still 1.0.


#7

JQTWEET = {

// Set twitter username, number of tweets & id/class to append tweets
user: 'serhatakti',
numTweets: 5,
appendTo: '.twitter .span12',

// core function of jqtweet
loadTweets: function() {
    $.ajax({
        url: 'https://api.twitter.com/1/statuses/user_timeline.json',
        type: 'GET',
        dataType: 'jsonp',
        data: {
            screen_name: JQTWEET.user,
            include_rts: true,
            count: JQTWEET.numTweets,
            include_entities: true
        },
        success: function(data, textStatus, xhr) 
        {
             var html = '<div class="tweet">TWEET_TEXT <span class="label label-inverse">AGO</span></div>';
             
             // append tweets into page
             $(JQTWEET.appendTo).empty();
             for (var i = 0; i < data.length; i++) {
            	 $(JQTWEET.appendTo).append(
            			 html.replace('TWEET_TEXT', JQTWEET.ify.clean(data[i].text) )
            			 	 .replace(/USER/g, data[i].user.screen_name)
            			 	 .replace('AGO', JQTWEET.timeAgo(data[i].created_at) )
        			 	 	 .replace(/ID/g, data[i].id_str)
                );
             }
             
             if ($('.twitter .tweet').size() > 1)
        	 {
                 $('.twitter .tweet').hide();
                 $('.twitter .tweet:first').show().addClass('active');
                 setInterval(function(){
                	 var i = $('.twitter .tweet.active').index('.twitter .tweet');
                	 var ni = $('.twitter .tweet').eq(i+1).index('.twitter .tweet');
                	 if (ni == -1) i = -1;
                	 $('.twitter .tweet.active').hide().removeClass('active');
                	 $('.twitter .tweet').eq(i+1).show().addClass('active');
                 }, 3000);
        	 }
        }

    });
},

What is the problem? it was working with 1.0


#8

Does anybody has the authentication library for C++ language? I need it for the API 1.1 for my arduino microcontroller ! Thank you so much !


#9
time = new Date(); Ext.Ajax.request({ url: 'https://api.twitter.com/1.0/search/tweets.json', method: 'GET', params: { data: { input: 'innofied' }, header: { Authorization: "OAuth", oauth_consumer_key:"IfjaAa6iCNYvcwIsa9kTg", oauth_nonce:"36ffab18d15a5f0442615cce0efe55b3", oauth_signature:"cR%2Bn4cqEm3Ayji2gmcFSQC1U0h4%3D", oauth_signature_method:"HMAC-SHA1", oauth_timestamp:time.getTime(), oauth_token:"335386060-kzEAT99JvC1GilEtAZQhQqMz3Q3PDlZHZa06O3sN", oauth_version:"1.0" } }, callback: function(options, success, response) { console.log(response.responseText); } });

I also get the same type of error… please HELP


#10

You’re going to find it difficult to use API v1.1 in Javascript like this. One issue you have is that you’re addressing version “1.0” of the API in your search/tweets URL – which doesn’t exist. That should be “1/.1”

When you set the oauth_timestamp, you should be doing so in the algorithm that is creating your signature base string and signature – by setting it based on the current time while creating the header, you’re going to create a mismatch with the time when you created your signature base string. How are you generating your signature?


#11

[node:126] has at least one C++ library you can use for Twitter and/or OAuth.


#12

I think the problem is with the API. I too have tried with several combination however nothing works

SEEMS NO ONE IN TWITTER ARE INTERESTED IN FIXING THIS ISSUE.


#13

I have the same error. And in my App OAuth Settings, there is this default value “https://api.twitter.com/1/” into the “Request URI: *” field, and I can’t change it. Why 1 and not 1.1?

Anyway, one Wordpress plugin works for me, but not some themes which have a Twitter Widget with the following fields: consumer key, consumer secret, access token key and access token secret. I’m also trying to create my own ‘last-tweets’ widget but it’s more difficult using API 1.1.

EDIT: Hi! I solved it! I had to install cURL PHP module on my local server (localhost). Now works fine, except the Twitter connection because is slow when loading.


#14

Hi ,

It is not possible to fetch the user details via twitter API1.1 it is getting a response as bad authentication error code 215 what to do? is there any solution to solve this problem?


#15

Did you get the solution ? Am facing the sae problem, Please help anyone.


#16

hi,Sir
I am Developing Celebrate I phone Apps.

how to display celebrate Tweets in Tableview .

please tele me.

#17

I am unable to get the data trends. i got bad authentication data error. I didn’t understand how to get the trends.
https://api.twitter.com/1.1/statuses/user_timeline.json?oauth_consumer_key=3DuR07zaluW8FRm8WJXRx0NvKL1&oauth_consumer_secret=9bErkIGBkz4UD6cFq8Rg3xV3JGvFZV0XtQdFpmA2IyTIaDWLur&oauth_nonce=a4e4ab54a0ce77da1959a372c608323a&oauth_signature_method=HMAC-SHA1&oauth_signature=b6poICk5d%2BZwt2zqLNqBSZGREmE%3D&oauth_timestamp=1401182744&oauth_token=3D2336536615-btJkYzPG7rhXkt88PLOl3Hf5vKfXthm4beCVQqg&oauth_token_secret=Co98Hy0UbmCjrqCF3ZO8J0Sqq1oV1vh7LPD9JarQ5bJHX&oauth_version=1.1&screen_name=dotndotaruna