v2

latestOpenAPI 3.0.02026-08-07103189636.5 KB
Context

Run automatic context matching

Automatically matches context against strings in the project and creates corresponding bindings. Optionally, you can restrict matching to only a set of strings that you specify to ensure that no unwanted bindings are created.

The following endpoint does not support video contexts pointing to Youtube or Vimeo videos.

Optical Character Recognition (OCR) is used for IMAGE and VIDEO contexts, while HTML context uses an approximate string matching algorithm.

This is a convenient method provided to save time and complexity in your integration. Although that our OCR functionality is advanced, it cannot match 100% of strings. If you need complete context coverage, use either Create string to context bindings endpoint to bind strings manually or check your image contexts in the Smartling Dashboard after running this request to fill in any blanks. Note that OCR quality may be lower if you are using an unusual or script-like font.

Applying this operation to a video context, keep in mind the original context will be removed and image contexts will be created instead for each frame that has one matched string at least. A string can't be bound to multiple frames simultaneously.

post/context-api/v2/projects/{projectId}/contexts/{contextUid}/match/async

Path parameters

projectIdstring uuid required

A unique project identifier. This can be found in the Smartling Dashboard under Account Settings > API.

contextUidstring uuid required

Unique identifier of a context

Request body

contentFileUristring

File URI containing strings to perform matching with the context: <br/> Example: "contentFileUri": "example.properties" <br/> Can't be used along with the stringHashcodes or translationJobUids parameter.

stringHashcodesstring[]

An array of string hashcodes to perform matching with the context: <br/> Example: "stringHashcodes": ["hashcode1", "hashcode2"] <br/> Can't be used along with the contentFileUri or translationJobUids parameter.

translationJobUidsstring[]

A translation job UID to perform matching with the context. Only one UID can be specified: <br/> Example: "translationJobUids": ["translationJobUid"] <br/> Can't be used along with the contentFileUri or stringHashcodes parameter.

overrideContextOlderThanDaysinteger

Specifies whether to override context for strings that were already bound to other context, and that context is at least as "overrideContextOlderThanDays" old.

videoMatchingMode'SUBTITLES' | 'OCR_WITH_SPLITTING' | 'OCR'

Specifies the behavior of string matching for video contexts.

videoMatchingModeDescription
SUBTITLESIn this mode you should provide the property contentFileUri that points to the subtitles content file. Strings will be bound by the subtitle's timestamps.
OCR_WITH_SPLITTINGDetects key frames and checks each frame for text using OCR. If string matches, an image context is created for that frame. Frames without matches and the original video are deleted.
OCRDetects key frames and checks each frame for text using OCR. If string matches, we bind the string to the original video using the key frame's timestamp and text coordinates.

Response

ACCEPTED