Show / Hide Table of Contents

Usage info

Translation Usage

The purpose of this endpoint is to enable retrieving information about translation usage.

Linux

curl -XPOST 'https://api.languageweaver.com/v4/accounts/12/reports/usage/translations' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Content-Type: application/json' -d '{
    "startDate": "2022/02/01",
    "endDate": "2022/05/01"
}'
Windows

curl -XPOST https://api.languageweaver.com/v4/accounts/12/reports/usage/translations -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Content-Type: application/json" -d ^ 
"{^
    \"startDate\": \"2022/02/01\",^
    \"endDate\": \"2022/05/01\"^
}"

Access token type
User credentials - Allowed User Roles: Admin, Linguist, Translator. Note: Linguist and Translator roles can retrieve information about their own usage.
API credentials

HTTP Request
POST /v4/accounts/{accountId}/reports/usage/translations

Headers

Name Value (example) Description
Authorization Bearer asd0eXAi... Bearer token
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 Optional unique request identifier (UUID) provided by client

Request JSON:

{
  "startDate": "2022/02/01",
  "endDate": "2022/05/01",
  "languagePairIds" : ["all"],
  "userIds": ["all"],
  "labelIds": ["all"],
  "groupIds": ["all"],
  "applicationIds": ["all"]
}

Format
JSON

Name Type Mandatory Default value Description
startDate string yes The start date (inclusive) of the report in the format yyyy/MM/dd.
endDate string yes The end date (inclusive) of the report in the format yyyy/MM/dd.
languagePairIds string no List of Language Pairs to filter by. Language Pair format is srctgt_model. If the list contains a single element with the "all" value, the report will include the usage for all Language Pairs, with a break down for each Language Pair.
userIds string no List of User Identifiers to filter by. If the list contains a single element with the "all" value, the report will include the usage for all Users, with a break down for each User.
labelIds string no List of Label Identifiers to filter by. If the list contains a single element with the "all" value, the report will include the usage for all Labels, with a break down for each Label.
groupIds string no List of Group Identifiers to filter by. If the list contains a single element with the "all" value, the report will include the usage for all Groups, with a break down for each Group.
clientIds string no List of Client Identifiers to filter by. If the list contains a single element with the "all" value, the report will include the usage for all Client Identifiers, with a break down for each Client Identifier.
applicationIds string no List of Application Identifiers to filter by. If the list contains a single element with the "all" value, the report will include the usage for all Applications, with a break down for each Application.

Supported Application Ids

Application Id Application Name
0 Legacy Requests
1 Language Weaver API
2 Language Weaver Portal
3 Microsoft Office Add-in
4 Google Chrome Extension
5 Firefox Browser Extension
6 Microsoft Edge Extension
7 RWS TMS
8 RWS World Server
9 Trados Studio
10 Salesforce LiveAgent
11 Salesforce Instant Translation
12 Relativity
13 Zapier
14 ServiceNow
15 GitHub
16 UiPath
Note

The maximum difference between startDate and endDate: 3 months.
Maximum number of requests per minute: 1.

Response JSON:

{
  "report": [
    {
      "outputWordCount": 33,
      "outputCharCount": 189,
      "count": 3,
      "inputWordCount": 33,
      "inputCharCount": 192,
      "accountId": 2,
      "user": {
        "userId": 3,
        "firstName": "John3",
        "middleName": "M3",
        "lastName": "Smith3",
        "email": "jsmith3@domain.com"
      },
      "languagePair": {
        "name": "engfra_generic",
        "displayName": "Generic",
        "sourceLanguageId": "eng",
        "targetLanguageId": "fra"
      },
      "label": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "value": "Test Label",
        "active": "active"
      },
      "group": {
        "id": "6786755b-1d43-4a60-b1ec-b11cde374cde",
        "value": "Test Group",
        "active": "active"
      },
      "application": {
        "id": 1,
        "name": "Language Weaver API"
      },
      "reportYear": 2022,
      "reportMonth": 3
    }
  ]
}

Response

Headers

Name Value (example) Description
BeGlobal-Request-ID dbbbc062-88a7-4783-8d52-dea795e517f4 Unique request identifier (UUID)
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 The identifier provided in the request (UUID)

Format
JSON

Name Type Description
accountId integer Unique numeric identifier for the account.
inputCharCount integer Number of translated input characters.
inputWordCount integer Number of translated input words.
outputWordCount integer Number of translated output words.
outputCharCount integer Number of translated output characters.
count integer Number of translation requests.
reportYear integer The year of the report.
reportMonth integer The month of the report.
user object User that performed the translation.
userId integer Unique numeric identifier for the user.
firstName string User's first name.
middleName string User's middle name.
lastName string User's last name.
email string User's email.
languagePair object Translation Language Pair.
name string Language pair name.
displayName string Display Name used in Language Weaver UI.
sourceLanguageId string Three letters language code of the source language.
targetLanguageId string Three letters language code of the target language.
label object Translation Label.
id string Unique string identifier (UUID) for the label.
value string String representing the label.
active string String representing the label's state.
group object Group to which the owner of the translation belongs.
id string Unique string identifier (UUID) for the group.
value string String representing the group.
active string String representing the group's state.
application object Application form where the translation was initiated.
id integer Unique numeric identifier of the application.
name string Application name.

Error JSON:

{
  "errors": [
    {
      "code": 23,
      "description": "startDate should be earlier than endDate"
    }
  ]
}

Error Response

Format
JSON

Name Type Description
errors list A list with the errors that occurred
code integer The code of the error
description string The description of the error

Returned HTTP Codes:

Http Code Description
200 When the report was successfully returned
400 When the input data is not valid
401 When the authentication process failed or the access token is not valid
403 Forbidden to access resource
429 Too many requests
500 Application internal error
In This Page
Back to top