Event Types

Get event types

This method retrieves all event types stored for your account.

Parameters

HTTP Headers

Name Description
token

An authorisation header containing meta information, see OAuth2.

Responses

200 - The list of event types configured for your *eTrusted* account.

Name Description
application/json EventTypeListDto
{}

400 - Bad Request

No body is sent for this status code.

401 - Unauthorized

No body is sent for this status code.

403 - Forbidden

No body is sent for this status code.

404 - Not Found

No body is sent for this status code.
GET
https://api.etrusted.com/event-types
/** * Please be aware that storing your Authorization on the client side is strongly discourge. * This code example should only be used for testing purposes. */ //#region Parameters const baseUrl = 'https://api.etrusted.com'; const headers = { 'token': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/event-types`; const xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.setRequestHeader('token', `${headers["token"]}`); xhr.onreadystatechange = function() { if(xhr.readyState == 4 && xhr.status == 200) { console.log(xhr.responseText); } }; xhr.send(body || undefined);
const https = require('https'); //#region Parameters const baseUrl = 'https://api.etrusted.com'; const headers = { 'token': null, // Change me! }; const body = ""; //#endregion let urlAsString = `${baseUrl}/event-types`; const queryString = Object .keys(queryParameters) .map(key => `${key}=${encodeURIComponent(queryParameters[key])}`) .join('&'); urlAsString = queryString ? `${urlAsString}?${queryString}` : urlAsString; const url = new URL(urlAsString); const options = { hostname: url.hostname, port: url.port, path: url.path, method: 'GET', headers: { 'token': `${headers["token"]}`, } }; const req = https.request(options, res => { console.log(`statusCode: ${res.statusCode}`) res.on('data', d => { process.stdout.write(d) }); }); req.on('error', error => { console.error(error) }); if (body) { req.write(JSON.stringify(data)); } req.end();
require "uri" require "json" require "net/http" baseUrl = "https://api.etrusted.com"; # Some query parameters are optional and should only be set if needed. queryStringParameters = { } routeParameters = { } headers = { "token": nil, # Change me! } queryStringValues = queryStringParameters.to_a queryStringPairs = queryStringValues.map { |entry| entry[0].to_s + "=" + (entry[1] || '') }; queryString = queryStringPairs.join('&') urlAsString = baseUrl + "/event-types" + (queryString != "" ? "?" + queryString : "") urlAsString.gsub!(/\{[^\}]*\}/) { |m| routeParameters[m[1...-1].to_sym] } if urlAsString url = URI(urlAsString) https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) request["token"] = headers["token"] response = https.request(request) puts response.read_body
//#region Imports import java.net.URL; import java.net.URLEncoder; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.lang.StringBuffer; import java.util.Map; import java.util.HashMap; import java.util.AbstractMap; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.ArrayList; //#endregion public class main { public static final Pattern PATTERN = Pattern.compile("\\{([^\\}]*)\\}"); public static void main(String[] args) throws IOException { try { Map<String, String> headers = new HashMap<>(); Map<String, String> queryStringValues = new HashMap<>(); Map<String, String> routeParameters = new HashMap<>(); //#region Parameters String baseUrl = "https://api.etrusted.com"; headers.put("token", null); // Change me! //#endregion String urlAsString = baseUrl + "/event-types"; Matcher matcher = PATTERN.matcher(urlAsString); StringBuffer out = new StringBuffer(); while (matcher.find()) { String variable = routeParameters.get(matcher.group(1)); matcher.appendReplacement(out, variable); } matcher.appendTail(out); urlAsString = out.toString(); ArrayList<String> queryStringParts = new ArrayList<>(); for (String key : queryStringValues.keySet()){ queryStringParts.add(key + "=" + URLEncoder.encode(queryStringValues.get(key))); } if (queryStringParts.size() > 0) { urlAsString += "?" + String.join("&", queryStringParts); } URL url = new URL(urlAsString); HttpURLConnection httpRequest = (HttpURLConnection) url.openConnection(); for (String key : headers.keySet()){ httpRequest.setRequestProperty(key, headers.get(key)); } httpRequest.setRequestMethod("GET"); BufferedReader in = new BufferedReader(new InputStreamReader(httpRequest.getInputStream())); String inputLine; StringBuffer content = new StringBuffer(); while ((inputLine = in.readLine()) != null) { content.append(inputLine); } in.close(); int status = httpRequest.getResponseCode(); httpRequest.disconnect(); System.out.println("Response Status: " + String.valueOf(status)); System.out.println("Response Body: " + content.toString()); } catch (MalformedURLException ex) { System.out.println("URL provided not valid"); } catch (IOException ex) { System.out.println("Error reading HTTP connection" + ex.toString()); throw ex; } } }
<?php //#region Parameters $baseUrl = 'https://api.etrusted.com'; $headers = array( "token" => null, // Change me! );//#endregion $url = "$baseUrl/event-types"; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "token: " . $headers["token"], ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
import http.client import json from urllib.parse import urlparse # Some query parameters are optional and should only be set if needed. query_string_parameters = { } route_parameters = { } headers = { 'token': '', # Change me! } url_as_string = 'https://api.etrusted.com/event-types'.format(**{ **query_string_parameters, **route_parameters }) payload = '' url = urlparse(url_as_string) http_client = http.client.HTTPSConnection(url.netloc) http_client.request("GET", url_as_string, payload, headers) response = http_client.getresponse() data = response.read() print(data.decode("utf-8"))
curl 'https://api.etrusted.com/event-types' \ --request GET \ --header 'token: value' \ --location

      <?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.etrusted.com/event-types",
  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/event-types",
  "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/event-types")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();


    
This feature is coming soon!
The operation tester will give you the possibility to pre-test operations with our sandbox environment.
What would you expect from the operation tester? Tell us your opinion!

Create an event type

This method creates a new event type that represents a touchpoint along your customer journey.

Parameters

HTTP Headers

Name Description
token

An authorisation header containing meta information, see OAuth2.

Body

Content-Type Type
application/json EventTypePostDto
{ "active": true, "name": "event_type_name" }

Responses

201 - The created event type

Name Description
application/json EventTypeDto
{ "id": "ety-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx", "createdAt": "2018-02-01T17:09:41.790Z", "updatedAt": "2018-02-01T17:09:41.790Z", "active": true, "name": "event_type_name" }

400 - Bad Request

No body is sent for this status code.

401 - Unauthorized

No body is sent for this status code.

403 - Forbidden

No body is sent for this status code.

409 - Conflict

No body is sent for this status code.
POST
https://api.etrusted.com/event-types
/** * Please be aware that storing your Authorization on the client side is strongly discourge. * This code example should only be used for testing purposes. */ //#region Parameters const baseUrl = 'https://api.etrusted.com'; const headers = { 'token': null, // Change me! }; const body = { "active": true, "name": "event_type_name" }; //#endregion let url = `${baseUrl}/event-types`; const xhr = new XMLHttpRequest(); xhr.open('POST', url, true); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('token', `${headers["token"]}`); xhr.onreadystatechange = function() { if(xhr.readyState == 4 && xhr.status == 200) { console.log(xhr.responseText); } }; xhr.send(body || undefined);
const https = require('https'); //#region Parameters const baseUrl = 'https://api.etrusted.com'; const headers = { 'token': null, // Change me! }; const body = { "active": true, "name": "event_type_name" }; //#endregion let urlAsString = `${baseUrl}/event-types`; const queryString = Object .keys(queryParameters) .map(key => `${key}=${encodeURIComponent(queryParameters[key])}`) .join('&'); urlAsString = queryString ? `${urlAsString}?${queryString}` : urlAsString; const url = new URL(urlAsString); const options = { hostname: url.hostname, port: url.port, path: url.path, method: 'POST', headers: { 'token': `${headers["token"]}`, 'Content-Type': 'application/json' } }; const req = https.request(options, res => { console.log(`statusCode: ${res.statusCode}`) res.on('data', d => { process.stdout.write(d) }); }); req.on('error', error => { console.error(error) }); if (body) { req.write(JSON.stringify(data)); } req.end();
require "uri" require "json" require "net/http" baseUrl = "https://api.etrusted.com"; # Some query parameters are optional and should only be set if needed. queryStringParameters = { } routeParameters = { } headers = { "token": nil, # Change me! } queryStringValues = queryStringParameters.to_a queryStringPairs = queryStringValues.map { |entry| entry[0].to_s + "=" + (entry[1] || '') }; queryString = queryStringPairs.join('&') urlAsString = baseUrl + "/event-types" + (queryString != "" ? "?" + queryString : "") urlAsString.gsub!(/\{[^\}]*\}/) { |m| routeParameters[m[1...-1].to_sym] } if urlAsString url = URI(urlAsString) https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["token"] = headers["token"] request["Content-Type"] = "application/json" request.body = JSON.dump({ "active": true, "name": "event_type_name" }) response = https.request(request) puts response.read_body
//#region Imports import java.net.URL; import java.net.URLEncoder; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.lang.StringBuffer; import java.util.Map; import java.util.HashMap; import java.util.AbstractMap; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.ArrayList; //#endregion public class main { public static final Pattern PATTERN = Pattern.compile("\\{([^\\}]*)\\}"); public static void main(String[] args) throws IOException { try { Map<String, String> headers = new HashMap<>(); Map<String, String> queryStringValues = new HashMap<>(); Map<String, String> routeParameters = new HashMap<>(); //#region Parameters String body = new StringBuilder() .append("{") .append(" \"active\": true,") .append(" \"name\": \"event_type_name\"") .append("}") .toString(); String baseUrl = "https://api.etrusted.com"; headers.put("token", null); // Change me! //#endregion String urlAsString = baseUrl + "/event-types"; Matcher matcher = PATTERN.matcher(urlAsString); StringBuffer out = new StringBuffer(); while (matcher.find()) { String variable = routeParameters.get(matcher.group(1)); matcher.appendReplacement(out, variable); } matcher.appendTail(out); urlAsString = out.toString(); ArrayList<String> queryStringParts = new ArrayList<>(); for (String key : queryStringValues.keySet()){ queryStringParts.add(key + "=" + URLEncoder.encode(queryStringValues.get(key))); } if (queryStringParts.size() > 0) { urlAsString += "?" + String.join("&", queryStringParts); } URL url = new URL(urlAsString); HttpURLConnection httpRequest = (HttpURLConnection) url.openConnection(); for (String key : headers.keySet()){ httpRequest.setRequestProperty(key, headers.get(key)); } httpRequest.setRequestMethod("POST"); httpRequest.setRequestProperty("Content-Type", "application/json"); httpRequest.setDoOutput(true); OutputStream outputStream = httpRequest.getOutputStream(); OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, "UTF-8"); outputStreamWriter.write(body); outputStreamWriter.flush(); outputStreamWriter.close(); outputStream.close(); httpRequest.connect(); BufferedReader in = new BufferedReader(new InputStreamReader(httpRequest.getInputStream())); String inputLine; StringBuffer content = new StringBuffer(); while ((inputLine = in.readLine()) != null) { content.append(inputLine); } in.close(); int status = httpRequest.getResponseCode(); httpRequest.disconnect(); System.out.println("Response Status: " + String.valueOf(status)); System.out.println("Response Body: " + content.toString()); } catch (MalformedURLException ex) { System.out.println("URL provided not valid"); } catch (IOException ex) { System.out.println("Error reading HTTP connection" + ex.toString()); throw ex; } } }
<?php //#region Parameters $baseUrl = 'https://api.etrusted.com'; $headers = array( "token" => null, // Change me! ); // Change me! $body = json_decode('{ "active": true, "name": "event_type_name" }'); //#endregion $url = "$baseUrl/event-types"; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, 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($body), CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "token: " . $headers["token"], ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
import http.client import json from urllib.parse import urlparse # Some query parameters are optional and should only be set if needed. query_string_parameters = { } route_parameters = { } headers = { 'Content-Type': 'application/json' 'token': '', # Change me! } url_as_string = 'https://api.etrusted.com/event-types'.format(**{ **query_string_parameters, **route_parameters }) payload = '' payload = json.dumps({ "active": true, "name": "event_type_name" }) url = urlparse(url_as_string) http_client = http.client.HTTPSConnection(url.netloc) http_client.request("POST", url_as_string, payload, headers) response = http_client.getresponse() data = response.read() print(data.decode("utf-8"))
curl 'https://api.etrusted.com/event-types' \ --request POST \ --data-raw '{ "active": true, "name": "event_type_name" }' \ --header 'Content-Type: application/json' \ --header 'token: value' \ --location

      <?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.etrusted.com/event-types",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => '{
    "active": true,
    "name": "my_new_event_type"
  }',
  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/event-types",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer {access_token}",
    "cache-control": "no-cache"
  },
  "processData": false,
  "data": {
  "active": true,
  "name": "my_new_event_type"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


    

      OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{" +
  "\"active\": true," +
  "\"name\": \"Default checkout rule\"" +
"}");
Request request = new Request.Builder()
  .url("https://api.etrusted.com/event-types")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();


    
This feature is coming soon!
The operation tester will give you the possibility to pre-test operations with our sandbox environment.
What would you expect from the operation tester? Tell us your opinion!

Get an event type by ID

This method retrieves an event type by its eTrusted UUID.

Parameters

Route Parameters

Name Description
id

The ID of this event type object.

HTTP Headers

Name Description
token

An authorisation header containing meta information, see OAuth2.

Responses

200 - The event type object.

Name Description
application/json EventTypeDto
{ "id": "ety-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx", "createdAt": "2018-02-01T17:09:41.790Z", "updatedAt": "2018-02-01T17:09:41.790Z", "active": true, "name": "event_type_name" }

400 - Bad Request

No body is sent for this status code.

401 - Unauthorized

No body is sent for this status code.

403 - Forbidden

No body is sent for this status code.

404 - Not Found

No body is sent for this status code.
GET
https://api.etrusted.com/event-types/{id}
/** * Please be aware that storing your Authorization on the client side is strongly discourge. * This code example should only be used for testing purposes. */ //#region Parameters const baseUrl = 'https://api.etrusted.com'; const id = null; // Change me! const headers = { 'token': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/event-types/${id}`; const xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.setRequestHeader('token', `${headers["token"]}`); xhr.onreadystatechange = function() { if(xhr.readyState == 4 && xhr.status == 200) { console.log(xhr.responseText); } }; xhr.send(body || undefined);
const https = require('https'); //#region Parameters const baseUrl = 'https://api.etrusted.com'; const id = null; // Change me! const headers = { 'token': null, // Change me! }; const body = ""; //#endregion let urlAsString = `${baseUrl}/event-types/${id}`; const queryString = Object .keys(queryParameters) .map(key => `${key}=${encodeURIComponent(queryParameters[key])}`) .join('&'); urlAsString = queryString ? `${urlAsString}?${queryString}` : urlAsString; const url = new URL(urlAsString); const options = { hostname: url.hostname, port: url.port, path: url.path, method: 'GET', headers: { 'token': `${headers["token"]}`, } }; const req = https.request(options, res => { console.log(`statusCode: ${res.statusCode}`) res.on('data', d => { process.stdout.write(d) }); }); req.on('error', error => { console.error(error) }); if (body) { req.write(JSON.stringify(data)); } req.end();
require "uri" require "json" require "net/http" baseUrl = "https://api.etrusted.com"; # Some query parameters are optional and should only be set if needed. queryStringParameters = { } routeParameters = { "id": nil, # Change me! } headers = { "token": nil, # Change me! } queryStringValues = queryStringParameters.to_a queryStringPairs = queryStringValues.map { |entry| entry[0].to_s + "=" + (entry[1] || '') }; queryString = queryStringPairs.join('&') urlAsString = baseUrl + "/event-types/{id}" + (queryString != "" ? "?" + queryString : "") urlAsString.gsub!(/\{[^\}]*\}/) { |m| routeParameters[m[1...-1].to_sym] } if urlAsString url = URI(urlAsString) https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) request["token"] = headers["token"] response = https.request(request) puts response.read_body
//#region Imports import java.net.URL; import java.net.URLEncoder; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.lang.StringBuffer; import java.util.Map; import java.util.HashMap; import java.util.AbstractMap; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.ArrayList; //#endregion public class main { public static final Pattern PATTERN = Pattern.compile("\\{([^\\}]*)\\}"); public static void main(String[] args) throws IOException { try { Map<String, String> headers = new HashMap<>(); Map<String, String> queryStringValues = new HashMap<>(); Map<String, String> routeParameters = new HashMap<>(); //#region Parameters String baseUrl = "https://api.etrusted.com"; routeParameters.put("id", null); // Change me! headers.put("token", null); // Change me! //#endregion String urlAsString = baseUrl + "/event-types/{id}"; Matcher matcher = PATTERN.matcher(urlAsString); StringBuffer out = new StringBuffer(); while (matcher.find()) { String variable = routeParameters.get(matcher.group(1)); matcher.appendReplacement(out, variable); } matcher.appendTail(out); urlAsString = out.toString(); ArrayList<String> queryStringParts = new ArrayList<>(); for (String key : queryStringValues.keySet()){ queryStringParts.add(key + "=" + URLEncoder.encode(queryStringValues.get(key))); } if (queryStringParts.size() > 0) { urlAsString += "?" + String.join("&", queryStringParts); } URL url = new URL(urlAsString); HttpURLConnection httpRequest = (HttpURLConnection) url.openConnection(); for (String key : headers.keySet()){ httpRequest.setRequestProperty(key, headers.get(key)); } httpRequest.setRequestMethod("GET"); BufferedReader in = new BufferedReader(new InputStreamReader(httpRequest.getInputStream())); String inputLine; StringBuffer content = new StringBuffer(); while ((inputLine = in.readLine()) != null) { content.append(inputLine); } in.close(); int status = httpRequest.getResponseCode(); httpRequest.disconnect(); System.out.println("Response Status: " + String.valueOf(status)); System.out.println("Response Body: " + content.toString()); } catch (MalformedURLException ex) { System.out.println("URL provided not valid"); } catch (IOException ex) { System.out.println("Error reading HTTP connection" + ex.toString()); throw ex; } } }
<?php //#region Parameters $baseUrl = 'https://api.etrusted.com'; // Some query parameters are optional and should only be set if needed. $id = null; // Change me! $headers = array( "token" => null, // Change me! );//#endregion $url = "$baseUrl/event-types/$id"; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "token: " . $headers["token"], ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
import http.client import json from urllib.parse import urlparse # Some query parameters are optional and should only be set if needed. query_string_parameters = { } route_parameters = { 'id': '', # Change me! } headers = { 'token': '', # Change me! } url_as_string = 'https://api.etrusted.com/event-types/{id}'.format(**{ **query_string_parameters, **route_parameters }) payload = '' url = urlparse(url_as_string) http_client = http.client.HTTPSConnection(url.netloc) http_client.request("GET", url_as_string, payload, headers) response = http_client.getresponse() data = response.read() print(data.decode("utf-8"))
curl 'https://api.etrusted.com/event-types/{id}' \ --request GET \ --header 'token: value' \ --location

      <?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.etrusted.com/event-types/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/event-types/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/event-types/id")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();


    
This feature is coming soon!
The operation tester will give you the possibility to pre-test operations with our sandbox environment.
What would you expect from the operation tester? Tell us your opinion!

Update an event type by ID

This method updates an event type by its eTrusted UUID.

Parameters

Route Parameters

Name Description
id

The event type ID as an eTrusted UUID.

HTTP Headers

Name Description
token

An authorisation header containing meta information, see OAuth2.

Body

Content-Type Type
application/json UpdateEventTypeDto
{ "active": true }

Responses

200 - The updated event type.

Name Description
application/json EventTypeDto
{ "id": "ety-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx", "createdAt": "2018-02-01T17:09:41.790Z", "updatedAt": "2018-02-01T17:09:41.790Z", "active": true, "name": "event_type_name" }

400 - Bad Request

No body is sent for this status code.

401 - Unauthorized

No body is sent for this status code.

403 - Forbidden

No body is sent for this status code.

404 - Not Found

No body is sent for this status code.
PUT
https://api.etrusted.com/event-types/{id}
/** * Please be aware that storing your Authorization on the client side is strongly discourge. * This code example should only be used for testing purposes. */ //#region Parameters const baseUrl = 'https://api.etrusted.com'; const id = null; // Change me! const headers = { 'token': null, // Change me! }; const body = { "active": true }; //#endregion let url = `${baseUrl}/event-types/${id}`; const xhr = new XMLHttpRequest(); xhr.open('PUT', url, true); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('token', `${headers["token"]}`); xhr.onreadystatechange = function() { if(xhr.readyState == 4 && xhr.status == 200) { console.log(xhr.responseText); } }; xhr.send(body || undefined);
const https = require('https'); //#region Parameters const baseUrl = 'https://api.etrusted.com'; const id = null; // Change me! const headers = { 'token': null, // Change me! }; const body = { "active": true }; //#endregion let urlAsString = `${baseUrl}/event-types/${id}`; const queryString = Object .keys(queryParameters) .map(key => `${key}=${encodeURIComponent(queryParameters[key])}`) .join('&'); urlAsString = queryString ? `${urlAsString}?${queryString}` : urlAsString; const url = new URL(urlAsString); const options = { hostname: url.hostname, port: url.port, path: url.path, method: 'PUT', headers: { 'token': `${headers["token"]}`, 'Content-Type': 'application/json' } }; const req = https.request(options, res => { console.log(`statusCode: ${res.statusCode}`) res.on('data', d => { process.stdout.write(d) }); }); req.on('error', error => { console.error(error) }); if (body) { req.write(JSON.stringify(data)); } req.end();
require "uri" require "json" require "net/http" baseUrl = "https://api.etrusted.com"; # Some query parameters are optional and should only be set if needed. queryStringParameters = { } routeParameters = { "id": nil, # Change me! } headers = { "token": nil, # Change me! } queryStringValues = queryStringParameters.to_a queryStringPairs = queryStringValues.map { |entry| entry[0].to_s + "=" + (entry[1] || '') }; queryString = queryStringPairs.join('&') urlAsString = baseUrl + "/event-types/{id}" + (queryString != "" ? "?" + queryString : "") urlAsString.gsub!(/\{[^\}]*\}/) { |m| routeParameters[m[1...-1].to_sym] } if urlAsString url = URI(urlAsString) https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Put.new(url) request["token"] = headers["token"] request["Content-Type"] = "application/json" request.body = JSON.dump({ "active": true }) response = https.request(request) puts response.read_body
//#region Imports import java.net.URL; import java.net.URLEncoder; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.lang.StringBuffer; import java.util.Map; import java.util.HashMap; import java.util.AbstractMap; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.ArrayList; //#endregion public class main { public static final Pattern PATTERN = Pattern.compile("\\{([^\\}]*)\\}"); public static void main(String[] args) throws IOException { try { Map<String, String> headers = new HashMap<>(); Map<String, String> queryStringValues = new HashMap<>(); Map<String, String> routeParameters = new HashMap<>(); //#region Parameters String body = new StringBuilder() .append("{") .append(" \"active\": true") .append("}") .toString(); String baseUrl = "https://api.etrusted.com"; routeParameters.put("id", null); // Change me! headers.put("token", null); // Change me! //#endregion String urlAsString = baseUrl + "/event-types/{id}"; Matcher matcher = PATTERN.matcher(urlAsString); StringBuffer out = new StringBuffer(); while (matcher.find()) { String variable = routeParameters.get(matcher.group(1)); matcher.appendReplacement(out, variable); } matcher.appendTail(out); urlAsString = out.toString(); ArrayList<String> queryStringParts = new ArrayList<>(); for (String key : queryStringValues.keySet()){ queryStringParts.add(key + "=" + URLEncoder.encode(queryStringValues.get(key))); } if (queryStringParts.size() > 0) { urlAsString += "?" + String.join("&", queryStringParts); } URL url = new URL(urlAsString); HttpURLConnection httpRequest = (HttpURLConnection) url.openConnection(); for (String key : headers.keySet()){ httpRequest.setRequestProperty(key, headers.get(key)); } httpRequest.setRequestMethod("PUT"); httpRequest.setRequestProperty("Content-Type", "application/json"); httpRequest.setDoOutput(true); OutputStream outputStream = httpRequest.getOutputStream(); OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, "UTF-8"); outputStreamWriter.write(body); outputStreamWriter.flush(); outputStreamWriter.close(); outputStream.close(); httpRequest.connect(); BufferedReader in = new BufferedReader(new InputStreamReader(httpRequest.getInputStream())); String inputLine; StringBuffer content = new StringBuffer(); while ((inputLine = in.readLine()) != null) { content.append(inputLine); } in.close(); int status = httpRequest.getResponseCode(); httpRequest.disconnect(); System.out.println("Response Status: " + String.valueOf(status)); System.out.println("Response Body: " + content.toString()); } catch (MalformedURLException ex) { System.out.println("URL provided not valid"); } catch (IOException ex) { System.out.println("Error reading HTTP connection" + ex.toString()); throw ex; } } }
<?php //#region Parameters $baseUrl = 'https://api.etrusted.com'; // Some query parameters are optional and should only be set if needed. $id = null; // Change me! $headers = array( "token" => null, // Change me! ); // Change me! $body = json_decode('{ "active": true }'); //#endregion $url = "$baseUrl/event-types/$id"; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_POSTFIELDS => json_encode($body), CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "token: " . $headers["token"], ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
import http.client import json from urllib.parse import urlparse # Some query parameters are optional and should only be set if needed. query_string_parameters = { } route_parameters = { 'id': '', # Change me! } headers = { 'Content-Type': 'application/json' 'token': '', # Change me! } url_as_string = 'https://api.etrusted.com/event-types/{id}'.format(**{ **query_string_parameters, **route_parameters }) payload = '' payload = json.dumps({ "active": true }) url = urlparse(url_as_string) http_client = http.client.HTTPSConnection(url.netloc) http_client.request("PUT", url_as_string, payload, headers) response = http_client.getresponse() data = response.read() print(data.decode("utf-8"))
curl 'https://api.etrusted.com/event-types/{id}' \ --request PUT \ --data-raw '{ "active": true }' \ --header 'Content-Type: application/json' \ --header 'token: value' \ --location

      <?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.etrusted.com/event-types/{id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => '{
    "active": true
  }',
  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/event-types/{id}",
  "method": "PUT",
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer {access_token}",
    "cache-control": "no-cache"
  },
  "processData": false,
  "data": {
    "active": true
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


    

      OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{" +
  "\"active\": true" +
  "}"
);
Request request = new Request.Builder()
  .url("https://api.etrusted.com/event-types/{id}")
  .put(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();


    
This feature is coming soon!
The operation tester will give you the possibility to pre-test operations with our sandbox environment.
What would you expect from the operation tester? Tell us your opinion!

Delete an event type by ID

This method deletes an event type by its eTrusted UUID. Note that related invites will not be deleted.

Parameters

Route Parameters

Name Description
id

The eTrusted UUID of the event type object.

HTTP Headers

Name Description
token

An authorisation header containing meta information, see OAuth2.

Responses

204 - No Content

No body is sent for this status code.

400 - Bad Request

No body is sent for this status code.

401 - Unauthorized

No body is sent for this status code.

403 - Forbidden

No body is sent for this status code.

404 - Not Found

No body is sent for this status code.
DELETE
https://api.etrusted.com/event-types/{id}
/** * Please be aware that storing your Authorization on the client side is strongly discourge. * This code example should only be used for testing purposes. */ //#region Parameters const baseUrl = 'https://api.etrusted.com'; const id = null; // Change me! const headers = { 'token': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/event-types/${id}`; const xhr = new XMLHttpRequest(); xhr.open('DELETE', url, true); xhr.setRequestHeader('token', `${headers["token"]}`); xhr.onreadystatechange = function() { if(xhr.readyState == 4 && xhr.status == 200) { console.log(xhr.responseText); } }; xhr.send(body || undefined);
const https = require('https'); //#region Parameters const baseUrl = 'https://api.etrusted.com'; const id = null; // Change me! const headers = { 'token': null, // Change me! }; const body = ""; //#endregion let urlAsString = `${baseUrl}/event-types/${id}`; const queryString = Object .keys(queryParameters) .map(key => `${key}=${encodeURIComponent(queryParameters[key])}`) .join('&'); urlAsString = queryString ? `${urlAsString}?${queryString}` : urlAsString; const url = new URL(urlAsString); const options = { hostname: url.hostname, port: url.port, path: url.path, method: 'DELETE', headers: { 'token': `${headers["token"]}`, } }; const req = https.request(options, res => { console.log(`statusCode: ${res.statusCode}`) res.on('data', d => { process.stdout.write(d) }); }); req.on('error', error => { console.error(error) }); if (body) { req.write(JSON.stringify(data)); } req.end();
require "uri" require "json" require "net/http" baseUrl = "https://api.etrusted.com"; # Some query parameters are optional and should only be set if needed. queryStringParameters = { } routeParameters = { "id": nil, # Change me! } headers = { "token": nil, # Change me! } queryStringValues = queryStringParameters.to_a queryStringPairs = queryStringValues.map { |entry| entry[0].to_s + "=" + (entry[1] || '') }; queryString = queryStringPairs.join('&') urlAsString = baseUrl + "/event-types/{id}" + (queryString != "" ? "?" + queryString : "") urlAsString.gsub!(/\{[^\}]*\}/) { |m| routeParameters[m[1...-1].to_sym] } if urlAsString url = URI(urlAsString) https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Delete.new(url) request["token"] = headers["token"] response = https.request(request) puts response.read_body
//#region Imports import java.net.URL; import java.net.URLEncoder; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.lang.StringBuffer; import java.util.Map; import java.util.HashMap; import java.util.AbstractMap; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.ArrayList; //#endregion public class main { public static final Pattern PATTERN = Pattern.compile("\\{([^\\}]*)\\}"); public static void main(String[] args) throws IOException { try { Map<String, String> headers = new HashMap<>(); Map<String, String> queryStringValues = new HashMap<>(); Map<String, String> routeParameters = new HashMap<>(); //#region Parameters String baseUrl = "https://api.etrusted.com"; routeParameters.put("id", null); // Change me! headers.put("token", null); // Change me! //#endregion String urlAsString = baseUrl + "/event-types/{id}"; Matcher matcher = PATTERN.matcher(urlAsString); StringBuffer out = new StringBuffer(); while (matcher.find()) { String variable = routeParameters.get(matcher.group(1)); matcher.appendReplacement(out, variable); } matcher.appendTail(out); urlAsString = out.toString(); ArrayList<String> queryStringParts = new ArrayList<>(); for (String key : queryStringValues.keySet()){ queryStringParts.add(key + "=" + URLEncoder.encode(queryStringValues.get(key))); } if (queryStringParts.size() > 0) { urlAsString += "?" + String.join("&", queryStringParts); } URL url = new URL(urlAsString); HttpURLConnection httpRequest = (HttpURLConnection) url.openConnection(); for (String key : headers.keySet()){ httpRequest.setRequestProperty(key, headers.get(key)); } httpRequest.setRequestMethod("DELETE"); BufferedReader in = new BufferedReader(new InputStreamReader(httpRequest.getInputStream())); String inputLine; StringBuffer content = new StringBuffer(); while ((inputLine = in.readLine()) != null) { content.append(inputLine); } in.close(); int status = httpRequest.getResponseCode(); httpRequest.disconnect(); System.out.println("Response Status: " + String.valueOf(status)); System.out.println("Response Body: " + content.toString()); } catch (MalformedURLException ex) { System.out.println("URL provided not valid"); } catch (IOException ex) { System.out.println("Error reading HTTP connection" + ex.toString()); throw ex; } } }
<?php //#region Parameters $baseUrl = 'https://api.etrusted.com'; // Some query parameters are optional and should only be set if needed. $id = null; // Change me! $headers = array( "token" => null, // Change me! );//#endregion $url = "$baseUrl/event-types/$id"; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "DELETE", CURLOPT_HTTPHEADER => array( "token: " . $headers["token"], ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
import http.client import json from urllib.parse import urlparse # Some query parameters are optional and should only be set if needed. query_string_parameters = { } route_parameters = { 'id': '', # Change me! } headers = { 'token': '', # Change me! } url_as_string = 'https://api.etrusted.com/event-types/{id}'.format(**{ **query_string_parameters, **route_parameters }) payload = '' url = urlparse(url_as_string) http_client = http.client.HTTPSConnection(url.netloc) http_client.request("DELETE", url_as_string, payload, headers) response = http_client.getresponse() data = response.read() print(data.decode("utf-8"))
curl 'https://api.etrusted.com/event-types/{id}' \ --request DELETE \ --header 'token: value' \ --location

      <?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.etrusted.com/event-types/id",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  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/event-types/id",
  "method": "DELETE",
  "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/event-types/id")
  .delete()
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();


    
This feature is coming soon!
The operation tester will give you the possibility to pre-test operations with our sandbox environment.
What would you expect from the operation tester? Tell us your opinion!

Models

EventTypeListDto

A list of event types. Each object represents a single event type.

Properties

EventTypePostDto

Properties

active
boolean
 

A boolean value that indicates whether the event type is active or not. If an event type is inactive, automatic invites for this type will not be executed.

name
string
 

The name of the event type. Event type name must match: (?!^all$)(^[a-z0-9][-_a-z0-9]{1,253}[a-z0-9]$)

EventTypeDto

Properties

id
string

The event type ID as an eTrusted UUID.

createdAt
string

The date and time when the event type was created, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ.

updatedAt
string

The date and time when the event type was last modified, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ.

active
boolean

A boolean value that indicates whether the event type is active or not. If an event type is inactive, automatic invites for this type will not be executed.

name
string

The name of the event type. checkout is the default event type. Trusted Shops can add more event types for you. Please contact us!

UpdateEventTypeDto

Properties

active
boolean
 

A boolean value that indicates whether the event type is active or not. If an event type is inactive, automatic invites for this type will not be executed.

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.