Event Types

Get event types

This endpoint retrieves event types of your account.

Parameters

HTTP Headers

Name Description
Authorization

An authorisation header containing meta information, see OAuth2

Query Parameters

Name Description
name

The name of a specific event type to filter for.

Responses

200 - The event types of your account.

Name Description
application/json EventTypeDto
{ "id": "ety-b8a7dd0b-2858-49e9-822c-8f4321caae1e", "createdAt": "2023-02-14T17:15:30.000Z", "updatedAt": "2023-02-14T19:45:50.100Z", "active": true, "name": "after_sales" }

400 - Bad Request

Name Description
application/json ClientErrorDto
{ "Error": "Invalid request", "ErrorDescription": "Invalid event: instance requires property \"name\"" }

401 - Unauthorized

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 = { 'Authorization': null, // Change me! }; // Some query parameters are optional and should only be set if needed. const queryParameters = { 'name': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/event-types`; const queryString = Object .keys(queryParameters) .map(key => `${key}=${encodeURIComponent(queryParameters[key])}`) .join('&'); url = queryString ? `${url}?${url}` : url; const xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.setRequestHeader('Authorization', `${headers["Authorization"]}`); 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 = { 'Authorization': null, // Change me! }; // Some query parameters are optional and should only be set if needed. const queryParameters = { 'name': 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: { 'Authorization': `${headers["Authorization"]}`, } }; 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 = { "name": nil, # Change me! } routeParameters = { } headers = { "Authorization": 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["Authorization"] = headers["Authorization"] 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("Authorization", null); // Change me! // Some query parameters are optional and should only be set if needed. queryStringValues.put("name", 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'; // Some query parameters are optional and should only be set if needed. $name = null; // Change me! $headers = array( "Authorization" => 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( "Authorization: " . $headers["Authorization"], ), )); $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 = { 'name': '', # Change me! } route_parameters = { } headers = { 'Authorization': '', # Change me! } url_as_string = 'https://api.etrusted.com/event-types?name={name}'.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?name={name}' \ --request GET \ --header 'Authorization: value' \ --location
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 endpoint creates a new event type representing a touchpoint along your customer journey.

Please contact us in case you are unsure adding more event types!

Parameters

HTTP Headers

Name Description
Authorization

An authorisation header containing meta information, see OAuth2.

Body

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

Responses

201 - The created event type.

Name Description
application/json EventTypeDto
{ "id": "ety-b8a7dd0b-2858-49e9-822c-8f4321caae1e", "createdAt": "2023-02-14T17:15:30.000Z", "updatedAt": "2023-02-14T19:45:50.100Z", "active": true, "name": "after_sales" }

400 - Bad Request

Name Description
application/json ClientErrorDto
{ "Error": "Invalid request", "ErrorDescription": "Invalid event: instance requires property \"name\"" }

401 - Unauthorized

No body is sent for this status code.

409 - Conflict

Name Description
application/json ClientErrorDto
{ "Error": "Invalid request", "ErrorDescription": "Invalid event: instance requires property \"name\"" }
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 = { 'Authorization': null, // Change me! }; const body = "{\n \"active\": true,\n \"name\": \"after_sales\"\n}"; //#endregion let url = `${baseUrl}/event-types`; const xhr = new XMLHttpRequest(); xhr.open('POST', url, true); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('Authorization', `${headers["Authorization"]}`); 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 = { 'Authorization': null, // Change me! }; const body = "{\n \"active\": true,\n \"name\": \"after_sales\"\n}"; //#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: { 'Authorization': `${headers["Authorization"]}`, '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 = { "Authorization": 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["Authorization"] = headers["Authorization"] request["Content-Type"] = "application/json" request.body = JSON.dump("{\n \"active\": true,\n \"name\": \"after_sales\"\n}") 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("\"{\n \\"active\\": true,\n \\"name\\": \\"after_sales\\"\n}\"") .toString(); String baseUrl = "https://api.etrusted.com"; headers.put("Authorization", 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( "Authorization" => null, // Change me! ); // Change me! $body = json_decode('"{\n \"active\": true,\n \"name\": \"after_sales\"\n}"'); //#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", "Authorization: " . $headers["Authorization"], ), )); $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' 'Authorization': '', # Change me! } url_as_string = 'https://api.etrusted.com/event-types'.format(**{ **query_string_parameters, **route_parameters }) payload = '' payload = json.dumps("{\n \"active\": true,\n \"name\": \"after_sales\"\n}") 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 '"{\n \"active\": true,\n \"name\": \"after_sales\"\n}"' \ --header 'Content-Type: application/json' \ --header 'Authorization: value' \ --location
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 endpoint retrieves an event type by its UUID.

Parameters

Route Parameters

Name Description
id

The ID of the event type object.

HTTP Headers

Name Description
Authorization

An authorisation header containing meta information, see OAuth2.

Responses

200 - The event type object.

Name Description
application/json EventTypeDto
{ "id": "ety-b8a7dd0b-2858-49e9-822c-8f4321caae1e", "createdAt": "2023-02-14T17:15:30.000Z", "updatedAt": "2023-02-14T19:45:50.100Z", "active": true, "name": "after_sales" }

400 - Bad Request

Name Description
application/json ClientErrorDto
{ "Error": "Invalid request", "ErrorDescription": "Invalid event: instance requires property \"name\"" }

401 - Unauthorized

No body is sent for this status code.

404 - Not Found

Name Description
application/json ClientErrorDto
{ "Error": "Invalid request", "ErrorDescription": "Invalid event: instance requires property \"name\"" }
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 = { 'Authorization': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/event-types/${id}`; const xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.setRequestHeader('Authorization', `${headers["Authorization"]}`); 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 = { 'Authorization': 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: { 'Authorization': `${headers["Authorization"]}`, } }; 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 = { "Authorization": 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["Authorization"] = headers["Authorization"] 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("Authorization", 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( "Authorization" => 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( "Authorization: " . $headers["Authorization"], ), )); $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 = { 'Authorization': '', # 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 'Authorization: value' \ --location
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 endpoint updates an event type by its UUID.

Parameters

Route Parameters

Name Description
id

The ID of the event type object.

HTTP Headers

Name Description
Authorization

An authorisation header containing meta information, see OAuth2.

Body

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

Responses

200 - The updated event type.

Name Description
application/json EventTypeDto
{ "id": "ety-b8a7dd0b-2858-49e9-822c-8f4321caae1e", "createdAt": "2023-02-14T17:15:30.000Z", "updatedAt": "2023-02-14T19:45:50.100Z", "active": true, "name": "after_sales" }

400 - Bad Request

Name Description
application/json ClientErrorDto
{ "Error": "Invalid request", "ErrorDescription": "Invalid event: instance requires property \"name\"" }

401 - Unauthorized

No body is sent for this status code.

404 - Not Found

Name Description
application/json ClientErrorDto
{ "Error": "Invalid request", "ErrorDescription": "Invalid event: instance requires property \"name\"" }
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 = { 'Authorization': null, // Change me! }; const body = "{\n \"active\": true\n}"; //#endregion let url = `${baseUrl}/event-types/${id}`; const xhr = new XMLHttpRequest(); xhr.open('PUT', url, true); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('Authorization', `${headers["Authorization"]}`); 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 = { 'Authorization': null, // Change me! }; const body = "{\n \"active\": true\n}"; //#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: { 'Authorization': `${headers["Authorization"]}`, '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 = { "Authorization": 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["Authorization"] = headers["Authorization"] request["Content-Type"] = "application/json" request.body = JSON.dump("{\n \"active\": true\n}") 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("\"{\n \\"active\\": true\n}\"") .toString(); String baseUrl = "https://api.etrusted.com"; routeParameters.put("id", null); // Change me! headers.put("Authorization", 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( "Authorization" => null, // Change me! ); // Change me! $body = json_decode('"{\n \"active\": true\n}"'); //#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", "Authorization: " . $headers["Authorization"], ), )); $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' 'Authorization': '', # Change me! } url_as_string = 'https://api.etrusted.com/event-types/{id}'.format(**{ **query_string_parameters, **route_parameters }) payload = '' payload = json.dumps("{\n \"active\": true\n}") 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 '"{\n \"active\": true\n}"' \ --header 'Content-Type: application/json' \ --header 'Authorization: value' \ --location
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 endpoint deletes an event type by its UUID.

Do note that related events, invites and reviews will not be deleted.

Please contact us in case you are unsure removing event types!

Parameters

Route Parameters

Name Description
id

The ID of the event type object.

HTTP Headers

Name Description
Authorization

An authorisation header containing meta information, see OAuth2.

Responses

204 - No Content

No body is sent for this status code.

400 - Bad Request

Name Description
application/json ClientErrorDto
{ "Error": "Invalid request", "ErrorDescription": "Invalid event: instance requires property \"name\"" }

401 - Unauthorized

No body is sent for this status code.

404 - Not Found

Name Description
application/json ClientErrorDto
{ "Error": "Invalid request", "ErrorDescription": "Invalid event: instance requires property \"name\"" }
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 = { 'Authorization': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/event-types/${id}`; const xhr = new XMLHttpRequest(); xhr.open('DELETE', url, true); xhr.setRequestHeader('Authorization', `${headers["Authorization"]}`); 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 = { 'Authorization': 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: { 'Authorization': `${headers["Authorization"]}`, } }; 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 = { "Authorization": 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["Authorization"] = headers["Authorization"] 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("Authorization", 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( "Authorization" => 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( "Authorization: " . $headers["Authorization"], ), )); $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 = { 'Authorization': '', # 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 'Authorization: value' \ --location
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

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, events for this type will not be accepted anymore.

name
string
 

The name of the event type.

checkout is the default event type for every account.

Please contact us to add more event types for you!

ClientErrorDto

Properties

Error
string
 

A summary of the error.

ErrorDescription
string
 

A detailed description of the error.

EventTypePostDto

Properties

active
boolean

A boolean value that indicates whether the event type is active or not.

If an event type is inactive, events for this type will no longer be accepted.

name
string
 

The name of the event type.

It needs to be unique for your account and must match our pattern.

EventTypePutDto

Properties

active
boolean
 

A boolean value that indicates whether the event type is active or not.

If an event type is inactive, events for this type will no longer be accepted.

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.