Share via


Api Definitions - Get Definition

Get an API definition.

GET https://{serviceName}.data.{region}.azure-apicenter.ms/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions/{definitionName}?api-version=2024-02-01-preview

URI Parameters

Name In Required Type Description
apiName
path True

string

maxLength: 50

Api identifier.

definitionName
path True

string

maxLength: 50

Definition identifier.

region
path True

string

Region name

serviceName
path True

string

Region-unique API Center service name

versionName
path True

string

maxLength: 50

Version identifier.

workspaceName
path True

string

maxLength: 50

Workspace identifier.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Responses

Name Type Description
200 OK

ApiDefinition

The request has succeeded.

Other Status Codes

Azure.Core.Foundations.ErrorResponse

An unexpected error response.

Headers

x-ms-error-code: string

Security

AadOauth2Auth

The Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: accessCode
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize
Token URL: https://login.microsoftonline.com/common/oauth2/token

Scopes

Name Description
https://azure-apicenter.net/user_impersonation

Examples

ApiDefinitions_GetDefinition

Sample request

GET https://{serviceName}.data.{region}.azure-apicenter.ms/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/default?api-version=2024-02-01-preview

Sample response

{
  "name": "default",
  "title": "Default",
  "specification": {
    "name": "openapi",
    "version": "3.0.1"
  },
  "description": "Default API definition."
}

Definitions

Name Description
ApiDefinition

API definition resource model.

ApiSpecification

API specification

Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors.

ApiDefinition

API definition resource model.

Name Type Description
description

string

maxLength: 1000

The description of the API definition.

name

string

maxLength: 50

Definition identifier.

specification

ApiSpecification

The API specification details.

title

string

maxLength: 50

The name of the API definition.

ApiSpecification

API specification

Name Type Description
name

string

API specification name, e.g. 'swagger' or 'openapi'.

version

string

API specification version, e.g. '3.0.1'.

Azure.Core.Foundations.Error

The error object.

Name Type Description
code

string

One of a server-defined set of error codes.

details

Azure.Core.Foundations.Error[]

An array of details about specific errors that led to this reported error.

innererror

Azure.Core.Foundations.InnerError

An object containing more specific information than the current object about the error.

message

string

A human-readable representation of the error.

target

string

The target of the error.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Name Type Description
error

Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors.

Name Type Description
code

string

One of a server-defined set of error codes.

innererror

Azure.Core.Foundations.InnerError

Inner error.