Content Classifiers - Classify
使用可选的拆分对内容进行分类。
POST {endpoint}/contentunderstanding/classifiers/{classifierId}:classify?api-version=2025-05-01-previewPOST {endpoint}/contentunderstanding/classifiers/{classifierId}:classify?api-version=2025-05-01-preview&stringEncoding={stringEncoding}&processingLocation={processingLocation}URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 | 
|---|---|---|---|---|
| classifier | path | True | stringpattern: ^[a-zA-Z0-9._-]{1,64}$ | 分类器的唯一标识符。 | 
| endpoint | path | True | string (uri) | 内容理解服务终结点。 | 
| api-version | query | True | stringminLength: 1 | 要用于此操作的 API 版本。 | 
| processing | query | 可能处理数据的位置。 | ||
| string | query | 内容的编码格式在响应中跨度。 | 
请求头
| 名称 | 必需 | 类型 | 说明 | 
|---|---|---|---|
| x-ms-client-request-id | string (uuid) | 请求的不透明、全局唯一的客户端生成的字符串标识符。 | 
请求正文
| 名称 | 类型 | 说明 | 
|---|---|---|
| url | string (uri) | 要分类的文档的 URL。 | 
响应
| 名称 | 类型 | 说明 | 
|---|---|---|
| 202 Accepted | 已接受请求进行处理,但尚未完成处理。 标头 
 | |
| Other Status Codes | 意外的错误响应。 标头 x-ms-error-code: string | 
安全性
Ocp-Apim-Subscription-Key
					类型: 
					apiKey
					在: 
					header
			
OAuth2Auth
					类型: 
					oauth2
					流向: 
					accessCode
					授权 URL: 
					https://login.microsoftonline.com/common/oauth2/authorize
					令牌 URL: 
					https://login.microsoftonline.com/common/oauth2/token
			
作用域
| 名称 | 说明 | 
|---|---|
| https://cognitiveservices.azure.com/.default | 
示例
Classify URL
示例请求
POST {endpoint}/contentunderstanding/classifiers/myClassifier:classify?api-version=2025-05-01-preview
{
  "url": "https://host.com/doc.pdf"
}
示例响应
Operation-Location: https://myendpoint.cognitiveservices.azure.com/contentunderstanding/classifierResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2025-05-01-preview{
  "id": "3b31320d-8bab-4f88-b19c-2322a7f11034",
  "status": "NotStarted"
}定义
| 名称 | 说明 | 
|---|---|
| Azure. | 错误对象。 | 
| Azure. | 包含错误详细信息的响应。 | 
| Azure. | 包含有关错误的更具体信息的对象。 根据 Azure REST API 准则 - https://aka.ms/AzureRestApiGuidelines#handling-errors。 | 
| Classify | 对作请求进行分类。 | 
| Processing | 可能处理数据的位置。 | 
| String | 用于内容 span 的字符串编码。 | 
Azure.Core.Foundations.Error   
			
			错误对象。
| 名称 | 类型 | 说明 | 
|---|---|---|
| code | string | 服务器定义的错误代码集之一。 | 
| details | 导致此报告错误的特定错误的详细信息数组。 | |
| innererror | 包含与当前对象有关错误的更具体信息的对象。 | |
| message | string | 有关错误的可读的表示形式。 | 
| target | string | 错误的目标。 | 
Azure.Core.Foundations.ErrorResponse    
			
			包含错误详细信息的响应。
| 名称 | 类型 | 说明 | 
|---|---|---|
| error | 错误对象。 | 
Azure.Core.Foundations.InnerError    
			
			包含有关错误的更具体信息的对象。 根据 Azure REST API 准则 - https://aka.ms/AzureRestApiGuidelines#handling-errors。
| 名称 | 类型 | 说明 | 
|---|---|---|
| code | string | 服务器定义的错误代码集之一。 | 
| innererror | 内部错误。 | 
ClassifyRequest 
			
			对作请求进行分类。
| 名称 | 类型 | 说明 | 
|---|---|---|
| url | string (uri) | 要分类的文档的 URL。 | 
ProcessingLocation 
			
			可能处理数据的位置。
| 值 | 说明 | 
|---|---|
| geography | 数据可以在与资源相同的地理位置进行处理。 | 
| dataZone | 数据可以在与资源相同的数据区中进行处理。 | 
| global | 数据可以在全球任何 Azure 数据中心进行处理。 | 
StringEncoding 
			
			用于内容 span 的字符串编码。
| 值 | 说明 | 
|---|---|
| codePoint | Unicode 码位 (UTF-32) 编码,由 Python 等语言使用。 | 
| utf16 | UTF-16 编码,由 C#、JavaScript、Java 等语言使用。 | 
| utf8 | UTF-8 编码,用于 Go、Rust、Ruby、PHP 等语言。 |