gpt4 book ai didi

java - Android 开发中的 Twitter JSON API

转载 作者:太空宇宙 更新时间:2023-11-03 10:48:34 24 4
gpt4 key购买 nike

我开始从事 Android 开发已有一段时间了。根据我正在尝试从 Twitter API 中删除 JSON 信息的教程...

按照教程中的说明,这是要使用的代码:

"http://api.twitter.com/1/statuses/user_timeline.json?screen_name= 写用户名"

但是,我收到回复说 API 不再可用,我应该迁移到 API v1.1。

谁能帮助我如何替换我被指示使用的 url?

注意当我使用 API v1.1 中的新 url 时:“https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi&count=2

我得到以下信息:

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

最佳答案

旧的 Twitter API 不需要身份验证来检索 user_timeline,但是 v1.1 需要身份验证来检索数据 ( https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline )。根据 Twitter API 文档,所有 API v1.1 请求都需要用户身份验证。

您可以在此处阅读有关身份验证的更多信息 https://dev.twitter.com/docs/auth/oauth#v1-1

关于java - Android 开发中的 Twitter JSON API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18040038/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com