resources/segments/reports (POST)

resources/segments/reports (POST)

Use this method to create an Excel report from segments. The API supports specifying one or multiple target locales, depending on the report type.

URL

(POST) /api/resources/segments/reports

PARAMETERS

The message body contains a JSON object.

One of tloc or tlocs must be provided.



reportid

The report to create. To get all available reports, see resources/segments/reports/items

Examples:

  • _all : Prints all segments

  • _revisions : Prints revisions

  • _postedits : Prints post edited segments only

  • S710 : A business report, available when printing in the scope of project or job only.

  • S720 : QA report, available when printing in the scope of project, job, document or flex.

  • ...

Reports starting with an underscore (_) are pre-configured by Wordbee and cannot be customized. All other reports are fully customizable in the Business Report pages.



Mandatory, string

sloc

The source locale. A report is always for a source - target language couple.

Mandatory, string

tloc

Specifies a single target locale.
This parameter is supported by both reports that accept a single locale and reports that accept multiple locales.
When used, exactly one target locale is passed to the report.

string

tlocs

Specifies multiple target locales to be processed in a single request.
This parameter is supported by both reports that accept a single locale and reports that accept multiple locales.

  • For reports that accept multiple target locales, all locales in the array are processed.

  • For reports that accept a single target locale only, the first locale in the list is used and the remaining values are ignored.

Example:

"tlocs": ["de", "fr", "es"]

Optional, String[]

scope

The scope of segments such as Project, Job, DocumentSet, etc.

See Scope (Object). Example:

"scope": { "type": "Project", "projectid": 3343 }

Mandatory, object

query

An optional query object. To filter the segments of the scope. Example for drilling down on a single document:

{ "reportid": "C1112", "sloc": "en", "tloc": "de", "scope": { "type": "Project", "projectid": 3343 }, "query": { "documents": [{ "did": 9800 }] }} }

Important:

  • Business reports require a single document be specified in the "query" object as shown in the above example.



Optional, object



RESULTS

Await creation of text edits report

This API method executes asynchronously.

  • It immediately returns a reference for the operation in trm.requestid, and an operation status in trm.status.

  • As long as the status is not Finished or Failed, you need to poll the system with the trm.requestid value. See Asynchronous operation for how to do this.

  • Ultimately upon completion the operation status includes the custom.filetoken value which lets you download the report:

{ "trm": { "requestid": 559, "status": "Finished", ... }, "custom": { "filetoken": "026171df25c641d0b04316a28cf3cca1", "filename": "report-16/12/2019-18:06.xlsx" } }

Download text edits report

When the operation has terminated, download the JSON report with the filetoken and this API method:

(GET) /api/media/get/{filetoken}



EXAMPLES

{

    "reportid": "S720",

    "sloc": "en",

    "tlocs": ["fr", "ar"],

    "scope": { "type": "Project", "projectid": 595 },

    "query": { "documents": [{ "did": 27800 }] }

}











Copyright Wordbee - Buzzin' Outside the Box since 2008