Twitter API 错误 215 [英] Twitter API error 215

查看:19
本文介绍了Twitter API 错误 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

知道这是怎么回事吗?

谢谢,米奇

推荐答案

所以,似乎 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-时间线-oauth/

我已按照上述文章中的步骤操作,可以确认它运行良好.

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

需要注意的一个有趣点是,现在,因为您必须使用访问令牌秘钥;所有请求都必须使用服务器端脚本进行.在此之前,我使用 jQuery 直接在 Twitters JSON API 上发出 AJAX 请求.现在,如果您想走 Javascript 路线,您必须在自己的网站上通过 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆