This page explains how to query segments by QA issues with the search API.

Introduction

To get started, simply add a qa node in the query’s languages node:

{ 
	"query": {
		"languages": [
    		{ 
              "locs": ["en"],
              "qa": { }               
              ...
CODE

An empty node like the above will filter segments that have 1 or more issues in the language.

Filters

The qa node has these options:

qa

When empty then the default filter applies: It will return all segments/texts that have 1 or more active issues. Dismissed issues (like false positives) are not considered active.

"languages": [
  {
    "qa": { }
    ...
CODE

Optional, object

qa.dismissed

Optional boolean.

  • null or missing: no filter

  • false: Search for segments that have at least one active issue in the language (i.e. that is not dismissed)

  • true: Search for segments that have at least one dismissed issue in the language.

Example

"languages": [
  {
    "qa": { 
      "dismissed": false
    }
    ...
CODE

Optional, bool?

qa.severity

Optional list of severity levels to filter.

  • null or missing or []: no filter

  • 0: Language must have at least one issue of severity “Information”

  • 1: Language must have at least one issue of severity “Warning”

  • 2: Language must have at least one issue of severity “Error”

Example

"languages": [
  {
    "qa": { 
      "severity": [2]
    }
    ...
CODE

Optional, int[]?

qa.rules

Optional list of QA rule IDs to filter.

  • null or missing or []: no filter

  • 0: An issue not produced by a QA process

  • 1 .. 1000: Reserved for QA rules built into Wordbee Translator

  • >1000: Any numbers used by an API integrator. See e.g. resources/qa/issues/update (post) which allows to freely set rule IDs.

Example

"languages": [
  {
    "qa": { 
      "rules": [0, 10, 22]
    }
    ...
CODE

Optional, int[]?

Search results

The search results include on text level (node txt) the QA issue details in child node qa:

...
"txt": {
	"val": "Hello world how are you",
	"st": 0,
	...
	"qa": {
		"dt": "0001-01-01T00:00:00Z",
		"active": false,
		"issues": [
			{
				"s": 2,
				"d": "Grammatical error",
				"r": 10,
				"c": "For your info"
			},
			{
				"s": 1,
				"d": "The translation contains double spaces which are not present in the source text",
				"r": 20
			}
		]
	}                          
CODE

If there a no issues at all then qa will be null:

...
"txt": {
	"val": "Hello world how are you",
	"st": 0,
	...
	"qa": null                         
CODE

The properties of qa are:

s

Severity: 0 = Information, 1 = Warning, 2 = error

int

d

Description of issue.

string

r

QA rule ID. See above for the different numerical values.

int

x

Issue dismissed yes/no. If property is missing then consider dismissed being false.

int, Optional

c

Optional comments. If there are no comments then this property will not be output.

string, Optional