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

Document Models - Copy Model To

将文档模型复制到目标资源、区域和 modelId。

POST {endpoint}/formrecognizer/documentModels/{modelId}:copyTo?api-version=2023-07-31

URI 参数

名称 必需 类型 说明
endpoint
path True

string

url

支持的认知服务终结点 (协议和主机名,例如: https://westus2.api.cognitive.microsoft.com) 。

modelId
path True

string

唯一的文档模型名称。

Regex pattern: ^[a-zA-Z0-9][a-zA-Z0-9._~-]{1,63}$

api-version
query True

string

请求的 API 版本。

请求头

名称 必需 类型 说明
Ocp-Apim-Subscription-Key True

string

Azure 认知服务订阅的密钥。

请求正文

名称 必需 类型 说明
accessToken True

string

用于授权请求的令牌。

expirationDateTime True

string

访问令牌过期的日期/时间。

targetModelId True

string

目标文档模型的标识符。

targetModelLocation True

string

目标帐户中复制的文档模型的 URL。

targetResourceId True

string

文档模型应复制到的目标 Azure 资源的 ID。

targetResourceRegion True

string

文档模型应复制到的目标 Azure 资源的位置。

响应

名称 类型 说明
202 Accepted

请求已成功排队。

Headers

Operation-Location: string

Other Status Codes

ErrorResponse

遇到错误。

安全性

Ocp-Apim-Subscription-Key

Azure 认知服务订阅的密钥。

Type: apiKey
In: header

示例

Copy Document Model To

Sample Request

POST https://myendpoint.cognitiveservices.azure.com/formrecognizer/documentModels/sourceModel:copyTo?api-version=2023-07-31

{
  "targetResourceId": "/subscriptions/targetSub/resourceGroups/targetRG/providers/Microsoft.CognitiveServices/accounts/targetService",
  "targetResourceRegion": "targetResourceRegion",
  "targetModelId": "targetModel",
  "targetModelLocation": "https://targetEndpoint.cognitiveservices.azure.com/formrecognizer/documentModels/targetModel",
  "accessToken": "accessToken",
  "expirationDateTime": "2021-09-23T09:12:54.552Z"
}

Sample Response

Operation-Location: https://myendpoint.cognitiveservices.azure.com/formrecognizer/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2023-07-31

定义

名称 说明
CopyAuthorization

授权将文档模型复制到指定的目标资源和 modelId。

Error

错误信息。

ErrorResponse

错误响应对象。

InnerError

详细错误。

CopyAuthorization

授权将文档模型复制到指定的目标资源和 modelId。

名称 类型 说明
accessToken

string

用于授权请求的令牌。

expirationDateTime

string

访问令牌过期的日期/时间。

targetModelId

string

目标文档模型的标识符。

targetModelLocation

string

目标帐户中复制的文档模型的 URL。

targetResourceId

string

文档模型应复制到的目标 Azure 资源的 ID。

targetResourceRegion

string

文档模型应复制到的目标 Azure 资源的位置。

Error

错误信息。

名称 类型 说明
code

string

错误代码。

details

Error[]

详细错误列表。

innererror

InnerError

详细错误。

message

string

错误消息。

target

string

错误的目标。

ErrorResponse

错误响应对象。

名称 类型 说明
error

Error

错误信息。

InnerError

详细错误。

名称 类型 说明
code

string

错误代码。

innererror

InnerError

详细错误。

message

string

错误消息。