错误

错误对象

无论原因如何,每个失败都是同一种结构:

403
{
  "error": {
    "code": "scope_required",
    "message": "This key is not allowed to perform that action.",
    "details": {
      "scope": "keywords:write"
    }
  },
  "request_id": "req_d3428e686099bb0e"
}

code

状态code含义
401missing_api_key未发送密钥
401invalid_api_key没有这个密钥;请检查拼写
401key_revoked密钥曾存在但已吊销;请联系发放密钥的人
402plan_limit达到了套餐上限。details.resource 为 targets 或 keywords,附 limit 和 current
403scope_required密钥缺少某个 scope;details.scope 指明是哪个
404not_subscribed你没有监控该账号;解析失败时会附加 details.state: "failed"、details.reason 和 details.failed_at
404user_not_foundX 上没有这个账号:从未注册、已删除或已停用
404user_suspended该账号已被 X 封禁
404user_protected该账号的帖子受保护(仅对批准的关注者可见),因此无法监控
404tweet_not_found没有这条帖子,或它已被删除
404not_found没有这个资源
409idempotency_key_reuse同一个 Idempotency-Key 已用于不同的请求
409conflict资源所处的状态不允许此更改;details.reason 说明原因
422invalid_request请求体或查询未通过校验。作为 422 时,details.fields 指出每个有问题的字段;作为 400 时,是我们能解析但不能接受的值
429rate_limited你的每分钟请求预算已用完;Retry-After 说明何时恢复
429quota_exhausted该读取触到了上游限制;Retry-After 说明何时恢复
502upstreamX 未按预期响应。通常是暂时的;请重试
500internal我们的问题。把 request_id 发给我们