BA statistics for multiple documents
Description
This method retrieves BA (Business Analytics) statistics for multiple documents in a single call.
It provides information on:
Who edited how many texts
Time spent on translations and edits
Quality metrics and scores
URL
(POST) /resources/statistics/ba/batch
PARAMETERS
The body must contain a JSON object.
Example request
{
"scope": { "projectId": 123 },
"locale": "fr-FR",
"dids": [1001, 1002, 1003]
}
Another example, retrieving BA statistics for all documents in scope:
{
"scope": { "projectId": 123 },
"locale": "fr-FR"
}
Body properties
Parameter | Description | Required |
|---|---|---|
scope | The Scope (Object). Note that if you use a document set or global search scope, you will receive | Mandatory |
dids | Optional array of document IDs (1–100 distinct integers). If omitted, retrieves statistics for all documents in scope (capped at 100). | Optional |
locale | The language to get statistics for. | Mandatory |
Validation
localeis required and must be available in the scope.If
didsis provided, it must contain between 1 and 100 distinct integer document IDs.All document IDs in
didsmust exist within the project scope.
If any document is not found, an error is returned:Document {did} not found in the project scope.
RESULTS
The API returns a JSON array of objects, one per document.
Each array item has these properties:
Property | Description |
|---|---|
did | Document ID. |
name | Document name. |
stats | The BA statistics object (same structure as the single BA endpoint result). See resources/statistics/ba. |
error | Present and set to |
If error is true, stats may be missing or incomplete for that item.
DATA STRUCTURES
Editors node
The editors element is an array of objects with these properties.
The last array element contains the grand totals.
Property | Description |
|---|---|
editor | Internal code for the type of editor. |
title | Title of editor. |
segments | Segment counts: |
words | Word counts: |
actions | Total number of interventions. |
actionsCorrections | Total number of interventions correcting a previous text. |
scores | Array of document-level scores. See Scores node below. |
Workers node
The workers element is an array of objects with these properties.
The last array element contains the grand totals.
Property | Description |
|---|---|
pid | Person ID. |
cid | Company ID. |
pname | Person name. |
pcode | Person code. |
cname | Company name. |
segments | Object with various segment counts: |
words | Object with various word counts: |
dtfirst | First edit date in document. |
dtfirstt | First edit date as a string. |
dtlast | Last edit date in document. |
dtlastt | Last edit date as a string. |
scores | Array of document-level scores. See Scores node below. |
Scores node
Each scores element is an array of objects with these properties:
Property | Description |
|---|---|
title | Print title for the score. |
value | Decimal value of the score. Can be |
unit |
|
desc | Description of the score and its purpose. This text adapts to the actual score value. |
max | Maximum value the score can have. |
ACCESS CONTROL
The logged user must have access to BA data.
See Rights (Object), property canViewBA which must be true.
EXAMPLES
Example request
{
"scope": { "projectId": 123 },
"locale": "fr-FR",
"dids": [1001, 1002, 1003]
}
Example response (batch documents – simple)
[
{
"did": 1001,
"name": "Document1.docx",
"stats": {
"segments": { "error": 0, "ok": 0, "missing": 0, "filled": 4, "total": 4 },
"words": { "error": 0, "ok": 0, "missing": 0, "filled": 8, "total": 8 },
"dtfirst": "2017-02-06T07:09:09.8944871Z",
"dtlast": "2017-02-06T07:09:22.4785955Z",
"dtfirstt": "06/02/2017 08:09 UTC+1",
"dtlastt": "06/02/2017 08:09 UTC+1",
"editors": [],
"workers": [],
"scores": []
}
},
{
"did": 1002,
"name": "Document2.docx",
"stats": {}
},
{
"did": 1003,
"name": "Document3.docx",
"error": true
}
]
Example response (batch documents – detailed)
[
{
"did": 1001,
"name": "Document1.docx",
"stats": {
"segments": {
"error": 0,
"ok": 0,
"missing": 0,
"filled": 4,
"total": 4
},
"words": {
"error": 0,
"ok": 0,
"missing": 0,
"filled": 8,
"total": 8
},
"dtfirst": "2017-02-06T07:09:09.8944871Z",
"dtlast": "2017-02-06T07:09:22.4785955Z",
"dtfirstt": "06/02/2017 08:09 UTC+1",
"dtlastt": "06/02/2017 08:09 UTC+1",
"editors": [
{
"editor": "None",
"title": "Not translated",
"segments": {
"initial": 4,
"unchanged": 0,
"translation": 4,
"postEditing": 0,
"revision": 0,
"current": 0
},
"words": {
"initial": 8,
"unchanged": 0,
"translation": 8,
"postEditing": 0,
"revision": 0,
"current": 0
},
"actions": 4,
"actionsCorrections": 0,
"scores": [
{
"title": "Work quality",
"value": 10.0,
"unit": null,
"desc": null,
"max": 10.0
}
]
},
{
"editor": null,
"title": "TOTAL",
"segments": {
"initial": 4,
"unchanged": 0,
"translation": 4,
"postEditing": 0,
"revision": 0,
"current": 4
},
"words": {
"initial": 8,
"unchanged": 0,
"translation": 8,
"postEditing": 0,
"revision": 0,
"current": 8
},
"actions": 4,
"actionsCorrections": 0,
"scores": [
{
"title": "Work quality",
"value": 10.0,
"unit": null,
"desc": null,
"max": 10.0
}
]
}
],
"workers": [
{
"pid": 7,
"cid": 1,
"pname": "Stephan Bohmig",
"pcode": "SB",
"cname": "Pons",
"segments": {
"total": 4,
"translation": 4,
"postEditing": 0,
"revision": 0,
"corrected": 0
},
"words": {
"total": 8,
"translation": 8,
"postEditing": 0,
"revision": 0,
"corrected": 0
},
"dtfirst": "2017-02-06T07:09:09.8944871Z",
"dtlast": "2017-02-06T07:09:22.4785955Z",
"dtfirstt": "06/02/2017 08:09 UTC+1",
"dtlastt": "06/02/2017 08:09 UTC+1",
"scores": [
{
"title": "Work quality",
"value": 10.0,
"unit": null,
"desc": null,
"max": 10.0
}
]
},
{
"pid": 0,
"cid": 0,
"pname": "TOTAL",
"pcode": "TOTAL",
"cname": null,
"segments": {
"total": 4,
"translation": 4,
"postEditing": 0,
"revision": 0,
"corrected": 0
},
"words": {
"total": 8,
"translation": 8,
"postEditing": 0,
"revision": 0,
"corrected": 0
},
"dtfirst": "2017-02-06T07:09:09.8944871Z",
"dtlast": "2017-02-06T07:09:22.4785955Z",
"dtfirstt": "06/02/2017 08:09 UTC+1",
"dtlastt": "06/02/2017 08:09 UTC+1",
"scores": [
{
"title": "Work quality",
"value": 10.0,
"unit": null,
"desc": null,
"max": 10.0
}
]
}
],
"scores": [
{
"title": "Completed",
"value": 100.0,
"unit": "%",
"desc": "Percentage translations supplied and not marked errorneous.",
"max": 0.0
},
{
"title": "Human translation quality",
"value": 10.0,
"unit": null,
"desc": "0 out of 4 human translated or post-edited segments required correction.",
"max": 10.0
},
{
"title": "Overall Efficiency",
"value": 5.0,
"unit": null,
"desc": "4 segments required a total of 4 human interventions.",
"max": 10.0
}
]
}
},
{
"did": 1002,
"name": "Document2.docx",
"stats": {
"segments": {
"error": 0,
"ok": 2,
"missing": 1,
"filled": 2,
"total": 3
},
"words": {
"error": 0,
"ok": 5,
"missing": 2,
"filled": 5,
"total": 7
},
"dtfirst": "2017-02-07T10:15:00.0000000Z",
"dtlast": "2017-02-07T11:30:00.0000000Z",
"dtfirstt": "07/02/2017 11:15 UTC+1",
"dtlastt": "07/02/2017 12:30 UTC+1",
"editors": [],
"workers": [],
"scores": []
}
},
{
"did": 1003,
"name": "Document3.docx",
"error": true
}
]