你当前正在访问 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=2024-05-01

URI 参数

名称 必需 类型 说明
apiId
path True

string

minLength: 1
maxLength: 256
pattern: ^[^*#&+:<>?]+$

API 修订标识符。 当前 API 管理服务实例中必须是唯一的。 非当前修订有;rev=n 作为后缀,其中 n 是修订号。

resourceGroupName
path True

string

minLength: 1
maxLength: 90

资源组的名称。 名称不区分大小写。

serviceName
path True

string

minLength: 1
maxLength: 50
pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

API 管理服务的名称。

subscriptionId
path True

string (uuid)

目标订阅的 ID。 该值必须是 UUID。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

响应

名称 类型 说明
200 OK

ApiContract

响应正文包含指定的 API 实体。

标头

ETag: string

Other Status Codes

ErrorResponse

描述作失败的原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

ApiManagementGetApiContract
ApiManagementGetApiRevisionContract

ApiManagementGetApiContract

示例请求

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a?api-version=2024-05-01

示例响应

{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/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

示例请求

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api;rev=3?api-version=2024-05-01

示例响应

{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/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

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

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

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。 Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

资源的名称

properties.apiRevision

string

minLength: 1
maxLength: 100

描述 API 的修订。 如果未提供任何值,则会创建默认修订版 1

properties.apiRevisionDescription

string

maxLength: 256

API 修订的说明。

properties.apiVersion

string

maxLength: 100

指示 API 的版本标识符(如果 API 已进行版本控制)

properties.apiVersionDescription

string

maxLength: 256

API 版本的说明。

properties.apiVersionSet

ApiVersionSetContractDetails

版本集详细信息

properties.apiVersionSetId

string

相关 ApiVersionSet 的资源标识符。

properties.authenticationSettings

AuthenticationSettingsContract

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

properties.contact

ApiContactInformation

API 的联系信息。

properties.description

string

API 的说明。 可能包括 HTML 格式标记。

properties.displayName

string

minLength: 1
maxLength: 300

API 名称。 长度必须为 1 到 300 个字符。

properties.isCurrent

boolean

指示 API 修订是否为当前 API 修订版。

properties.isOnline

boolean

指示是否可通过网关访问 API 修订。

properties.license

ApiLicenseInformation

API 的许可证信息。

properties.path

string

minLength: 0
maxLength: 400

相对 URL 唯一标识此 API 及其所有资源路径在 API 管理服务实例中。 它追加到服务实例创建期间指定的 API 终结点基 URL,以形成此 API 的公共 URL。

properties.protocols

Protocol[]

描述可以调用此 API 中的作的协议。

properties.provisioningState

string

预配状态

properties.serviceUrl

string

minLength: 0
maxLength: 2000

实现此 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
grpc
http
odata
soap
websocket

ApiVersionSetContractDetails

API 版本集包含一组与 API 版本相关的常见配置

名称 类型 说明
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 身份验证设置。

名称 类型 说明
oAuth2

OAuth2AuthenticationSettingsContract

OAuth2 身份验证设置

oAuth2AuthenticationSettings

OAuth2AuthenticationSettingsContract[]

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

openid

OpenIdAuthenticationSettingsContract

OpenID Connect 身份验证设置

openidAuthenticationSettings

OpenIdAuthenticationSettingsContract[]

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

bearerTokenSendingMethods

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

说明
authorizationHeader

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

query

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

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

OAuth2AuthenticationSettingsContract

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

名称 类型 说明
authorizationServerId

string

OAuth 授权服务器标识符。

scope

string

作范围。

OpenIdAuthenticationSettingsContract

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

名称 类型 说明
bearerTokenSendingMethods

bearerTokenSendingMethods[]

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

openidProviderId

string

OAuth 授权服务器标识符。

Protocol

描述可以调用此 API 中的作的协议。

说明
http
https
ws
wss

SubscriptionKeyParameterNamesContract

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

名称 类型 说明
header

string

订阅密钥标头名称。

query

string

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

versioningScheme

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

说明
Header

API 版本在 HTTP 标头中传递。

Query

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

Segment

API 版本在路径段中传递。