Templates
Get a list of templates
This endpoint retrieves a list of available templates stored in eTrusted.
The result set can be filtered by adding request parameters.
Parameters
HTTP Headers
Name | Description |
---|---|
Authorization | An OAuth2 authorization header with an access token, see OAuth2 |
Query Parameters
Name | Description |
---|---|
type | Filter for a specific template type. Existing template types include:
If you do not set a template filter, the response will contain all templates available to you. |
transport | Filter for a specific transport type. |
version | Filter for a template specific version. Versions have the format '2.1', with major and minor version numbers. |
isGlobal | Filter for global templates. |
isDefault | Filter for default templates. |
hasTranslations | Filter for templates that have translations. |
Responses
200 - All templates matching the filter settings of the request.
Name | Description |
---|---|
application/json | TemplateList |
|
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.etrusted.com/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer {access_token}",
"Content-Type: application/json",
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.etrusted.com/channels/templates",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer {access_token}",
"cache-control": "no-cache",
},
"processData": false,
"data": ""
}
$.ajax(settings).done(function (response) {
console.log(response);
});
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.etrusted.com/channels/templates")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {access_token}")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Get a template by ID
This endpoint retrieves an eTrusted template by its ID.
Parameters
Route Parameters
Name | Description |
---|---|
id | The ID of the template. |
HTTP Headers
Name | Description |
---|---|
Authorization | An OAuth2 authorization header with an access token, see OAuth2 |
Responses
200 - The template with the specified ID.
Name | Description |
---|---|
application/json | TemplateDetail |
|
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.etrusted.com/templates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer {access_token}",
"Content-Type: application/json",
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.etrusted.com/channels/templates/{id}",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer {access_token}",
"cache-control": "no-cache",
},
"processData": false,
"data": ""
}
$.ajax(settings).done(function (response) {
console.log(response);
});
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.etrusted.com/channels/templates/{id}")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {access_token}")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Get a template by ID and locale
This endpoint retrieves an eTrusted template by its ID and locale.
Parameters
Route Parameters
Name | Description |
---|---|
id | The ID of the template. |
locale | The locale that determines the language of the template content. The locale must be in glibc locale format. |
HTTP Headers
Name | Description |
---|---|
Authorization | An OAuth2 authorization header with an access token, see OAuth2 |
Responses
200 - The template with the specified ID, in the language determined by the specified locale.
Name | Description |
---|---|
application/json | TemplateDetail |
|
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.etrusted.com/templates/{id}/locales/{locale}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer {access_token}",
"Content-Type: application/json",
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.etrusted.com/channels/templates/{id}/locales/{locale}",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer {access_token}",
"cache-control": "no-cache",
},
"processData": false,
"data": ""
}
$.ajax(settings).done(function (response) {
console.log(response);
});
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.etrusted.com/channels/templates/{id}/locales/{locale}")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {access_token}")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Need further support?
Visit the Help Centre for further information, or contact us. Are some words or terms unfamiliar? Then visit the glossary for clarification.