Document Classifiers - Classify Document From Stream

Classifies document with document classifier.

POST {endpoint}/documentintelligence/documentClassifiers/{classifierId}:analyze?api-version=2024-02-29-preview
POST {endpoint}/documentintelligence/documentClassifiers/{classifierId}:analyze?api-version=2024-02-29-preview&stringIndexType={stringIndexType}&split={split}

URI Parameters

Name In Required Type Description
classifierId
path True

string

Unique document classifier name.

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

endpoint
path True

string

The Document Intelligence service endpoint.

api-version
query True

string

The API version to use for this operation.

split
query

SplitMode

Document splitting mode.

stringIndexType
query

StringIndexType

Method used to compute string offset and length.

Request Body

Media Types: "application/octet-stream", "application/pdf", "image/jpeg", "image/png", "image/tiff", "image/bmp", "image/heif", "text/html", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.presentationml.presentation"

Name Type Description
input

string

Input content.

Responses

Name Type Description
202 Accepted

The request has been accepted for processing, but processing has not yet completed.

Headers

  • Operation-Location: string
  • Retry-After: integer
Other Status Codes

ErrorResponse

An unexpected error response.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

OAuth2Auth

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://cognitiveservices.azure.com/.default

Examples

Classify Document from Url

Sample Request

POST https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentClassifiers/classifierId:analyze?api-version=2024-02-29-preview&stringIndexType=textElements

"{binaryFile}"

Sample Response

Operation-Location: https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentClassifiers/customClassifier/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2024-02-29-preview

Definitions

Name Description
Error

The error object.

ErrorResponse

Error response object.

InnerError

An object containing more specific information about the error.

SplitMode

Document splitting mode.

StringIndexType

Method used to compute string offset and length.

Error

The error object.

Name Type Description
code

string

One of a server-defined set of error codes.

details

Error[]

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

innererror

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.

ErrorResponse

Error response object.

Name Type Description
error

Error

Error info.

InnerError

An object containing more specific information about the error.

Name Type Description
code

string

One of a server-defined set of error codes.

innererror

InnerError

Inner error.

message

string

A human-readable representation of the error.

SplitMode

Document splitting mode.

Name Type Description
auto

string

Automatically split file into documents.

none

string

Treat the entire file as a single document.

perPage

string

Treat each page in the file as a separate document.

StringIndexType

Method used to compute string offset and length.

Name Type Description
textElements

string

User-perceived display character, or grapheme cluster, as defined by Unicode 8.0.0.

unicodeCodePoint

string

Character unit represented by a single unicode code point. Used by Python 3.

utf16CodeUnit

string

Character unit represented by a 16-bit Unicode code unit. Used by JavaScript, Java, and .NET.