你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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 参数

名称 必需 类型 说明
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

目标订阅的 ID。

api-version
query True

string

要用于此操作的 API 版本。

响应

名称 类型 说明
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

名称 说明
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"
  }
}

定义

名称 说明
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 联系人信息

名称 类型 说明
email

string

联系人/组织的电子邮件地址。 必须采用电子邮件地址的格式

name

string

联系人/组织的标识名称

url

string

指向联系人信息的 URL。 必须采用 URL 的格式

ApiContract

API 详细信息。

名称 类型 说明
id

string

资源的完全限定的资源 ID。 例如 - /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

相对 URL,用于唯一标识此 API 及其在 API 管理服务实例中的所有资源路径。 可将其追加到在服务实例创建过程中指定的 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 许可证信息

名称 类型 说明
name

string

用于 API 的许可证名称

url

string

用于 API 的许可证的 URL。 必须采用 URL 的格式

ApiType

API 的类型。

名称 类型 说明
graphql

string

http

string

soap

string

websocket

string

ApiVersionSetContractDetails

API 版本集包含一组与 API 版本相关的通用配置

名称 类型 说明
description

string

API 版本集的说明。

id

string

现有 API 版本集的标识符。 省略此值以创建新的版本集。

name

string

API 版本集的显示名称。

versionHeaderName

string

HTTP 标头参数的名称,如果 versioningScheme 设置为 header,则指示 API 版本。

versionQueryName

string

如果 versioningScheme 设置为 query,则指示 API 版本的查询参数的名称。

versioningScheme

versioningScheme

一个 值,该值确定 API 版本标识符在 HTTP 请求中的位置。

AuthenticationSettingsContract

API 身份验证设置。

名称 类型 说明
oAuth2

OAuth2AuthenticationSettingsContract

OAuth2 身份验证设置

oAuth2AuthenticationSettings

OAuth2AuthenticationSettingsContract[]

此 API 中包含的 OAuth2 身份验证设置的集合。

openid

OpenIdAuthenticationSettingsContract

OpenID Connect 身份验证设置

openidAuthenticationSettings

OpenIdAuthenticationSettingsContract[]

此 API 中包含的 Open ID Connect 身份验证设置的集合。

bearerTokenSendingMethods

如何将令牌发送到服务器。

名称 类型 说明
authorizationHeader

string

访问令牌将使用持有者架构在授权标头中传输

query

string

访问令牌将作为查询参数传输。

ErrorFieldContract

错误字段协定。

名称 类型 说明
code

string

属性级错误代码。

message

string

属性级错误的可读表示形式。

target

string

属性名称。

ErrorResponse

错误响应。

名称 类型 说明
error.code

string

服务定义的错误代码。 此代码用作响应中指定的 HTTP 错误代码的子状态。

error.details

ErrorFieldContract[]

在发生验证错误的情况下,在请求中发送的无效字段列表。

error.message

string

错误的用户可读表示形式。

OAuth2AuthenticationSettingsContract

API OAuth2 身份验证设置详细信息。

名称 类型 说明
authorizationServerId

string

OAuth 授权服务器标识符。

scope

string

操作范围。

OpenIdAuthenticationSettingsContract

API OAuth2 身份验证设置详细信息。

名称 类型 说明
bearerTokenSendingMethods

bearerTokenSendingMethods[]

如何将令牌发送到服务器。

openidProviderId

string

OAuth 授权服务器标识符。

Protocol

说明可在哪些协议上调用此 API 中的操作。

名称 类型 说明
http

string

https

string

ws

string

wss

string

SubscriptionKeyParameterNamesContract

订阅密钥参数名称详细信息。

名称 类型 说明
header

string

订阅密钥标头名称。

query

string

订阅密钥查询字符串参数名称。

versioningScheme

一个 值,该值确定 API 版本标识符在 HTTP 请求中的位置。

名称 类型 说明
Header

string

API 版本在 HTTP 标头中传递。

Query

string

API 版本在查询参数中传递。

Segment

string

API 版本在路径段中传递。