curl --request POST \
--url https://cloud.memsource.com/web/api2/v2/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
}' \
--form file.resource.file='@example-file'import requests
url = "https://cloud.memsource.com/web/api2/v2/bilingualFiles"
files = { "file.resource.file": ("example-file", open("example-file", "rb")) }
payload = { "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
}" }
headers = {"Authorization": "<api-key>"}
response = requests.post(url, data=payload, files=files, 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
}');
form.append('file.resource.file', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://cloud.memsource.com/web/api2/v2/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/v2/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\r\nContent-Disposition: form-data; name=\"file.resource.file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\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/v2/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\r\nContent-Disposition: form-data; name=\"file.resource.file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\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/v2/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\r\nContent-Disposition: form-data; name=\"file.resource.file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.memsource.com/web/api2/v2/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\r\nContent-Disposition: form-data; name=\"file.resource.file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"jobs": [
{
"continuous": true,
"dateCreated": "2023-11-07T05:31:56Z",
"dateDue": "2023-11-07T05:31:56Z",
"filename": "<string>",
"imported": true,
"jobAssignedEmailTemplate": {},
"notificationIntervalInMinutes": 123,
"providers": [
{
"type": "<string>",
"id": "<string>",
"uid": "<string>"
}
],
"sourceFileUid": "<string>",
"status": "NEW",
"targetLang": "<string>",
"uid": "<string>",
"updateSourceDate": "2023-11-07T05:31:56Z",
"workflowLevel": 123,
"workflowStep": {
"id": "<string>",
"lqaEnabled": true,
"name": "<string>",
"order": 123,
"uid": "<string>"
}
}
],
"project": {
"name": "<string>",
"uid": "<string>"
}
}Upload bilingual file
Uploads one or more bilingual files for a job and returns the updated job parts together with their project. 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. See the MXLIFF guide for the bilingual file format reference.
curl --request POST \
--url https://cloud.memsource.com/web/api2/v2/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
}' \
--form file.resource.file='@example-file'import requests
url = "https://cloud.memsource.com/web/api2/v2/bilingualFiles"
files = { "file.resource.file": ("example-file", open("example-file", "rb")) }
payload = { "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
}" }
headers = {"Authorization": "<api-key>"}
response = requests.post(url, data=payload, files=files, 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
}');
form.append('file.resource.file', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://cloud.memsource.com/web/api2/v2/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/v2/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\r\nContent-Disposition: form-data; name=\"file.resource.file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\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/v2/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\r\nContent-Disposition: form-data; name=\"file.resource.file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\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/v2/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\r\nContent-Disposition: form-data; name=\"file.resource.file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.memsource.com/web/api2/v2/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\r\nContent-Disposition: form-data; name=\"file.resource.file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"jobs": [
{
"continuous": true,
"dateCreated": "2023-11-07T05:31:56Z",
"dateDue": "2023-11-07T05:31:56Z",
"filename": "<string>",
"imported": true,
"jobAssignedEmailTemplate": {},
"notificationIntervalInMinutes": 123,
"providers": [
{
"type": "<string>",
"id": "<string>",
"uid": "<string>"
}
],
"sourceFileUid": "<string>",
"status": "NEW",
"targetLang": "<string>",
"uid": "<string>",
"updateSourceDate": "2023-11-07T05:31:56Z",
"workflowLevel": 123,
"workflowStep": {
"id": "<string>",
"lqaEnabled": true,
"name": "<string>",
"order": 123,
"uid": "<string>"
}
}
],
"project": {
"name": "<string>",
"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
Body
Multipart request with files
Show child attributes
Show child attributes
Was this page helpful?