Error Code v2

开发
HTTP/2 400
Content-Type: application/problem+json

{
  "error": {
    "status": 400,
    "type": "a URL that identifies the error type.",
    "title": "a short summary of this error.",
    "detail": "a human-readable explanation for this error.",
    "invalidParams": [
      [
        "invalid or missing params",
        "only available for 400 errors"
      ]
    ]
  }
}

和风天气现已经发布错误码v2版本,新版本将你可能遇到的API错误进行了细分和更加详细的描述,以便开发者可以更容易了解错误的原因,同时也将HTTP Status Code与错误码保持了一致。

我们将从即日起陆续将错误码v2版本迁移至所有API,预计在2025年底前,所有API将应用错误码v2,具体的迁移计划如下:

在迁移期间,你会发现不同的项目或API可能返回了不同版本的错误码。

错误码v2的开发文档提供的了新旧版本的详细描述、示例和对比,请参考 https://dev.qweather.com/docs/resource/error-code/

相关文章