What's the proper way to format Translation Memory Export filter expression

The GroupShare API has a TranslationMemory Export feature

When you make a request for a TM Export you specify the tmId, source and target language.

There is an additional parameter in the request body, and it contains the export filter:

Screenshot of Trados Studio GroupShare API documentation showing parameters for TranslationMemory Export feature including tmId, source, target, and request body with filter expression format.

What is the proper way to format the filter expression in the request body?

I'm trying to export all the TUs created after a certain date. From what I see, the API supports this, but any format I've tried so far has thrown an error.

Could someone provide me with a sample JSON of this filter that works?



Generated Image Alt-Text
[edited by: Trados AI at 10:32 AM (GMT 0) on 4 Mar 2024]
Parents
  • I also have this problem and am also looking for help.

    Here's what I've tried:

    {
      "filter": {
        "fields": [
          {
            "name": "string",
            "type": "Unknown",
            "values": [
              "string"
            ]
          }
        ],
        "expression": "(\"Created on\" > '01/01/2019')"
      },
      "callbackUrl": null
    }

    In particular, the `expresion` property contains correctly-escaped JSON.

    This request is accepted with a 200 (OK) response containing...

    {
        "id": "34107371-15ab-46ea-9e02-3db266aff4e0",
        "translationMemoryId": "6414336a-b745-4592-97fa-1941c36146cd",
        "status": "Queued"
    }

    But if I then query for the status of this task I receive...

    {
        "id": "34107371-15ab-46ea-9e02-3db266aff4e0",
        "displayName": "MY TM NAME",
        "type": "TmService.Export",
        "settings": {
            "translationMemoryId": "6414336a-b745-4592-97fa-1941c36146cd",
            "filter": {
                "fields": [],
                "expression": "(\"Created on\" > '01/01/2019')"
            },
            "source": "de-ch",
            "target": "it-ch",
            "settingsType": "TmService.Export"
        },
        "details": [
            {
                "key": "Default",
                "status": "Failed",
                "details": [
                    "Error in Filter Expression: ErrorFilterUnknownField - position 12, input \"(\"Created on\" > '01/01/2019')\""
                ]
            }
        ],
        "status": "Failed",
        "createdAt": "2019-06-05T10:32:00.1238392+00:00",
        "updatedAt": "2019-06-05T10:32:00.4207523+00:00",
        "ownerId": "7e1f438c-e4a0-472d-b24a-4711f5a6e910"
    }

    It clearly doesn't like the expression. Is it because of the way I've escaped the double-quotes? Or is it the 'Created on' property/field? Or the value I've supplied? I've written the expression as

    "(\"Created on\" > '01/01/2019')"

    because that conforms to the REST API Filter Expressions guide, but I've also tried it as

    "(\"Created on\" > \"01/01/2019\")"

    and received the same response. I've also tried it without parentheses: same response.

Reply
  • I also have this problem and am also looking for help.

    Here's what I've tried:

    {
      "filter": {
        "fields": [
          {
            "name": "string",
            "type": "Unknown",
            "values": [
              "string"
            ]
          }
        ],
        "expression": "(\"Created on\" > '01/01/2019')"
      },
      "callbackUrl": null
    }

    In particular, the `expresion` property contains correctly-escaped JSON.

    This request is accepted with a 200 (OK) response containing...

    {
        "id": "34107371-15ab-46ea-9e02-3db266aff4e0",
        "translationMemoryId": "6414336a-b745-4592-97fa-1941c36146cd",
        "status": "Queued"
    }

    But if I then query for the status of this task I receive...

    {
        "id": "34107371-15ab-46ea-9e02-3db266aff4e0",
        "displayName": "MY TM NAME",
        "type": "TmService.Export",
        "settings": {
            "translationMemoryId": "6414336a-b745-4592-97fa-1941c36146cd",
            "filter": {
                "fields": [],
                "expression": "(\"Created on\" > '01/01/2019')"
            },
            "source": "de-ch",
            "target": "it-ch",
            "settingsType": "TmService.Export"
        },
        "details": [
            {
                "key": "Default",
                "status": "Failed",
                "details": [
                    "Error in Filter Expression: ErrorFilterUnknownField - position 12, input \"(\"Created on\" > '01/01/2019')\""
                ]
            }
        ],
        "status": "Failed",
        "createdAt": "2019-06-05T10:32:00.1238392+00:00",
        "updatedAt": "2019-06-05T10:32:00.4207523+00:00",
        "ownerId": "7e1f438c-e4a0-472d-b24a-4711f5a6e910"
    }

    It clearly doesn't like the expression. Is it because of the way I've escaped the double-quotes? Or is it the 'Created on' property/field? Or the value I've supplied? I've written the expression as

    "(\"Created on\" > '01/01/2019')"

    because that conforms to the REST API Filter Expressions guide, but I've also tried it as

    "(\"Created on\" > \"01/01/2019\")"

    and received the same response. I've also tried it without parentheses: same response.

Children
No Data