1
votes

I am trying to call following Twitter's API to get a list of followers for a user.

http://api.twitter.com/1.1/followers/ids.json?cursor=-1&screen_name=username

And I am getting this error message in response.

{
    code = 215;
    message = "Bad Authentication data";
}

I can't seem to find the documentation related to this error code. Anyone has any idea about this error?

3
You need OAuth authorization for twitter. If you google, you should be able to find a twitter library for swift that can handle the authentication for you.imlokesh

3 Answers

1
votes

Your request lacks authentication data. I got that error when I simply clicked on http://api.twitter.com/1.1/followers/ids.json?cursor=-1&screen_name=username. This is not the way to access twitter API.

Create a Twitter app from https://apps.twitter.com/. Then, try using a Twitter API Library to access REST API. If you are comfortable with using ruby apps on command line interface check out https://github.com/sferik/t. Set it up and then try t followers [USER] for listing all followers of USER.

0
votes

You will have to use OAuth. More info can be found on Twitter website. Here: https://dev.twitter.com/oauth

-1
votes

This error is coming because your Twitter developers account is not approved. Now-a-days you can't make app without getting your developers account approved from Twitter.

To make an app, you need to contact Twitter and apply for developers account. If you are lucky engough, you will get approval although this process may take months.

If you just need the data, go for third party services like followersanalysis[dot]com, birdsonganalytics[dot]com