Twitter API错误215 [英] Twitter API error 215
问题描述
今天,我们发现我的一位客户的Twitter提要已损坏.
Today, we discovered one of my clients Twitter feeds became broken.
我尝试切换为使用新的API 1.1,但是出现以下错误:
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
我正在参考以下文档.
https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline
你知道这是怎么回事吗?
Any idea what's up with this?
谢谢, 米奇
推荐答案
因此,似乎Twitter的最新API 1.1在未经身份验证的情况下不允许访问-即使对于看似公开的数据也是如此...时间轴上的最新3条推文.
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.
值得注意的是,现在,因为您必须使用访问令牌和秘密密钥;所有请求都必须使用服务器端脚本进行.在此之前,我使用jQuery直接在Twitters JSON API上发出AJAX请求.现在,如果您希望使用Java脚本,则必须在自己的网站上请求AJAX动态脚本.
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.
这篇关于Twitter API错误215的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!