Skip to main content
POST
/
api2
/
v1
/
transMemories
/
{transMemoryUid}
/
exportByQueryAsync
Search translation memory
curl --request POST \
  --url https://cloud.memsource.com/web/api2/v1/transMemories/{transMemoryUid}/exportByQueryAsync \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "callbackUrl": "<string>",
  "createdAtMax": "2023-11-07T05:31:56Z",
  "createdAtMin": "2023-11-07T05:31:56Z",
  "exportTargetLangs": [
    "<string>"
  ],
  "filename": "<string>",
  "modifiedAtMax": "2023-11-07T05:31:56Z",
  "modifiedAtMin": "2023-11-07T05:31:56Z",
  "queries": [
    "<string>"
  ],
  "queryLangs": [
    "<string>"
  ]
}
'
import requests

url = "https://cloud.memsource.com/web/api2/v1/transMemories/{transMemoryUid}/exportByQueryAsync"

payload = {
"callbackUrl": "<string>",
"createdAtMax": "2023-11-07T05:31:56Z",
"createdAtMin": "2023-11-07T05:31:56Z",
"exportTargetLangs": ["<string>"],
"filename": "<string>",
"modifiedAtMax": "2023-11-07T05:31:56Z",
"modifiedAtMin": "2023-11-07T05:31:56Z",
"queries": ["<string>"],
"queryLangs": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
callbackUrl: '<string>',
createdAtMax: '2023-11-07T05:31:56Z',
createdAtMin: '2023-11-07T05:31:56Z',
exportTargetLangs: ['<string>'],
filename: '<string>',
modifiedAtMax: '2023-11-07T05:31:56Z',
modifiedAtMin: '2023-11-07T05:31:56Z',
queries: ['<string>'],
queryLangs: ['<string>']
})
};

fetch('https://cloud.memsource.com/web/api2/v1/transMemories/{transMemoryUid}/exportByQueryAsync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://cloud.memsource.com/web/api2/v1/transMemories/{transMemoryUid}/exportByQueryAsync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'callbackUrl' => '<string>',
'createdAtMax' => '2023-11-07T05:31:56Z',
'createdAtMin' => '2023-11-07T05:31:56Z',
'exportTargetLangs' => [
'<string>'
],
'filename' => '<string>',
'modifiedAtMax' => '2023-11-07T05:31:56Z',
'modifiedAtMin' => '2023-11-07T05:31:56Z',
'queries' => [
'<string>'
],
'queryLangs' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://cloud.memsource.com/web/api2/v1/transMemories/{transMemoryUid}/exportByQueryAsync"

payload := strings.NewReader("{\n \"callbackUrl\": \"<string>\",\n \"createdAtMax\": \"2023-11-07T05:31:56Z\",\n \"createdAtMin\": \"2023-11-07T05:31:56Z\",\n \"exportTargetLangs\": [\n \"<string>\"\n ],\n \"filename\": \"<string>\",\n \"modifiedAtMax\": \"2023-11-07T05:31:56Z\",\n \"modifiedAtMin\": \"2023-11-07T05:31:56Z\",\n \"queries\": [\n \"<string>\"\n ],\n \"queryLangs\": [\n \"<string>\"\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://cloud.memsource.com/web/api2/v1/transMemories/{transMemoryUid}/exportByQueryAsync")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"callbackUrl\": \"<string>\",\n \"createdAtMax\": \"2023-11-07T05:31:56Z\",\n \"createdAtMin\": \"2023-11-07T05:31:56Z\",\n \"exportTargetLangs\": [\n \"<string>\"\n ],\n \"filename\": \"<string>\",\n \"modifiedAtMax\": \"2023-11-07T05:31:56Z\",\n \"modifiedAtMin\": \"2023-11-07T05:31:56Z\",\n \"queries\": [\n \"<string>\"\n ],\n \"queryLangs\": [\n \"<string>\"\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://cloud.memsource.com/web/api2/v1/transMemories/{transMemoryUid}/exportByQueryAsync")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callbackUrl\": \"<string>\",\n \"createdAtMax\": \"2023-11-07T05:31:56Z\",\n \"createdAtMin\": \"2023-11-07T05:31:56Z\",\n \"exportTargetLangs\": [\n \"<string>\"\n ],\n \"filename\": \"<string>\",\n \"modifiedAtMax\": \"2023-11-07T05:31:56Z\",\n \"modifiedAtMin\": \"2023-11-07T05:31:56Z\",\n \"queries\": [\n \"<string>\"\n ],\n \"queryLangs\": [\n \"<string>\"\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "asyncExport": {
    "asyncRequest": {},
    "exportTargetLangs": [
      "<string>"
    ],
    "queries": [
      {
        "lang": "<string>",
        "query": "<string>"
      }
    ],
    "transMemory": {}
  },
  "asyncRequest": {
    "asyncResponse": {
      "acceptedSegmentsCount": 123,
      "dateCreated": "2023-11-07T05:31:56Z",
      "errorCode": "<string>",
      "errorDesc": "<string>",
      "errorDetails": [
        {
          "args": {},
          "code": "<string>",
          "message": "<string>"
        }
      ],
      "warnings": [
        {
          "args": {},
          "code": "<string>",
          "message": "<string>"
        }
      ]
    },
    "createdBy": {
      "email": "<string>",
      "firstName": "<string>",
      "id": "<string>",
      "lastName": "<string>",
      "uid": "<string>",
      "userName": "<string>"
    },
    "dateCreated": "2023-11-07T05:31:56Z",
    "id": "<string>",
    "parent": "<unknown>",
    "project": {
      "name": "<string>",
      "uid": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

Get a token from auth/login endpoint and then pass it in the Authorization HTTP header in every subsequent API call. For more information visit our help center.

Path Parameters

transMemoryUid
string
required

Translation memory UID

Body

application/json

Export by query request payload

Request body for exportByQueryAsync; specifies query expressions, locales and optional filters

callbackUrl
string

Callback URL to notify when the async export completes

createdAtMax
string<date-time>

Maximum segment creation timestamp filter

createdAtMin
string<date-time>

Minimum segment creation timestamp filter

createdBy
object
exportTargetLangs
string[]

Target locale(s) for the exported TMX. Optional — if omitted, all target TUVs are exported (OR/disjunction). TUs are kept when they have at least one TUV matching any listed locale.

filename
string

Custom filename for the exported TMX file

modifiedAtMax
string<date-time>

Maximum segment last-modified timestamp filter

modifiedAtMin
string<date-time>

Minimum segment last-modified timestamp filter

modifiedBy
object
project
object

Reference to an object by its unique identifier

queries
string[]

Search query strings (one per queryLangs entry). Optional — if omitted or empty, exports all TUs matching targetLocales (OR). When provided, multiple entries are AND-intersected: a TU must satisfy every query. An empty string "" or null entry is ignored (no constraint for that locale); use "*" to require a TUV to exist in a locale without filtering by text.

queryLangs
string[]

Locale for each corresponding queries entry (aligned 1-to-1). Optional — required only when queries is provided; must have the same number of entries.

Response

OK

Response envelope returned by exportByQueryAsync with async request handle and export job details

asyncExport
object

Export job descriptor containing query expressions, locale selections and the source TM reference

asyncRequest
object