共用方式為


版本控制

每個用戶端要求都必須提供明確的 API 版本作為查詢字串參數。 例如:https://{myconfig}.azconfig.io/kv?api-version=1.0

api-version 以 SemVer (major.minor) 格式表示。 不支援範圍或版本交涉。

本文章適用於 API 版本 1.0。

下列概述當要求之 API 版本不相符時,由伺服器所傳回可能的錯誤回應摘要。

未指定的 API 版本

當用戶端提出要求,但沒有提供 API 版本時,就會發生此錯誤。

HTTP/1.1 400 Bad Request
Content-Type: application/problem+json; charset=utf-8
{
  "type": "https://azconfig.io/errors/invalid-argument",
  "title": "API version is not specified",
  "name": "api-version",
  "detail": "An API version is required, but was not specified.",
  "status": 400
}

不支援的 API 版本

當用戶端要求的 API 版本與伺服器所支援的任何 API 版本都不相符時,就會發生此錯誤。

HTTP/1.1 400 Bad Request
Content-Type: application/problem+json; charset=utf-8
{
  "type": "https://azconfig.io/errors/invalid-argument",
  "title": "Unsupported API version",
  "name": "api-version",
  "detail": "The HTTP resource that matches the request URI '{request uri}' does not support the API version '{api-version}'.",
  "status": 400
}

不正確的 API 版本

當用戶端向 API 版本提出要求,但值的格式錯誤或無法由伺服器剖析時,就會發生此錯誤。

HTTP/1.1 400 Bad Request
Content-Type: application/problem+json; charset=utf-8  
{
  "type": "https://azconfig.io/errors/invalid-argument",
  "title": "Invalid API version",
  "name": "api-version",
  "detail": "The HTTP resource that matches the request URI '{request uri}' does not support the API version '{api-version}'.",
  "status": 400
}

不明確的 API 版本

當用戶端要求對伺服器來說不明確的 API 版本時,就會發生此錯誤 (例如:多個不同的值)。

HTTP/1.1 400 Bad Request
Content-Type: application/problem+json; charset=utf-8
{
  "type": "https://azconfig.io/errors/invalid-argument",
  "title": "Ambiguous API version",
  "name": "api-version",
  "detail": "The following API versions were requested: {comma separated api versions}. At most, only a single API version may be specified. Please update the intended API version and retry the request.",
  "status": 400
}