Skip to main content
POST
/
api2
/
v1
/
services
Create service
curl --request POST \
  --url https://cloud.memsource.com/web/api2/v1/services \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "publicName": "<string>",
  "sourceLangs": [
    "<string>"
  ],
  "targetLangs": [
    "<string>"
  ],
  "type": "ProfessionalTranslation"
}
'
import requests

url = "https://cloud.memsource.com/web/api2/v1/services"

payload = {
"name": "<string>",
"publicName": "<string>",
"sourceLangs": ["<string>"],
"targetLangs": ["<string>"],
"type": "ProfessionalTranslation"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
publicName: '<string>',
sourceLangs: ['<string>'],
targetLangs: ['<string>'],
type: 'ProfessionalTranslation'
})
};

fetch('https://cloud.memsource.com/web/api2/v1/services', 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/v1/services",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'publicName' => '<string>',
'sourceLangs' => [
'<string>'
],
'targetLangs' => [
'<string>'
],
'type' => 'ProfessionalTranslation'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);

$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/v1/services"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"publicName\": \"<string>\",\n \"sourceLangs\": [\n \"<string>\"\n ],\n \"targetLangs\": [\n \"<string>\"\n ],\n \"type\": \"ProfessionalTranslation\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")

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/v1/services")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"publicName\": \"<string>\",\n \"sourceLangs\": [\n \"<string>\"\n ],\n \"targetLangs\": [\n \"<string>\"\n ],\n \"type\": \"ProfessionalTranslation\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://cloud.memsource.com/web/api2/v1/services")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"publicName\": \"<string>\",\n \"sourceLangs\": [\n \"<string>\"\n ],\n \"targetLangs\": [\n \"<string>\"\n ],\n \"type\": \"ProfessionalTranslation\"\n}"

response = http.request(request)
puts response.read_body
{
  "dateCreated": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "publicName": "<string>",
  "sourceLangs": [
    "<string>"
  ],
  "targetLangs": [
    "<string>"
  ],
  "type": "ProfessionalTranslation",
  "uid": "<string>"
}

Authorizations

Authorization
string
header
required

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.

Body

application/json

Service creation request

Request body for creating a service

name
string
required

Internal name of the service

Maximum string length: 255
publicName
string
required

Public-facing name of the service

Maximum string length: 255
sourceLangs
string[]
required

BCP 47 source language codes

targetLangs
string[]
required

BCP 47 target language codes

type
enum<string>
required

Service type

Available options:
ProfessionalTranslation
billingUnit
enum<string>

Billing unit for the service. Uses the organization default when omitted.

Available options:
Character,
Word,
Page,
Hour
generationMode
enum<string>

Controls when quotes and analyses are generated. Uses the service default when omitted.

Available options:
ANALYSIS_AND_QUOTE,
ANALYSIS,
NONE

Response

OK

Service details

billingUnit
enum<string>

Billing unit for the service

Available options:
Character,
Word,
Page,
Hour
dateCreated
string<date-time>

Date the service was created

generationMode
enum<string>

Controls when quotes and analyses are generated

Available options:
ANALYSIS_AND_QUOTE,
ANALYSIS,
NONE
name
string

Internal name of the service

publicName
string

Public-facing name of the service

sourceLangs
string[]

BCP 47 source language codes

targetLangs
string[]

BCP 47 target language codes

type
enum<string>

Service type

Available options:
ProfessionalTranslation
uid
string

Unique identifier of the service