Bad Authentication data with api.twitter.com/1.1/search/tweets.json


#1

Hi,

I try to get tweets for a user. I use codebird, a javascript library.
When i execute the request, i get this error :

{"errors":[{"message":"Bad Authentication data","code":215}]}

Is-it possible to try a request directly in a browser ? I have tried to put my request in my browser and i get the same error. Here is my request :

https://api.twitter.com/1.1/search/tweets.json?q=@__Erwan&oauth_consumer_key=xxxxxx&oauth_nonce=xxxxxx&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1360093219&oauth_token=355663865-xxxx&oauth_version=1.0

Could you help me please ?

Thanks in advance :slight_smile:


#2

We discourage using API v1.1 in client-side Javascript. OAuth 1.0A is not secure for use in that context.

It looks like this request is probably failing because you’re not URL encoding the “@” sign in your query string, causing the signature base string to also not be valid.


#3

I currently have a Javascript client in the making that obscures the consumer secret by doing all the signing logic in a server-side PHP script, or in case of POSTs do the request via the server entirely.

This makes it more secure than for instance many Android apps, who have their consumer secrets as a plain static member or even as a string resource in xml.

Still I’m having difficulty getting the right combination of URL encoding going on.
URLs that work on the Android app don’t work in Javascript (I’m using jQuery).

Other endpoints do work for me, so it probably has to do with the encoding of the query.
Java and Javascript URL encoding differ a bit. Are you aware of anything with this that could cause this?

Thanks in advance.


#4

Javascript’s default URL encoding methods aren’t always sufficient for OAuth 1.0A. This article has some hints on these: http://www.marcworrell.com/article-2943-en.html – if you have some particular strings you’d like to work through, I’m happy to.


#5

how to get the oauth_timestamp dynamically in program in android


#6

Hi, I’m having the same problem. Both on server side and from the browser. I’m encoding the parameters using twitter4J OAuthAuthorization.encodeParameters. When I copied the url and paste it to the browser it gave me the same error code.

My url was
https://api.twitter.com/1.1/search/tweets.json?count=10&lang=en&q=xfactor&
oauth_token=210XXXX54-CXXXXXXXXXXXXXXXXXXXc&
oauth_consumer_key=KXXXXXXXXXXXXXXXXXXXXXXXXXg&
oauth_signature_method=HMAC-SHA1&
oauth_timestamp=1372131361&
oauth_nonce=1008433096&
oauth_version=1.0&
oauth_signature=IYlDEv0tlrmqy8QudjKdreB%2FPjk%3D


#9

ditto, wasted several hours at a hackathon, the error messages are also pretty useless.

{
errors: [
{
message: “Could not authenticate you”,
code: 32
}
]
}

pasted in the keys you gave me and still get this…


#11

I am trying to understand what’s going on for last 12 hours but documentation definitely doesn’t help. Please, Do any one knows how to get search api working? I’ve spend a lot of hours to make an oAuth process work. So what and where should I do after to finally get results from search api? It is so frustrated=(


#12

i am also facing same issue and when i get the twitter4J version 3.0.5 mine problem resolved


#13

Spent already 2 days trying to work my way around with the new API. Total confusion! Usually new APIs either make stuff easier or clean up some messed up stuff. Feels the opposite is happening with the 1.1.
Anybody with cool tweak to this plz let me know!


#14

I am working on the sample Twitter Api in this
http://java.dzone.com/articles/android-twitter-api-11 but it is showing error like this
{“errors”:[{“message”:“Bad Authentication data”,“code”:215}]} what can i need to do to make the sample code work perfectly.can u please let me know where i am doing mistake. waiting for reply.
Thanks in advance.


#16

hi
I meet this issue
{“errors”:[{“message”:“Bad Authentication data”,“code”:215}]}


#17

Hello All,

We are getting the same issue here, it was worked will before few days, but now we are getting this issue.


#18

I am getting the same issue here,


#19

I am getting the same issue here, help meeeeeeeeeeeeeeeeee please


#20

I am also getting the same issue, twitter must resolve it to use the twitter api…


#21

Error: Bad Authentication data
What does it mean and how do I fix it?


#22

what the hell twitter, did your developers abandon your API?


#23

pls help me… i have a same issue


#24

what language? how are you handling Oauth? can you provide a sample?