Apis - Get

取得其識別碼所指定的 API 詳細數據。

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}?api-version=2022-08-01

URI 參數

名稱 位於 必要 類型 Description
apiId
path True

string

API 修訂標識碼。 目前 API 管理 服務實例中必須是唯一的。 非目前的修訂具有 ;rev=n 作為後置詞,其中 n 是修訂編號。

Regex pattern: ^[^*#&+:<>?]+$

resourceGroupName
path True

string

資源群組的名稱。 名稱不區分大小寫。

serviceName
path True

string

API 管理 服務的名稱。

Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

目標訂用帳戶的標識碼。

api-version
query True

string

用於此作業的 API 版本。

回應

名稱 類型 Description
200 OK

ApiContract

回應主體包含指定的 API 實體。

Headers

ETag: string

Other Status Codes

ErrorResponse

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

ApiManagementGetApiContract
ApiManagementGetApiRevisionContract

ApiManagementGetApiContract

Sample Request

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a?api-version=2022-08-01

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a",
  "type": "Microsoft.ApiManagement/service/apis",
  "name": "57d1f7558aa04f15146d9d8a",
  "properties": {
    "displayName": "Service",
    "apiRevision": "1",
    "serviceUrl": "https://api.plexonline.com/DataSource/Service.asmx",
    "path": "schulte",
    "protocols": [
      "https"
    ],
    "authenticationSettings": {
      "oAuth2": {
        "authorizationServerId": "authorizationServerId2283",
        "scope": "oauth2scope2580"
      },
      "oAuth2AuthenticationSettings": [
        {
          "authorizationServerId": "authorizationServerId2283",
          "scope": "oauth2scope2580"
        },
        {
          "authorizationServerId": "authorizationServerId2284",
          "scope": "oauth2scope2581"
        }
      ]
    },
    "subscriptionKeyParameterNames": {
      "header": "Ocp-Apim-Subscription-Key",
      "query": "subscription-key"
    },
    "type": "soap",
    "isCurrent": true,
    "isOnline": true
  }
}

ApiManagementGetApiRevisionContract

Sample Request

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api;rev=3?api-version=2022-08-01

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api;rev=3",
  "type": "Microsoft.ApiManagement/service/apis",
  "name": "echo-api;rev=3",
  "properties": {
    "displayName": "Service",
    "apiRevision": "3",
    "serviceUrl": "https://api.plexonline.com/DataSource/Service.asmx",
    "path": "schulte",
    "protocols": [
      "https"
    ],
    "authenticationSettings": {
      "oAuth2": {
        "authorizationServerId": "authorizationServerId2283",
        "scope": "oauth2scope2580"
      },
      "oAuth2AuthenticationSettings": [
        {
          "authorizationServerId": "authorizationServerId2283",
          "scope": "oauth2scope2580"
        },
        {
          "authorizationServerId": "authorizationServerId2284",
          "scope": "oauth2scope2581"
        }
      ]
    },
    "subscriptionKeyParameterNames": {
      "header": "Ocp-Apim-Subscription-Key",
      "query": "subscription-key"
    },
    "apiRevisionDescription": "fixed bug in contract"
  }
}

定義

名稱 Description
ApiContactInformation

API 連絡資訊

ApiContract

API 詳細數據。

ApiLicenseInformation

API 授權資訊

ApiType

API 的類型。

ApiVersionSetContractDetails

API 版本集合包含一組與 API 版本相關的常見組態

AuthenticationSettingsContract

API 驗證設定。

bearerTokenSendingMethods

如何將令牌傳送至伺服器。

ErrorFieldContract

錯誤欄位合約。

ErrorResponse

錯誤回應。

OAuth2AuthenticationSettingsContract

API OAuth2 驗證設定詳細數據。

OpenIdAuthenticationSettingsContract

API OAuth2 驗證設定詳細數據。

Protocol

描述此 API 中的作業可在哪些通訊協定上叫用。

SubscriptionKeyParameterNamesContract

訂用帳戶金鑰參數名稱詳細數據。

versioningScheme

值,決定 API 版本識別碼在 HTTP 要求中的位置。

ApiContactInformation

API 連絡資訊

名稱 類型 Description
email

string

連絡人/組織的電子郵件位址。 必須是電子郵件位址的格式

name

string

聯繫人/組織的識別名稱

url

string

指向聯繫人資訊的 URL。 必須是 URL 的格式

ApiContract

API 詳細數據。

名稱 類型 Description
id

string

資源的完整資源識別碼。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

資源的名稱

properties.apiRevision

string

描述 API 的修訂。 如果未提供任何值,則會建立預設修訂 1

properties.apiRevisionDescription

string

API 修訂的描述。

properties.apiVersion

string

指出 API 的版本識別碼,如果 API 已建立版本設定

properties.apiVersionDescription

string

API 版本的描述。

properties.apiVersionSet

ApiVersionSetContractDetails

版本設定詳細數據

properties.apiVersionSetId

string

相關 ApiVersionSet 的資源標識碼。

properties.authenticationSettings

AuthenticationSettingsContract

此 API 中包含的驗證設定集合。

properties.contact

ApiContactInformation

API 的連絡資訊。

properties.description

string

API 的描述。 可包含 HTML 格式標籤。

properties.displayName

string

API 名稱。 長度必須為 1 到 300 個字元。

properties.isCurrent

boolean

指出 API 修訂是否為目前的 API 修訂。

properties.isOnline

boolean

指出是否可透過閘道存取 API 修訂。

properties.license

ApiLicenseInformation

API 的授權資訊。

properties.path

string

可在 API 管理服務執行個體內唯一識別此 API 及其所有資源路徑的相對 URL。 此路徑會附加至在服務執行個體建立期間所指定的 API 端點基底 URL,以形成此 API 的公用 URL。

properties.protocols

Protocol[]

描述此 API 中的作業可在哪些通訊協定上叫用。

properties.serviceUrl

string

實作此 API 之後端服務的絕對 URL。 長度不能超過 2000 個字元。

properties.sourceApiId

string

來源 API 的 API 識別碼。

properties.subscriptionKeyParameterNames

SubscriptionKeyParameterNamesContract

API 可供使用的通訊協定。

properties.subscriptionRequired

boolean

指定存取 API 是否需要 API 或產品訂用帳戶。

properties.termsOfServiceUrl

string

API 服務條款的 URL。 必須是 URL 的格式。

properties.type

ApiType

API 的類型。

type

string

資源類型。 例如“Microsoft.Compute/virtualMachines” 或 “Microsoft.Storage/storageAccounts”

ApiLicenseInformation

API 授權資訊

名稱 類型 Description
name

string

用於 API 的授權名稱

url

string

用於 API 之授權的 URL。 必須是 URL 的格式

ApiType

API 的類型。

名稱 類型 Description
graphql

string

http

string

soap

string

websocket

string

ApiVersionSetContractDetails

API 版本集合包含一組與 API 版本相關的常見組態

名稱 類型 Description
description

string

API 版本集的描述。

id

string

現有 API 版本集的識別碼。 省略此值以建立新的版本集。

name

string

API 版本集的顯示名稱。

versionHeaderName

string

如果 versioningScheme 設定 header為 ,表示 API 版本的 HTTP 標頭參數名稱。

versionQueryName

string

如果 versioningScheme 設定 query為 ,則為指出 API 版本的查詢參數名稱。

versioningScheme

versioningScheme

值,決定 API 版本識別碼在 HTTP 要求中的位置。

AuthenticationSettingsContract

API 驗證設定。

名稱 類型 Description
oAuth2

OAuth2AuthenticationSettingsContract

OAuth2 驗證設定

oAuth2AuthenticationSettings

OAuth2AuthenticationSettingsContract[]

包含在此 API 中的 OAuth2 驗證設定集合。

openid

OpenIdAuthenticationSettingsContract

OpenID Connect 驗證設定

openidAuthenticationSettings

OpenIdAuthenticationSettingsContract[]

此 API 中包含的 Open ID Connect 驗證設定集合。

bearerTokenSendingMethods

如何將令牌傳送至伺服器。

名稱 類型 Description
authorizationHeader

string

存取令牌將會使用持有人架構在授權標頭中傳輸

query

string

存取令牌會以查詢參數的形式傳輸。

ErrorFieldContract

錯誤欄位合約。

名稱 類型 Description
code

string

屬性層級錯誤碼。

message

string

人類可讀取的屬性層級錯誤表示法。

target

string

屬性名稱。

ErrorResponse

錯誤回應。

名稱 類型 Description
error.code

string

服務定義的錯誤碼。 此代碼會作為回應中指定之 HTTP 錯誤碼的子狀態。

error.details

ErrorFieldContract[]

在驗證錯誤時,要求中傳送的無效欄位清單。

error.message

string

人類可閱讀的錯誤表示法。

OAuth2AuthenticationSettingsContract

API OAuth2 驗證設定詳細數據。

名稱 類型 Description
authorizationServerId

string

OAuth 授權伺服器識別碼。

scope

string

作業範圍。

OpenIdAuthenticationSettingsContract

API OAuth2 驗證設定詳細數據。

名稱 類型 Description
bearerTokenSendingMethods

bearerTokenSendingMethods[]

如何將令牌傳送至伺服器。

openidProviderId

string

OAuth 授權伺服器識別碼。

Protocol

描述此 API 中的作業可在哪些通訊協定上叫用。

名稱 類型 Description
http

string

https

string

ws

string

wss

string

SubscriptionKeyParameterNamesContract

訂用帳戶金鑰參數名稱詳細數據。

名稱 類型 Description
header

string

訂用帳戶金鑰標頭名稱。

query

string

訂用帳戶金鑰查詢字串參數名稱。

versioningScheme

值,決定 API 版本識別碼在 HTTP 要求中的位置。

名稱 類型 Description
Header

string

API 版本會在 HTTP 標頭中傳遞。

Query

string

API 版本會在查詢參數中傳遞。

Segment

string

API 版本會在路徑區段中傳遞。