swagger: '2.0' info: version: 2020-08-01-preview title: Microsoft Azure AccessControlClient AccessConnector Text:analyze API schemes: - https tags: - name: Text:analyze paths: /text:analyze: post: operationId: microsoftAzureTextoperationsAnalyzetext summary: Microsoft Azure Analyze Text description: 'A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.' parameters: - $ref: '#/parameters/Azure.Core.Foundations.ApiVersionParameter' - name: body in: body description: The text analysis request. required: true schema: $ref: '#/definitions/AnalyzeTextOptions' responses: '200': description: The request has succeeded. schema: $ref: '#/definitions/AnalyzeTextResult' default: description: An unexpected error response. schema: $ref: '#/definitions/Azure.Core.Foundations.ErrorResponse' headers: x-ms-error-code: type: string description: String error code indicating what went wrong. x-ms-examples: Analyze Text: $ref: ./examples/AnalyzeText.json tags: - Text:analyze definitions: Azure.Core.Foundations.ErrorResponse: type: object description: A response containing error details. properties: error: $ref: '#/definitions/Azure.Core.Foundations.Error' description: The error object. required: - error TextBlocklistMatch: type: object description: The result of blocklist match. properties: blocklistName: type: string description: The name of the matched blocklist. maxLength: 64 blocklistItemId: type: string description: The ID of the matched item. maxLength: 64 blocklistItemText: type: string description: The content of the matched item. maxLength: 128 required: - blocklistName - blocklistItemId - blocklistItemText AnalyzeTextResult: type: object description: The text analysis response. properties: blocklistsMatch: type: array description: The blocklist match details. items: $ref: '#/definitions/TextBlocklistMatch' x-ms-identifiers: [] categoriesAnalysis: type: array description: Analysis result for categories. items: $ref: '#/definitions/TextCategoriesAnalysis' x-ms-identifiers: [] required: - categoriesAnalysis Azure.Core.Foundations.InnerError: type: object description: 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. properties: code: type: string description: One of a server-defined set of error codes. innererror: $ref: '#/definitions/Azure.Core.Foundations.InnerError' description: Inner error. TextCategoriesAnalysis: type: object description: Text analysis result. properties: category: $ref: '#/definitions/TextCategory' description: The text analysis category. severity: type: integer format: int32 description: The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7. required: - category AnalyzeTextOptions: type: object description: The text analysis request. properties: text: type: string description: The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request. maxLength: 10000 categories: type: array description: The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned. items: $ref: '#/definitions/TextCategory' blocklistNames: type: array description: The names of blocklists. items: type: string haltOnBlocklistHit: type: boolean description: When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit. outputType: type: string description: This refers to the type of text analysis output. If no value is assigned, the default value will be "FourSeverityLevels". default: FourSeverityLevels enum: - FourSeverityLevels - EightSeverityLevels x-ms-enum: name: AnalyzeTextOutputType modelAsString: true values: - name: FourSeverityLevels value: FourSeverityLevels description: Output severities in four levels, the value could be 0,2,4,6. - name: EightSeverityLevels value: EightSeverityLevels description: Output severities in eight levels, the value could be 0,1,2,3,4,5,6,7. required: - text Azure.Core.Foundations.Error: type: object description: The error object. properties: code: type: string description: One of a server-defined set of error codes. message: type: string description: A human-readable representation of the error. target: type: string description: The target of the error. details: type: array description: An array of details about specific errors that led to this reported error. items: $ref: '#/definitions/Azure.Core.Foundations.Error' x-ms-identifiers: [] innererror: $ref: '#/definitions/Azure.Core.Foundations.InnerError' description: An object containing more specific information than the current object about the error. required: - code - message TextCategory: type: string description: Text analyze category. enum: - Hate - SelfHarm - Sexual - Violence x-ms-enum: name: TextCategory modelAsString: true parameters: Azure.Core.Foundations.ApiVersionParameter: name: api-version in: query description: The API version to use for this operation. required: true type: string minLength: 1 x-ms-parameter-location: method x-ms-client-name: apiVersion x-ms-parameterized-host: hostTemplate: '{endpoint}' useSchemePrefix: false parameters: - $ref: '#/parameters/Endpoint'