gpt4 book ai didi

rest - Twitter 休息 API : 404 No user matches for specified terms

转载 作者:行者123 更新时间:2023-12-04 08:55:04 24 4
gpt4 key购买 nike

Twitter 一次最多允许 100 个用户 ID 来查询用户个人资料信息。但是如果其中有一个无效的 ID,它会返回:

404 (Not Found), No user matches for specified terms

不指定哪个是错误 ID,并且不会为列表中的其余用户返回任何数据。如果列表中的用户关闭了他们的帐户,就会发生这种情况。

有没有一种方法可以识别无效ID,而无需再次逐个遍历列表(并且可能达到速率限制)?

最佳答案

https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-lookup.html

  • If a requested user is unknown, suspended, or deleted, then that user will not be returned in the results list.
  • If none of your lookup criteria can be satisfied by returning a user object, a HTTP 404 will be thrown.


根据我的理解,这意味着:
  • 如果您请求 10 个 userId,其中 1 个被挂起,则该请求仍应返回 9 个结果
  • 如果您请求 2 个用户 ID 并且它们都被挂起,则请求将返回该错误

  • 我做了一个快速测试,它似乎像描述的那样工作。
    可能是您请求中的所有 ID 都无效?

    关于rest - Twitter 休息 API : 404 No user matches for specified terms,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32260048/

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