Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter API error 215

Tags:

json

twitter

Today, we discovered one of my clients Twitter feeds became broken.

I have tried switching to using the new API 1.1, but get the following error:

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

Even using their own example generates the same response:

https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi&count=2 

I am referencing the following documentation.

https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline 

Any idea what's up with this?

Thanks, Mikey

like image 379
Michael Giovanni Pumo Avatar asked Jun 17 '13 09:06

Michael Giovanni Pumo


People also ask

What does 403 Forbidden mean on twitter?

Corresponds with HTTP 403. Thrown when a Tweet cannot be posted due to the user having no allowance remaining to post. Despite the text in the error message indicating that this error is only thrown when a daily limit is reached, this error will be thrown whenever a posting limitation has been reached.

How do I get high access twitter API?

All Twitter API access requires a developers account, which can be created quickly by signing up. Essential access will be available immediately, and Elevated access can be requested.

How do I use Twitter API in Postman?

To add your keys and tokens to the “Twitter API v2” environment, click on the “manage environments” button in the top right corner of Postman., you will need to click on the settings button in the top right corner. From the list of environments, click on “Twitter API v2”.


1 Answers

So, it seems Twitter's latest API 1.1 does not allow access without authentication - even for data that is seemingly public...like the latest 3 tweets from a timeline.

The best article I have found on this (which gives a great solution) for read-access can be found here:

http://www.webdevdoor.com/php/authenticating-twitter-feed-timeline-oauth/

I have followed the steps in the article above and can confirm it works great.

An interesting point to note, is that now, because you have to use access tokens and secret keys; all requests must be made with a server-side script. Prior to this I was using jQuery to make an AJAX request on Twitters JSON API directly. Now, you must AJAX request a dynamic script on your own website, if you wish to go down a Javascript route.

like image 99
Michael Giovanni Pumo Avatar answered Sep 17 '22 13:09

Michael Giovanni Pumo