Share via


Custom Models - Authorize Model Copy

Generate authorization to copy a model into the target Form Recognizer resource.

POST {endpoint}/formrecognizer/v2.1/custom/models/copyAuthorization

URI Parameters

Name In Required Type Description
endpoint
path True

string

Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).

Request Header

Name Required Type Description
Ocp-Apim-Subscription-Key True

string

Responses

Name Type Description
201 Created

CopyAuthorizationResult

Copy request is authorized successfully.

Headers

Location: string

Other Status Codes

ErrorResponse

Response entity accompanying non-successful responses containing additional details about the error.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

Copy custom model

Sample request

POST {endpoint}/formrecognizer/v2.1/custom/models/copyAuthorization

Sample response

Location: {endpoint}/formrecognizer/v2.1/custom/models/f973e3c1-1148-43bb-bea8-49d0603ab3a8
{
  "modelId": "f973e3c1-1148-43bb-bea8-49d0603ab3a8",
  "accessToken": "{accessToken}",
  "expirationDateTimeTicks": 86400
}

Definitions

Name Description
CopyAuthorizationResult

Request parameter that contains authorization claims for copy operation.

ErrorInformation
ErrorResponse

CopyAuthorizationResult

Request parameter that contains authorization claims for copy operation.

Name Type Description
accessToken

string

Token claim used to authorize the request.

expirationDateTimeTicks

integer (int64)

The time when the access token expires. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time.

modelId

string

Model identifier.

ErrorInformation

Name Type Description
code

string

message

string

ErrorResponse

Name Type Description
error

ErrorInformation