Text Operations - Detect Text Protected Material

Analyze Protected Material
A synchronous API for the analysis of protected material.

POST {endpoint}/contentsafety/text:detectProtectedMaterial?api-version=2024-02-15-preview

URI Parameters

Name In Required Type Description
endpoint
path True

string

Supported Cognitive Services endpoints (protocol and hostname, for example: https://.cognitiveservices.azure.com).

api-version
query True

string

The API version to use for this operation.

Request Body

Name Required Type Description
text True

string

The text needs to be analyzed. We support a maximum of 1k Unicode characters (Unicode code points) in the text of one request.

Responses

Name Type Description
200 OK

AnalyzeTextProtectedMaterialResult

The request has succeeded.

Other Status Codes

Azure.Core.Foundations.ErrorResponse

An unexpected error response.

Headers

x-ms-error-code: string

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

OAuth2Auth

Type: oauth2
Flow: application
Token URL: https://login.microsoftonline.com/common/oauth2/v2.0/token

Scopes

Name Description
https://cognitiveservices.azure.com/.default

Examples

Detect Protected Material

Sample request

POST {endpoint}/contentsafety/text:detectProtectedMaterial?api-version=2024-02-15-preview

{
  "text": "This is text example"
}

Sample response

{
  "protectedMaterialAnalysis": {
    "detected": false
  }
}

Definitions

Name Description
AnalyzeTextProtectedMaterialOptions

The protected material analysis request.

AnalyzeTextProtectedMaterialResult

The protected material analysis response.

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/Guidelines.md#7102-error-condition-responses.

ProtectedMaterialAnalysisResult

The text protected material analysis response.

AnalyzeTextProtectedMaterialOptions

The protected material analysis request.

Name Type Description
text

string

The text needs to be analyzed. We support a maximum of 1k Unicode characters (Unicode code points) in the text of one request.

AnalyzeTextProtectedMaterialResult

The protected material analysis response.

Name Type Description
protectedMaterialAnalysis

ProtectedMaterialAnalysisResult

Analysis result for protected material.

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/Guidelines.md#7102-error-condition-responses.

Name Type Description
code

string

One of a server-defined set of error codes.

innererror

Azure.Core.Foundations.InnerError

Inner error.

ProtectedMaterialAnalysisResult

The text protected material analysis response.

Name Type Description
detected

boolean

Analysis result for protected material..