在验证请求访问 Twitter API v2 端点时

huangapple go评论78阅读模式
英文:

When authenticating requests to the Twitter API v2 endpoints

问题

我在对Twitter API v2端点进行身份验证时遇到了一条通知。

{
  client_id: 'xxxxxxx',
  detail: '在对Twitter API v2端点进行身份验证时,您必须使用与项目关联的Twitter开发者应用的密钥和令牌。您可以通过开发者门户创建一个项目。',
  registration_url: 'https://developer.twitter.com/en/docs/projects/overview',
  title: '客户端被禁止',
  required_enrollment: '适当的API访问级别',
  reason: 'client-not-enrolled',
  type: 'https://api.twitter.com/2/problems/client-forbidden'
}

我正在使用免费套餐。请指导我如何解决这个问题!
我在这里使用的代码片段 链接在这里

英文:

I am encountering a notification while authenticating requests to the Twitter API v2 endpoints.

{
  client_id: 'xxxxxxx',
  detail: 'When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.',
  registration_url: 'https://developer.twitter.com/en/docs/projects/overview',
  title: 'Client Forbidden',
  required_enrollment: 'Appropriate Level of API Access',
  reason: 'client-not-enrolled',
  type: 'https://api.twitter.com/2/problems/client-forbidden'
}

I am using the free tier. Please guide me on how to resolve this!
I use the code snippet here.

答案1

得分: 1

根据这份最新的Twitter API摘要,免费层级不允许获取推文,这似乎是您尝试做的事情。

您至少需要基本访问层级,这是不免费的。您可以在开发者门户的仪表板中订阅它,即https://developer.twitter.com/en/portal/dashboard

您需要拥有一个项目,您的应用程序应该在该项目中。该应用程序应该仅使用V2 API,除媒体上传和v1.1 OAuth之外的所有内容,因为其他v1.1 API不再可用。

值得查看一下Twitter开发者论坛上的最新公告,以便了解消费Twitter API的当前要求。

此外,论坛目前充斥着有关迁移到最新层级、V2 API以及处理似乎在Twitter开发者帐户上发生的技术故障的问题,因此对于许多问题,可能已经存在解决方案,或者至少有用的提示。Twitter开发者论坛主页:https://twittercommunity.com/

英文:

As documented in this latest summary of Twitter API the Free tier doesn't allow fetching tweets which seems to be what you are trying to do.

You'll need at least the Basic access tier which isn't free. You can subscribe to it in your Dashboard in the Developer Portal i.e. https://developer.twitter.com/en/portal/dashboard

You need to have a Project and your app should be in that Project. The app should only use the V2 API for everything except media upload and the v1.1 Oauth as other v1.1 APIs are no longer available.

It's worth having a look at the latest announcements on the Twitter Developer Forum so that you are up-to-date with the current requirements for consuming Twitter APIs.

Also the forum is currently flooding with questions about migrating to the latest tiers, the V2 API and dealing with the technical glitches that seem to occur on Twitter developer accounts, so for many issues there may already be solutions or at least useful hints. The Twitter Developer Forum main page: https://twittercommunity.com/

huangapple
  • 本文由 发表于 2023年6月16日 10:49:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76486671.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定