cURL
curl "https://api.phrase.com/v2/accounts/:account_id/job_templates/:id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-H 'Content-Type: application/json'phrase organization_job_templates update \
--account_id <account_id> \
--id <id> \
--access_token <token>import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}"
payload = {
"name": "template",
"briefing": "text",
"autotranslate": True,
"exclude_linked_child_keys": False,
"owner_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'template',
briefing: 'text',
autotranslate: true,
exclude_linked_child_keys: false,
owner_id: '<string>'
})
};
fetch('https://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}', 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://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'template',
'briefing' => 'text',
'autotranslate' => true,
'exclude_linked_child_keys' => false,
'owner_id' => '<string>'
]),
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://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}"
payload := strings.NewReader("{\n \"name\": \"template\",\n \"briefing\": \"text\",\n \"autotranslate\": true,\n \"exclude_linked_child_keys\": false,\n \"owner_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"template\",\n \"briefing\": \"text\",\n \"autotranslate\": true,\n \"exclude_linked_child_keys\": false,\n \"owner_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"template\",\n \"briefing\": \"text\",\n \"autotranslate\": true,\n \"exclude_linked_child_keys\": false,\n \"owner_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "626ea67628690c73ac86ac81eec2d185",
"name": "template",
"briefing": "text",
"created_at": "2017-01-28T09:52:53Z",
"updated_at": "2017-01-28T09:52:53Z",
"owner": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe"
},
"creator": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe"
},
"locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
]
}{
"message": "Validation Failed",
"errors": [
{
"resource": "Resource",
"field": "name",
"message": "can't be blank"
}
]
}Organization Job Templates
Update an organization job template
Update an existing organization job template.
PATCH
/
accounts
/
{account_id}
/
job_templates
/
{id}
cURL
curl "https://api.phrase.com/v2/accounts/:account_id/job_templates/:id" \
-u USERNAME_OR_ACCESS_TOKEN \
-X PATCH \
-H 'Content-Type: application/json'phrase organization_job_templates update \
--account_id <account_id> \
--id <id> \
--access_token <token>import requests
url = "https://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}"
payload = {
"name": "template",
"briefing": "text",
"autotranslate": True,
"exclude_linked_child_keys": False,
"owner_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'template',
briefing: 'text',
autotranslate: true,
exclude_linked_child_keys: false,
owner_id: '<string>'
})
};
fetch('https://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}', 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://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'template',
'briefing' => 'text',
'autotranslate' => true,
'exclude_linked_child_keys' => false,
'owner_id' => '<string>'
]),
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://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}"
payload := strings.NewReader("{\n \"name\": \"template\",\n \"briefing\": \"text\",\n \"autotranslate\": true,\n \"exclude_linked_child_keys\": false,\n \"owner_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"template\",\n \"briefing\": \"text\",\n \"autotranslate\": true,\n \"exclude_linked_child_keys\": false,\n \"owner_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/accounts/{account_id}/job_templates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"template\",\n \"briefing\": \"text\",\n \"autotranslate\": true,\n \"exclude_linked_child_keys\": false,\n \"owner_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "626ea67628690c73ac86ac81eec2d185",
"name": "template",
"briefing": "text",
"created_at": "2017-01-28T09:52:53Z",
"updated_at": "2017-01-28T09:52:53Z",
"owner": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe"
},
"creator": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"username": "joe.doe",
"name": "Joe Doe"
},
"locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
]
}{
"message": "Validation Failed",
"errors": [
{
"resource": "Resource",
"field": "name",
"message": "can't be blank"
}
]
}Body
application/json
Response
OK
Was this page helpful?