Events
Create a new event
This endpoint creates a new eTrusted event.
NB: In compliance with GDPR, customers should be given the option to opt-in to receive review invitations from you. Therefore, create events using data of only customers who have opted-in.
Parameters
HTTP Headers
Name | Description |
---|---|
Authorization | An OAuth2 authorization header with an access token, see OAuth2 |
Body
Content-Type | Type |
---|---|
application/json | EventRequest |
|
Responses
202 - Accepted
Name | Description |
---|---|
application/json | EventPostResponse |
|
400 - Bad Request
Name | Description |
---|---|
application/json | ValidationError |
|
401 - Unauthorized
Name | Description |
---|---|
application/json | UnauthorizedError |
|
500 - Internal Server Error
Name | Description |
---|---|
application/json | InternalServerError |
|
503 - Service Unavailable
Name | Description |
---|---|
application/json | ServiceUnavailable |
|
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.etrusted.com/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS =>
'{
"type": "checkout",
"customer": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"mobile": "+49123456789",
"address": "Anystr. 17, 12345"
},
"channel": {
"id": "chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx",
"type": "etrusted"
},
"transaction": {
"reference": "order-12345",
"date": "2017-01-01T13:30:15.000Z"
},
"products": [
{
"name": "Specialbrand T-Shirt White M",
"sku": "1234-TS-WH-M",
"imageUrl": "https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg",
"url": "https://www.specialbrandshop.com/article123-TS-WH-M/",
"brand": "specialbrand",
"gtin": "1234567890123",
"mpn": "23687778"
}
],
"system": "customer_system_name",
"systemVersion": "1.0",
"metadata": {
"metaKey1": "metaValue1",
"metaKey2": "metaValue2"
}
}',
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/events",
"method": "POST",
"headers": {
"Authorization": "Bearer {access_token}",
"Content-Type": "application/json",
"cache-control": "no-cache"
},
"processData": false,
"data": {
"type": "checkout",
"customer": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"mobile": "+49123456789",
"address": "Anystr. 17, 12345"
},
"channel": {
"id": "chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx",
"type": "etrusted"
},
"transaction": {
"reference": "order-12345",
"date": "2017-01-01T13:30:15.000Z"
},
"products": [
{
"name": "Specialbrand T-Shirt White M",
"sku": "1234-TS-WH-M",
"imageUrl": "https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg",
"url": "https://www.specialbrandshop.com/article123-TS-WH-M/",
"brand": "specialbrand",
"gtin": "1234567890123",
"mpn": "23687778"
}
],
"system": "customer_system_name",
"systemVersion": "1.0",
"metadata": {
"metaKey1": "metaValue1",
"metaKey2": "metaValue2"
}
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType,
"{" +
"\"type\": \"checkout\"," +
"\"customer\": {" +
"\"firstName\": \"John\"," +
"\"lastName\": \"Doe\"," +
"\"email\": \"john.doe@example.com\"," +
"\"mobile\": \"+49123456789\"," +
"\"address\": \"Anystr. 17, 12345\"" +
"}," +
"\"channel\": {" +
"\"id\": \"chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx\"," +
"\"type\": \"etrusted\"" +
"}," +
"\"transaction\": {" +
"\"reference\": \"order-12345\"," +
"\"date\": \"2017-01-01T13:30:15.000Z\"" +
"}," +
"\"products\": [" +
"{" +
"\"name\": \"Specialbrand T-Shirt White M\"," +
"\"sku\": \"1234-TS-WH-M\"," +
"\"imageUrl\": \"https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg\"," +
"\"url\": \"https://www.specialbrandshop.com/article123-TS-WH-M/\"," +
"\"brand\": \"specialbrand\"," +
"\"gtin\": \"1234567890123\"," +
"}" +
"]," +
"\"system\": \"customer_system_name\"," +
"\"systemVersion\": \"1.0\"," +
"\"metadata\": {" +
"\"metaKey1\": \"metaValue1\"," +
"\"metaKey2\": \"metaValue2\"" +
"}" +
"}"
);
Request request = new Request.Builder()
.url("https://api.etrusted.com/events")
.post(body)
.addHeader("Authorization", "Bearer {access_token}")
.addHeader("Content-Type", "application/json")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Get an event
This endpoint retrieves an eTrusted event by its ID.
It can be used to check if your events has been created correctly after a POST request.
Parameters
Route Parameters
Name | Description |
---|---|
eventRef | This is the event ID in eTrusted UUID format as a reference. Event references are included in the response when you create an event via POST request. |
HTTP Headers
Name | Description |
---|---|
Authorization | An OAuth2 authorization header with an access token, see OAuth2 |
Responses
200 - The event with the ID that equals `eventRef`.
Name | Description |
---|---|
application/json | EventGetResponse |
|
401 - Unauthorized
Name | Description |
---|---|
application/json | UnauthorizedError |
|
404 - Not Found
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.etrusted.com/events/{eventRef}",
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/events/{eventRef}",
"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/events/{eventRef}")
.post(null)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {access_token}")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Models
EventRequest
This object represents the request payload for creating an eTrusted event.
NB: In compliance with GDPR, customers should be given the option to opt-in to receive review invitations from you. Therefore, create events using data of only customers who have opted-in.
Properties
type
string
The event type.
It represents the touchpoint that triggered the event.
You can only use an event type that exists in your eTrusted configuration.
Check out the event type documentation to read more about it.
defaultLocale
string
The default locale for this event.
If set, the default locale determines the language of the invite and the questionnaire that are triggered by the event.
If not set, the channel locale will be used instead.
customer
object
The customer object includes all data of the customer who is invited to leave a review.
Properties
firstName
string
First name of the customer.
lastName
string
Last name of the customer.
email
string
Email address of the customer.
It must be a valid email address.
address
string
Address of the customer.
mobile
string
Mobile telephone number of the customer.
The mobile number must have international format including +
and country code. (e.g. +49123456789
).
reference
string
The customer's ID as a reference UUID.
channel
object
This object holds information about the channel associated with the event.
Properties
id
string
The unique identifier of the channel.
This can either be an eTrusted UUID or an identifier from your own software eco-system.
Please see Channel IDs.
type
string
This can be set to either user_defined
if you defined the channel id yourself or etrusted
if it was generated by the eTrusted system thus its in the format chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx
.
Please see Channel IDs for more.
transaction
object
The event transaction holds a reference to the transaction, order, process etc. within your own system that triggers the event.
Properties
reference
string
The transaction reference identifies your internal transaction, order, process etc.
This string must be unique.
For example, it can be an order or invoice number such as order-12345
.
date
string
estimatedDeliveryDate
string
The estimated date of the delivery. It is a date in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd
. Check the glossary for examples of valid datetime formats.
products
object[]
This is a list of products.
It contains the products that are associated with the event.
It includes all data needed for product reviews for these products.
system
string
This is the system that issues the events API call.
This way you can identify the source system that called the events API.
systemVersion
string
This is the version of the source system.
metadata
object
Add more information to your event via the metadata object.
This may be anything that you want to track or evaluate.
createdAt
string
The date and time when the event was created, in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ
. Check the glossary for examples of valid datetime formats.
The event type. It represents the touchpoint that triggered the event. You can only use an event type that exists in your eTrusted configuration. Check out the event type documentation to read more about it.
The default locale for this event. If set, the default locale determines the language of the invite and the questionnaire that are triggered by the event. If not set, the channel locale will be used instead.
The customer object includes all data of the customer who is invited to leave a review.
First name of the customer.
Last name of the customer.
Email address of the customer. It must be a valid email address.
Address of the customer.
Mobile telephone number of the customer.
The mobile number must have international format including +
and country code. (e.g. +49123456789
).
The customer's ID as a reference UUID.
This object holds information about the channel associated with the event.
The unique identifier of the channel. This can either be an eTrusted UUID or an identifier from your own software eco-system. Please see Channel IDs.
This can be set to either user_defined
if you defined the channel id yourself or etrusted
if it was generated by the eTrusted system thus its in the format chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx
.
Please see Channel IDs for more.
The event transaction holds a reference to the transaction, order, process etc. within your own system that triggers the event.
The transaction reference identifies your internal transaction, order, process etc.
This string must be unique.
For example, it can be an order or invoice number such as order-12345
.
The estimated date of the delivery. It is a date in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd
. Check the glossary for examples of valid datetime formats.
This is a list of products. It contains the products that are associated with the event. It includes all data needed for product reviews for these products.
This is the system that issues the events API call. This way you can identify the source system that called the events API.
This is the version of the source system.
Add more information to your event via the metadata object. This may be anything that you want to track or evaluate.
The date and time when the event was created, in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ
. Check the glossary for examples of valid datetime formats.
EventPostResponse
Properties
Message
string
The response message: "Your event (evt-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx
) was accepted for processing".
EventRef
string
The event reference UUID.
The response message: "Your event (evt-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx
) was accepted for processing".
The event reference UUID.
ValidationError
Properties
Message
string
The error message details.
In case of a missing required property, the message looks like this: "Invalid request: instance requires property type
"
The error message details.
In case of a missing required property, the message looks like this: "Invalid request: instance requires property type
"
UnauthorizedError
Properties
Message
string
The error message details.
If the request was not authorized, access is forbidden: "Access to this resource is forbidden"
The error message details. If the request was not authorized, access is forbidden: "Access to this resource is forbidden"
InternalServerError
Properties
Message
string
The error message details.
E.g. "The server encountered an unexpected condition which prevented it from fulfilling the request"
The error message details. E.g. "The server encountered an unexpected condition which prevented it from fulfilling the request"
ServiceUnavailable
Properties
Message
string
The error message details.
In case the server is down, it says "This service is temporarily unavailable".
The error message details. In case the server is down, it says "This service is temporarily unavailable".
EventGetResponse
This object represents the response object of an eTrusted event.
Properties
id
string
The unique identifier of the event.
accountRef
string
The account reference ID the event belongs to
type
string
The event type.
It represents the touchpoint that triggered the event.
You can only use an event type that exists in your eTrusted configuration.
defaultLocale
string
The default locale for this event.
If set, the default locale determines the language of the invite and the questionnaire that are triggered by the event.
If not set, the channel locale will be used instead.
customer
object
The customer object includes all data of the customer who is invited to leave a review.
Properties
firstName
string
First name of the customer.
lastName
string
Last name of the customer.
email
string
Email address of the customer.
It must be a valid email address.
address
string
Address of the customer.
mobile
string
Mobile telephone number of the customer.
The mobile number must have international format including +
and country code. (e.g. +49123456789
).
reference
string
The customer ID as a reference UUID.
channel
object
This object holds information about the channel associated with the event.
Properties
id
string
The unique identifier of the channel.
This can either be an eTrusted UUID or an identifier from your own software eco-system.
Please see Channel IDs.
type
string
This can be set to either user_defined
if you defined the channel id yourself or etrusted
if it was generated by the eTrusted system thus its in the format chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx
.
Please see Channel IDs for more.
tracking
object
Provides information regarding where a review is coming.
Properties
client
string
Identifies the name of the client eg: PUBLIC_EVENTS_API
.
medium
string
Describes the medium through which the review will be collected ie: API
, WIDGET
, WEB_APP
, MOBILE_APP
transaction
object
The event transaction holds a reference to the transaction, order, process etc. within your own system that triggers the event.
Properties
reference
string
The transaction reference identifies your internal transaction, order, process etc.
This string must be unique.
For example, it can be an order or invoice number such as order-12345
.
date
string
estimatedDeliveryDate
string
The estimated date of the delivery. It is a date in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd
. Check the glossary for examples of valid datetime formats.
products
object[]
This is a list of products.
It contains the products that are associated with the event.
It includes all data needed for product reviews for these products.
system
string
This is the system that issues the events API call.
This way you can identify the source system that called the events API.
systemVersion
string
This is the version of the source system.
metadata
object
Add more information to your event via the metadata object.
This may be anything that you want to track or evaluate.
createdAt
string
The date and time when the event was created, in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ
. Check the glossary for examples of valid datetime formats.
The unique identifier of the event.
The account reference ID the event belongs to
The event type. It represents the touchpoint that triggered the event. You can only use an event type that exists in your eTrusted configuration.
The default locale for this event. If set, the default locale determines the language of the invite and the questionnaire that are triggered by the event. If not set, the channel locale will be used instead.
The customer object includes all data of the customer who is invited to leave a review.
First name of the customer.
Last name of the customer.
Email address of the customer. It must be a valid email address.
Address of the customer.
Mobile telephone number of the customer.
The mobile number must have international format including +
and country code. (e.g. +49123456789
).
The customer ID as a reference UUID.
This object holds information about the channel associated with the event.
The unique identifier of the channel. This can either be an eTrusted UUID or an identifier from your own software eco-system. Please see Channel IDs.
This can be set to either user_defined
if you defined the channel id yourself or etrusted
if it was generated by the eTrusted system thus its in the format chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx
.
Please see Channel IDs for more.
Provides information regarding where a review is coming.
Identifies the name of the client eg: PUBLIC_EVENTS_API
.
Describes the medium through which the review will be collected ie: API
, WIDGET
, WEB_APP
, MOBILE_APP
The event transaction holds a reference to the transaction, order, process etc. within your own system that triggers the event.
The transaction reference identifies your internal transaction, order, process etc.
This string must be unique.
For example, it can be an order or invoice number such as order-12345
.
The estimated date of the delivery. It is a date in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd
. Check the glossary for examples of valid datetime formats.
This is a list of products. It contains the products that are associated with the event. It includes all data needed for product reviews for these products.
This is the system that issues the events API call. This way you can identify the source system that called the events API.
This is the version of the source system.
Add more information to your event via the metadata object. This may be anything that you want to track or evaluate.
The date and time when the event was created, in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ
. Check the glossary for examples of valid datetime formats.
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.