curl --request POST \
--url https://cloud.memsource.com/web/api2/v3/bilingualFiles \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form 'file={
"bytes": [
"aSDinaTvuI8gbWludGxpZnk="
],
"contentType": "<string>",
"empty": true,
"inputStream": {},
"name": "<string>",
"originalFilename": "<string>",
"resource": {
"description": "<string>",
"file": "<string>",
"filename": "<string>",
"inputStream": {},
"open": true,
"readable": true,
"uri": "<string>",
"url": "<string>"
},
"size": 123
}'import requests
url = "https://cloud.memsource.com/web/api2/v3/bilingualFiles"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"resource\": {\r\n \"description\": \"<string>\",\r\n \"file\": \"<string>\",\r\n \"filename\": \"<string>\",\r\n \"inputStream\": {},\r\n \"open\": true,\r\n \"readable\": true,\r\n \"uri\": \"<string>\",\r\n \"url\": \"<string>\"\r\n },\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--"
headers = {
"Authorization": "<api-key>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '{
"bytes": [
"aSDinaTvuI8gbWludGxpZnk="
],
"contentType": "<string>",
"empty": true,
"inputStream": {},
"name": "<string>",
"originalFilename": "<string>",
"resource": {
"description": "<string>",
"file": "<string>",
"filename": "<string>",
"inputStream": {},
"open": true,
"readable": true,
"uri": "<string>",
"url": "<string>"
},
"size": 123
}');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://cloud.memsource.com/web/api2/v3/bilingualFiles', 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/v3/bilingualFiles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"resource\": {\r\n \"description\": \"<string>\",\r\n \"file\": \"<string>\",\r\n \"filename\": \"<string>\",\r\n \"inputStream\": {},\r\n \"open\": true,\r\n \"readable\": true,\r\n \"uri\": \"<string>\",\r\n \"url\": \"<string>\"\r\n },\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data"
],
]);
$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/v3/bilingualFiles"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"resource\": {\r\n \"description\": \"<string>\",\r\n \"file\": \"<string>\",\r\n \"filename\": \"<string>\",\r\n \"inputStream\": {},\r\n \"open\": true,\r\n \"readable\": true,\r\n \"uri\": \"<string>\",\r\n \"url\": \"<string>\"\r\n },\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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/v3/bilingualFiles")
.header("Authorization", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"resource\": {\r\n \"description\": \"<string>\",\r\n \"file\": \"<string>\",\r\n \"filename\": \"<string>\",\r\n \"inputStream\": {},\r\n \"open\": true,\r\n \"readable\": true,\r\n \"uri\": \"<string>\",\r\n \"url\": \"<string>\"\r\n },\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.memsource.com/web/api2/v3/bilingualFiles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"resource\": {\r\n \"description\": \"<string>\",\r\n \"file\": \"<string>\",\r\n \"filename\": \"<string>\",\r\n \"inputStream\": {},\r\n \"open\": true,\r\n \"readable\": true,\r\n \"uri\": \"<string>\",\r\n \"url\": \"<string>\"\r\n },\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"asyncRequest": {
"action": "PRE_ANALYSE",
"asyncResponse": {
"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>",
"role": "SYS_ADMIN",
"uid": "<string>",
"userName": "<string>"
},
"dateCreated": "2023-11-07T05:31:56Z",
"id": "<string>",
"parent": "<unknown>",
"project": {
"name": "<string>",
"uid": "<string>"
}
},
"reference": {
"type": "JOB",
"uid": "<string>"
}
}Upload bilingual file (async)
Asynchronously uploads one or more bilingual files for a job. Send the files as a multipart/form-data request using the file form field. ZIP archives are automatically expanded into the bilingual files they contain. A maximum of 50 files may be uploaded in a single request. The saveToTransMemory parameter controls whether confirmed segments are saved to the translation memory, and setCompleted marks the affected job parts as completed after the upload. Requires EDIT and EDIT_SEGMENT rights on the job. The files are validated and accepted immediately and the processing continues in the background; the call returns 202 Accepted with an asynchronous request, which is a parent request with one child request for each uploaded file. Poll Get asynchronous request until the asyncResponse of the parent request is set; a child request with an error in its asyncResponse means that the particular file was not uploaded. The files are processed sequentially and independently, so a failure of one file does not roll back the files that were already uploaded. If any file fails, the parent request finishes with an error in its asyncResponse and the per-file results are available on the child requests. Optionally, callbackUrl can be used to receive a notification once the parent request has finished successfully; no callback is sent when any file failed. See the MXLIFF guide for the bilingual file format reference.
curl --request POST \
--url https://cloud.memsource.com/web/api2/v3/bilingualFiles \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form 'file={
"bytes": [
"aSDinaTvuI8gbWludGxpZnk="
],
"contentType": "<string>",
"empty": true,
"inputStream": {},
"name": "<string>",
"originalFilename": "<string>",
"resource": {
"description": "<string>",
"file": "<string>",
"filename": "<string>",
"inputStream": {},
"open": true,
"readable": true,
"uri": "<string>",
"url": "<string>"
},
"size": 123
}'import requests
url = "https://cloud.memsource.com/web/api2/v3/bilingualFiles"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"resource\": {\r\n \"description\": \"<string>\",\r\n \"file\": \"<string>\",\r\n \"filename\": \"<string>\",\r\n \"inputStream\": {},\r\n \"open\": true,\r\n \"readable\": true,\r\n \"uri\": \"<string>\",\r\n \"url\": \"<string>\"\r\n },\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--"
headers = {
"Authorization": "<api-key>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '{
"bytes": [
"aSDinaTvuI8gbWludGxpZnk="
],
"contentType": "<string>",
"empty": true,
"inputStream": {},
"name": "<string>",
"originalFilename": "<string>",
"resource": {
"description": "<string>",
"file": "<string>",
"filename": "<string>",
"inputStream": {},
"open": true,
"readable": true,
"uri": "<string>",
"url": "<string>"
},
"size": 123
}');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://cloud.memsource.com/web/api2/v3/bilingualFiles', 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/v3/bilingualFiles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"resource\": {\r\n \"description\": \"<string>\",\r\n \"file\": \"<string>\",\r\n \"filename\": \"<string>\",\r\n \"inputStream\": {},\r\n \"open\": true,\r\n \"readable\": true,\r\n \"uri\": \"<string>\",\r\n \"url\": \"<string>\"\r\n },\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data"
],
]);
$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/v3/bilingualFiles"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"resource\": {\r\n \"description\": \"<string>\",\r\n \"file\": \"<string>\",\r\n \"filename\": \"<string>\",\r\n \"inputStream\": {},\r\n \"open\": true,\r\n \"readable\": true,\r\n \"uri\": \"<string>\",\r\n \"url\": \"<string>\"\r\n },\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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/v3/bilingualFiles")
.header("Authorization", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"resource\": {\r\n \"description\": \"<string>\",\r\n \"file\": \"<string>\",\r\n \"filename\": \"<string>\",\r\n \"inputStream\": {},\r\n \"open\": true,\r\n \"readable\": true,\r\n \"uri\": \"<string>\",\r\n \"url\": \"<string>\"\r\n },\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.memsource.com/web/api2/v3/bilingualFiles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"resource\": {\r\n \"description\": \"<string>\",\r\n \"file\": \"<string>\",\r\n \"filename\": \"<string>\",\r\n \"inputStream\": {},\r\n \"open\": true,\r\n \"readable\": true,\r\n \"uri\": \"<string>\",\r\n \"url\": \"<string>\"\r\n },\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"asyncRequest": {
"action": "PRE_ANALYSE",
"asyncResponse": {
"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>",
"role": "SYS_ADMIN",
"uid": "<string>",
"userName": "<string>"
},
"dateCreated": "2023-11-07T05:31:56Z",
"id": "<string>",
"parent": "<unknown>",
"project": {
"name": "<string>",
"uid": "<string>"
}
},
"reference": {
"type": "JOB",
"uid": "<string>"
}
}Authorizations
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.
Query Parameters
Controls whether confirmed segments are saved to the translation memory
All, Confirmed, None When true, marks the affected job parts as completed after the upload
URL called once the asynchronous request has finished
Body
Multipart request with files
Show child attributes
Show child attributes
Was this page helpful?