New Language Weaver Reporting API available

New Language Weaver Reporting API available

Hi all,

I'm happy to announce that we have a new API endpoint available for usage reporting in Language Weaver.

So far, the reporting information was only available from the Portal User Interface, under "Reports".

With this new API endpoint, you can build your own reports and integrate Language Weaver usage information in your Business Intelligence or reporting solution.

The API endpoint is documented on the Language Weaver Developer portal at https://developers.languageweaver.com/api/lw/reports/usage.html

Below are some information about the usage report API endpoint:

  • This a synchronous API endpoint: you need to submit a POST request with parameters sent in JSON format and the server response will be a JSON with the usage report
  • Mandatory parameters are startDate and endDate.
  • The maximum range supported in a single call is 3 months 
  • If you would like to get reporting information for a longer period, you will need to perform multiple calls.
  • The endpoint is limited to 1 request per minute.
  • Optional parameters include languagePairIds, userIds, labelIds, clientIds and applicationIds. You can use the keyword "all" to get a break down reporting for each element.
  • Usage report output is provided with a split per year and per month.
  • It doesn't support daily split, but it is possible to create daily queries that will have a start date and end date set to be the same day.

Below is an example of the JSON to be sent to the API endpoint:

{
  "startDate": "2022/02/01",
  "endDate": "2022/03/31",
  "languagePairIds" : ["all"],
  "userIds": ["3"]
}

This request will pull data from February and March (startDate and EndDate are inclusive), for user with userIds "3", and it will include a split per language pair.

An example of the output is displayed below:

{
  "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"
      },
      "reportYear": 2022,
      "reportMonth": 3
    },
    {
      "outputWordCount": 750,
      "outputCharCount": 2402,
      "count": 5,
      "inputWordCount": 743,
      "inputCharCount": 2350,
      "accountId": 2,
      "user": {
        "userId": 3,
        "firstName": "John3",
        "middleName": "M3",
        "lastName": "Smith3",
        "email": "jsmith3@domain.com"
      },
      "languagePair": {
        "name": "engspa_generic",
        "displayName": "Generic",
        "sourceLanguageId": "eng",
        "targetLanguageId": "spa"
      },
      "reportYear": 2022,
      "reportMonth": 2
    },
    .......
  ]
}

Since the output response is in a structured JSON format, it will be supported by the majority of reporting and business intelligence tool and you will be able to generate your own reports and dashboard.

We hope you'll find this new API endpoint useful and we look forward to getting your feedback.

Thank you