Back to API Reference Home

POST v1/tms/{tmGuid}/lookupsegments

Performs a lookup operation in the translation memory specified by a Guid. Remark: for performance reasons the operation currently does not return valid values in the context related fields (ContextID, PrecedingSegment, FollowingSegment) of the TransUnit field of the returned TMHits object. These pieces of information can be retrieved by issuing an extra request getting the specific TM entry based on its key.

Request information

Uri parameters

NameTypeDescriptionAdditional information
tmGuidGuidThe Guid of the translation memory

Request body type

NameTypeDescription
OptionsLookupSegmentOptions
AdjustFuzzyMatchesBooleanOptional, default value: False; Defines whether an adjustment of fuzzy hits should be performed.
InlineTagStrictnessInlineTagStrictness (enum)Optional, default value: 0; Possible enum values: 0:Strict; 1:Medium; 2:Permissive; Defines the strictness of matching inline tags.
MatchThresholdInt32Optional, default value: 0; The match threshold for the lookup result. A number between 50 and 102 is expected.
OnlyBestBooleanOptional, default value: False; Defines whether the lookup should return only the best matches. If true, custom metas are not included in the lookup result (the "CustomMetas" array member is always empty for the returned "TransUnit" items).
OnlyUnambiguousBooleanOptional, default value: False; Defines whether the lookup should return only unambiguous matches. Only relevant if MatchThreshold is 100, 101 or 102.
ReverseLookupBooleanOptional, default value: False; Defines whether a reversed lookup should be performed.
ShowFragmentHitsBooleanOptional, default value: False; Defines whether to show fragment assembly hits in the lookup result.
SegmentsQuerySegment[]Obligatory; An array of the segments to search.
ContextIDStringOptional, default value: null; The context id of the segment.
FollowingSegmentStringOptional, default value: null; The following segment.
PrecedingSegmentStringOptional, default value: null; The preceding segment.
SegmentStringObligatory; The segment to search.

Request body formats

application/json

Sample:
{
  "Segments": [
    {
      "ContextID": "context id",
      "FollowingSegment": "<seg>Following segment content.</seg>",
      "PrecedingSegment": "<seg>Preceding segment content.</seg>",
      "Segment": "<seg>Sample segment content.</seg>"
    },
    {
      "ContextID": "context id",
      "FollowingSegment": "<seg>Following segment content.</seg>",
      "PrecedingSegment": "<seg>Preceding segment content.</seg>",
      "Segment": "<seg>Sample segment content.</seg>"
    },
    {
      "ContextID": "context id",
      "FollowingSegment": "<seg>Following segment content.</seg>",
      "PrecedingSegment": "<seg>Preceding segment content.</seg>",
      "Segment": "<seg>Sample segment content.</seg>"
    }
  ],
  "Options": {
    "AdjustFuzzyMatches": true,
    "InlineTagStrictness": 2,
    "MatchThreshold": 100,
    "ShowFragmentHits": false,
    "OnlyBest": true,
    "OnlyUnambiguous": true,
    "ReverseLookup": true
  }
}

Response information

Response return type

NameTypeDescription
ResultTMHitsPerSegment[]Optional, default value: null; The result of the lookup.
TMHitsTMHit[]Optional, default value: null; The result of the lookup per segment.
MatchRateInt32Optional, default value: null; The match rate of the lookup hit.
TransUnitTMEntryModel
ClientStringThe client of the TM entry.
ContextIDStringThe context id of the TM entry.
CreatedDateTimeThe creaton date of the TM entry.
CreatorStringThe creator of the TM entry.
CustomMetasTMCustomMetaItem[]An array of the TM entry's custom meta properties.
NameStringThe name of the custom meta property.
ValueObjectThe value of the custom meta property.
DocumentStringThe document of the TM entry.
DomainStringThe domain of the TM entry.
FollowingSegmentStringThe following segment of the TM entry.
KeyInt32The key of the TM entry.
ModifiedDateTimeThe date of the TM entry's last modification. An OptimisticConcurrencyError occurs during the update action if it does not match the existing entry's Modified parameter.
ModifierStringThe last modifier of the TM entry.
PrecedingSegmentStringThe preceding segment of the TM entry.
ProjectStringThe project of the TM entry.
SourceSegmentStringThe source segment of the TM entry.
SubjectStringThe subject of the TM entry.
TargetSegmentStringThe target segment of the TM entry.

Response body formats

application/json

Sample:
{
  "Result": [
    {
      "TMHits": [
        {
          "MatchRate": 1,
          "TransUnit": {
            "Created": "2015-08-28T14:02:31.22Z",
            "Creator": "Built-in administrator",
            "Modified": "2015-08-28T14:02:31.22Z",
            "Modifier": "Built-in administrator",
            "Client": "client",
            "ContextID": "context id",
            "Document": "document",
            "Domain": "domain",
            "FollowingSegment": "<seg>Following segment content.</seg>",
            "Key": 0,
            "PrecedingSegment": "<seg>Preceding segment content.</seg>",
            "Project": "project",
            "SourceSegment": "<seg>Sample segment content1.</seg>",
            "Subject": "subject",
            "TargetSegment": "<seg>Sample segment content2.</seg>",
            "CustomMetas": [
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              }
            ]
          }
        },
        {
          "MatchRate": 1,
          "TransUnit": {
            "Created": "2015-08-28T14:02:31.22Z",
            "Creator": "Built-in administrator",
            "Modified": "2015-08-28T14:02:31.22Z",
            "Modifier": "Built-in administrator",
            "Client": "client",
            "ContextID": "context id",
            "Document": "document",
            "Domain": "domain",
            "FollowingSegment": "<seg>Following segment content.</seg>",
            "Key": 0,
            "PrecedingSegment": "<seg>Preceding segment content.</seg>",
            "Project": "project",
            "SourceSegment": "<seg>Sample segment content1.</seg>",
            "Subject": "subject",
            "TargetSegment": "<seg>Sample segment content2.</seg>",
            "CustomMetas": [
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              }
            ]
          }
        },
        {
          "MatchRate": 1,
          "TransUnit": {
            "Created": "2015-08-28T14:02:31.22Z",
            "Creator": "Built-in administrator",
            "Modified": "2015-08-28T14:02:31.22Z",
            "Modifier": "Built-in administrator",
            "Client": "client",
            "ContextID": "context id",
            "Document": "document",
            "Domain": "domain",
            "FollowingSegment": "<seg>Following segment content.</seg>",
            "Key": 0,
            "PrecedingSegment": "<seg>Preceding segment content.</seg>",
            "Project": "project",
            "SourceSegment": "<seg>Sample segment content1.</seg>",
            "Subject": "subject",
            "TargetSegment": "<seg>Sample segment content2.</seg>",
            "CustomMetas": [
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              }
            ]
          }
        }
      ]
    },
    {
      "TMHits": [
        {
          "MatchRate": 1,
          "TransUnit": {
            "Created": "2015-08-28T14:02:31.22Z",
            "Creator": "Built-in administrator",
            "Modified": "2015-08-28T14:02:31.22Z",
            "Modifier": "Built-in administrator",
            "Client": "client",
            "ContextID": "context id",
            "Document": "document",
            "Domain": "domain",
            "FollowingSegment": "<seg>Following segment content.</seg>",
            "Key": 0,
            "PrecedingSegment": "<seg>Preceding segment content.</seg>",
            "Project": "project",
            "SourceSegment": "<seg>Sample segment content1.</seg>",
            "Subject": "subject",
            "TargetSegment": "<seg>Sample segment content2.</seg>",
            "CustomMetas": [
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              }
            ]
          }
        },
        {
          "MatchRate": 1,
          "TransUnit": {
            "Created": "2015-08-28T14:02:31.22Z",
            "Creator": "Built-in administrator",
            "Modified": "2015-08-28T14:02:31.22Z",
            "Modifier": "Built-in administrator",
            "Client": "client",
            "ContextID": "context id",
            "Document": "document",
            "Domain": "domain",
            "FollowingSegment": "<seg>Following segment content.</seg>",
            "Key": 0,
            "PrecedingSegment": "<seg>Preceding segment content.</seg>",
            "Project": "project",
            "SourceSegment": "<seg>Sample segment content1.</seg>",
            "Subject": "subject",
            "TargetSegment": "<seg>Sample segment content2.</seg>",
            "CustomMetas": [
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              }
            ]
          }
        },
        {
          "MatchRate": 1,
          "TransUnit": {
            "Created": "2015-08-28T14:02:31.22Z",
            "Creator": "Built-in administrator",
            "Modified": "2015-08-28T14:02:31.22Z",
            "Modifier": "Built-in administrator",
            "Client": "client",
            "ContextID": "context id",
            "Document": "document",
            "Domain": "domain",
            "FollowingSegment": "<seg>Following segment content.</seg>",
            "Key": 0,
            "PrecedingSegment": "<seg>Preceding segment content.</seg>",
            "Project": "project",
            "SourceSegment": "<seg>Sample segment content1.</seg>",
            "Subject": "subject",
            "TargetSegment": "<seg>Sample segment content2.</seg>",
            "CustomMetas": [
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              }
            ]
          }
        }
      ]
    },
    {
      "TMHits": [
        {
          "MatchRate": 1,
          "TransUnit": {
            "Created": "2015-08-28T14:02:31.22Z",
            "Creator": "Built-in administrator",
            "Modified": "2015-08-28T14:02:31.22Z",
            "Modifier": "Built-in administrator",
            "Client": "client",
            "ContextID": "context id",
            "Document": "document",
            "Domain": "domain",
            "FollowingSegment": "<seg>Following segment content.</seg>",
            "Key": 0,
            "PrecedingSegment": "<seg>Preceding segment content.</seg>",
            "Project": "project",
            "SourceSegment": "<seg>Sample segment content1.</seg>",
            "Subject": "subject",
            "TargetSegment": "<seg>Sample segment content2.</seg>",
            "CustomMetas": [
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              }
            ]
          }
        },
        {
          "MatchRate": 1,
          "TransUnit": {
            "Created": "2015-08-28T14:02:31.22Z",
            "Creator": "Built-in administrator",
            "Modified": "2015-08-28T14:02:31.22Z",
            "Modifier": "Built-in administrator",
            "Client": "client",
            "ContextID": "context id",
            "Document": "document",
            "Domain": "domain",
            "FollowingSegment": "<seg>Following segment content.</seg>",
            "Key": 0,
            "PrecedingSegment": "<seg>Preceding segment content.</seg>",
            "Project": "project",
            "SourceSegment": "<seg>Sample segment content1.</seg>",
            "Subject": "subject",
            "TargetSegment": "<seg>Sample segment content2.</seg>",
            "CustomMetas": [
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              }
            ]
          }
        },
        {
          "MatchRate": 1,
          "TransUnit": {
            "Created": "2015-08-28T14:02:31.22Z",
            "Creator": "Built-in administrator",
            "Modified": "2015-08-28T14:02:31.22Z",
            "Modifier": "Built-in administrator",
            "Client": "client",
            "ContextID": "context id",
            "Document": "document",
            "Domain": "domain",
            "FollowingSegment": "<seg>Following segment content.</seg>",
            "Key": 0,
            "PrecedingSegment": "<seg>Preceding segment content.</seg>",
            "Project": "project",
            "SourceSegment": "<seg>Sample segment content1.</seg>",
            "Subject": "subject",
            "TargetSegment": "<seg>Sample segment content2.</seg>",
            "CustomMetas": [
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              },
              {
                "Name": "name",
                "Value": "value"
              }
            ]
          }
        }
      ]
    }
  ]
}