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
401 - Unauthorized
403 - Forbidden
404 - Not Found
<?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();
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 |
|
Responses
201 - The created event type
Name | Description |
---|---|
application/json | EventTypeDto |
|
400 - Bad Request
401 - Unauthorized
403 - Forbidden
409 - Conflict
<?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();
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 |
|
400 - Bad Request
401 - Unauthorized
403 - Forbidden
404 - Not Found
<?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();
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 |
|
Responses
200 - The updated event type.
Name | Description |
---|---|
application/json | EventTypeDto |
|
400 - Bad Request
401 - Unauthorized
403 - Forbidden
404 - Not Found
<?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();
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
400 - Bad Request
401 - Unauthorized
403 - Forbidden
404 - Not Found
<?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();
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]$)
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.
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
updatedAt
string
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!
The event type ID as an eTrusted UUID.
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.
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.
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.