Upload new context and run automatic context matching
Changed onCombines two endpoints:
- Upload new context
- Run automatic context matching
The following context types are supported via the Smartling API:
- HTML: HTML files or files with content type text/html
- IMAGE: Image files
- VIDEO:
- Video file
- Link to video, such as:
- YouTube link
- Vimeo link
- Direct link to an .mp4 file
Strings to match are retrieved from the project specified by the projectId and can be filtered further by the optional matchParams parameter.
If the uploaded file doesn't match any string, the context may not be created.
Example of the raw request accepted by this API:
Content-Type: multipart/form-data; boundary
----------------------------293641908835402749402839
Content-Disposition: form-data; name="content"; filename="example.html"
Content-Type: text/html
<html>
<body>
<div> bla</div>
</body>
</html>
----------------------------293641908835402749402839
Content-Disposition: form-data; name="name"
https://your.domain.com/path/example.html
----------------------------293641908835402749402839
Content-Disposition: form-data; name="matchParams"
Content-Type: application/json
{
"contentFileUri":"example.properties",
"stringHashcodes": [],
"overrideContextOlderThanDays": 1
}
Request
- Base URLhttps://api.smartling.com
- AuthHTTP bearer
Path parameters
Unique identifier of a Smartling project — 9 lowercase alphanumeric characters.
A unique project identifier. This can be found in the Smartling Dashboard under Account Settings > API.
Request body multipart/form-data
Example request
{
"matchParams": {
"contentFileUri": "/content/en/home.json",
"stringHashcodes": [
"d41d8cd98f00b204e9800998ecf8427e"
],
"translationJobUids": [
"j45v1uvsi3tx"
]
}
}Response
ACCEPTED
Example response
{
"response": {
"data": {
"processUid": "097ecbc2-8f1b-4ce5-b5c4-d48c3f0e5d9e"
}
}
}Changes
- breaking
added the pattern
^[a-z0-9]{9}$to thepathrequest parameterprojectId - breaking
added to the
/request propertyallOflist - breaking
added the pattern
^[a-f0-9]{32}$to the request property// - breaking
added the pattern
^[a-z0-9]{12}$to the request property// - breaking
the response property
///became nullable for the status - breaking
the response property
///became nullable for the status - breaking
the response property
///became nullable for the status - breaking
the response property
///became nullable for the status - breaking
the response property
///became nullable for the status - breaking
the response property
///became nullable for the status - breaking
the response property
///became nullable for the status - breaking
the response property
///became nullable for the status - breaking
the
//response's property type changed fromstringto no type, and format fromuuidto no format for status - info
for the
pathrequest parameterprojectId, the format was generalized fromuuidto no format - info
the
/request property type was generalized fromstringto no type - info
the
//request property format was generalized fromhashto no format - info
the
//request property format was generalized fromhashto no format - info
added to the
//response propertyallOflist for the response status
- breaking
- breaking
the
request property type changed fromstringtoobject - info
added the new optional request property
/ - info
added the new optional request property
/ - info
added the new optional request property
/ - info
added the new optional request property
/ - info
added the new optional request property
/ - info
added the optional property
//to the response with the status - info
response property
response/data/matchIddeprecated
- breaking