Searching for Translations
Translations can be retrieved via the API either by referencing them directly using their ID or by using a search function.
The search modes Similar search and Concordance search are available via the API, each one either with explicitly defined search filters or by passing the GUID of a predefined filter. See crossTank API v2 - Overview for more details on how the search functions work.
The Across Identity Server grants the application an access token. Each request to the API has to have this token in the header.
Please note that the examples below omit the headers to stay compact.
Example: Simple Search Query (Concordance Search)
A simple search query can be done by specifying a query and a resultLimit. The minimal parameters for the query are a Pattern object containing a Language value and a TargetLanguage value. By setting the TargetLanguage value to 0, it is possible to search for all translations for a given source language.
http://localhost/across/crosstank/api/v2/Translations/concordanceSearch
{ "Pattern": { "Language": 1031 }, "TargetLanguage": 1033 }
Example: Creating Search Filters
Instead of defining filtering criteria for the search explicitly, the API can use predefined search filters. The following example is a filter that limits the search to translations created (DateTimeFilter/FilterMode value 0) between 1/6/2019 and 12/11/2019, with the state MachineTranslated (TranslationStatesFilter value 4) into all languages (TargetLanguage value 0). The request will return the GUID of the created filter which can then be passed to the respective search functions (e.g. /api/v2/Translations/concordanceSearchWithFilter) or be used to delete the filter.
http://localhost/across/crosstank/api/v2/Translations/createSearchFilter
{ "FilterExpirationInMinutes": 0, "TargetLanguage": 0, "DateTimeFilter": { "FilterMode": 0, "Start": "2019-06-01T00:00:00.000Z", "End": "2019-11-12T00:00:00.000Z" }, "TranslationStatesFilter": [ 4 ] }