简体   繁体   English

Twitter搜索API身份验证错误

[英]Twitter search API authentication error

I need to build a simple web application that gets live data from an API, such as twitter search. 我需要构建一个简单的Web应用程序,该应用程序可以从API(例如twitter搜索)获取实时数据。 I am reading about how to go about this in Javascript (I am not allowed to use jQuery for this assignment). 我正在阅读有关如何在Javascript中进行操作的信息(不允许使用jQuery进行此作业)。 Let's say I want to gather tweets about Bernie Sanders. 假设我想收集有关伯尼·桑德斯的推文。 I just want to see the JSON data in my browser window, but when I paste in the link hit enter, I get the error: 我只想在浏览器窗口中查看JSON数据,但是当我粘贴链接时,按回车键,我得到了错误:

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

The link I used was https://api.twitter.com/1.1/search/tweets.json?q=Bernie%20Sanders&src=typd . 我使用的链接是https://api.twitter.com/1.1/search/tweets.json?q=Bernie%20Sanders&src=typd From what I have read, it has to do with 1.1 and Oauth, so I registered an application on twitter and jotted down the consumer and access keys, but I am not sure what to do with them. 据我了解,它与1.1和Oauth有关,因此我在Twitter上注册了一个应用程序,并记下了使用者和访问密钥,但是我不确定该如何处理。 I really do not know where to begin. 我真的不知道从哪里开始。 If someone could point me in the right direction, I would greatly appreciate it. 如果有人能指出我正确的方向,我将不胜感激。

您必须遵循OAuth 1.0协议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM