Skip to main content
POST
/
api2
/
v1
/
transMemories
/
{transMemoryUid}
/
search
Search translation memory (sync)
curl --request POST \
  --url https://cloud.memsource.com/web/api2/v1/transMemories/{transMemoryUid}/search \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "sourceLang": "<string>",
  "nextSegment": "<string>",
  "phraseQuery": true,
  "previousSegment": "<string>",
  "tagMetadata": [
    {
      "content": "<string>",
      "id": "<string>",
      "transAttributes": "<string>",
      "type": "<string>"
    }
  ],
  "targetLangs": [
    "<string>"
  ],
  "trimQuery": true
}
'
import requests

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

payload = {
"query": "<string>",
"sourceLang": "<string>",
"nextSegment": "<string>",
"phraseQuery": True,
"previousSegment": "<string>",
"tagMetadata": [
{
"content": "<string>",
"id": "<string>",
"transAttributes": "<string>",
"type": "<string>"
}
],
"targetLangs": ["<string>"],
"trimQuery": True
}
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({
query: '<string>',
sourceLang: '<string>',
nextSegment: '<string>',
phraseQuery: true,
previousSegment: '<string>',
tagMetadata: [
{
content: '<string>',
id: '<string>',
transAttributes: '<string>',
type: '<string>'
}
],
targetLangs: ['<string>'],
trimQuery: true
})
};

fetch('https://cloud.memsource.com/web/api2/v1/transMemories/{transMemoryUid}/search', 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}/search",
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([
'query' => '<string>',
'sourceLang' => '<string>',
'nextSegment' => '<string>',
'phraseQuery' => true,
'previousSegment' => '<string>',
'tagMetadata' => [
[
'content' => '<string>',
'id' => '<string>',
'transAttributes' => '<string>',
'type' => '<string>'
]
],
'targetLangs' => [
'<string>'
],
'trimQuery' => true
]),
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}/search"

payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"sourceLang\": \"<string>\",\n \"nextSegment\": \"<string>\",\n \"phraseQuery\": true,\n \"previousSegment\": \"<string>\",\n \"tagMetadata\": [\n {\n \"content\": \"<string>\",\n \"id\": \"<string>\",\n \"transAttributes\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"targetLangs\": [\n \"<string>\"\n ],\n \"trimQuery\": true\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}/search")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"sourceLang\": \"<string>\",\n \"nextSegment\": \"<string>\",\n \"phraseQuery\": true,\n \"previousSegment\": \"<string>\",\n \"tagMetadata\": [\n {\n \"content\": \"<string>\",\n \"id\": \"<string>\",\n \"transAttributes\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"targetLangs\": [\n \"<string>\"\n ],\n \"trimQuery\": true\n}")
.asString();
require 'uri'
require 'net/http'

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

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 \"query\": \"<string>\",\n \"sourceLang\": \"<string>\",\n \"nextSegment\": \"<string>\",\n \"phraseQuery\": true,\n \"previousSegment\": \"<string>\",\n \"tagMetadata\": [\n {\n \"content\": \"<string>\",\n \"id\": \"<string>\",\n \"transAttributes\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"targetLangs\": [\n \"<string>\"\n ],\n \"trimQuery\": true\n}"

response = http.request(request)
puts response.read_body
{
  "searchResults": [
    {
      "grossScore": 123,
      "score": 123,
      "segmentId": "<string>",
      "source": {
        "client": {
          "id": 123,
          "name": "<string>"
        },
        "createdAt": 123,
        "createdBy": {
          "email": "<string>",
          "firstName": "<string>",
          "id": "<string>",
          "lastName": "<string>",
          "uid": "<string>",
          "userName": "<string>"
        },
        "domain": {
          "id": 123,
          "name": "<string>"
        },
        "filename": "<string>",
        "id": "<string>",
        "key": "<string>",
        "lang": "<string>",
        "modifiedAt": 123,
        "modifiedBy": {
          "email": "<string>",
          "firstName": "<string>",
          "id": "<string>",
          "lastName": "<string>",
          "uid": "<string>",
          "userName": "<string>"
        },
        "nextSegment": "<string>",
        "previousSegment": "<string>",
        "project": {
          "id": 123,
          "name": "<string>",
          "uid": "<string>"
        },
        "rtl": true,
        "subDomain": {
          "id": 123,
          "name": "<string>"
        },
        "tagMetadata": [
          {
            "content": "<string>",
            "id": "<string>",
            "transAttributes": "<string>",
            "type": "<string>"
          }
        ],
        "text": "<string>"
      },
      "subSegment": true,
      "transMemory": {
        "id": "<string>",
        "name": "<string>",
        "reverse": true,
        "uid": "<string>"
      },
      "translations": [
        {
          "client": {
            "id": 123,
            "name": "<string>"
          },
          "createdAt": 123,
          "createdBy": {
            "email": "<string>",
            "firstName": "<string>",
            "id": "<string>",
            "lastName": "<string>",
            "uid": "<string>",
            "userName": "<string>"
          },
          "domain": {
            "id": 123,
            "name": "<string>"
          },
          "filename": "<string>",
          "id": "<string>",
          "key": "<string>",
          "lang": "<string>",
          "modifiedAt": 123,
          "modifiedBy": {
            "email": "<string>",
            "firstName": "<string>",
            "id": "<string>",
            "lastName": "<string>",
            "uid": "<string>",
            "userName": "<string>"
          },
          "nextSegment": "<string>",
          "previousSegment": "<string>",
          "project": {
            "id": 123,
            "name": "<string>",
            "uid": "<string>"
          },
          "rtl": true,
          "subDomain": {
            "id": 123,
            "name": "<string>"
          },
          "tagMetadata": [
            {
              "content": "<string>",
              "id": "<string>",
              "transAttributes": "<string>",
              "type": "<string>"
            }
          ],
          "text": "<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

Search request payload

query
string
required
sourceLang
string
required
nextSegment
string
phraseQuery
boolean

Return both wildcard and exact search results. Default: true

previousSegment
string
tagMetadata
object[]
targetLangs
string[]
trimQuery
boolean

Remove leading and trailing whitespace from query. Default: true

Response

OK

searchResults
object[]

Translation memory search results