Invites

Get a list of invites

This method retrieves the list of review invites by channel ID. The result set can be modified using a set of filters.

The path must contain a channelId. Note that this must be the channel ID that was assigned by eTrusted and not a user-defined ID.

Query parameters can be added to the request, separated by &. By adding parameters to the request, you can filter the result list and:

  • specify the maximum number of invites they want to retrieve with this request
  • retrieve invites submitted within a certain time frame

The response object contains the list of invite objects as well as information for paginating invites in a user interface. See our article on paginating response data for more information.

Parameters

Route Parameters

Name Description
id

The channel UUID for which to retrieve the list of invites.

HTTP Headers

Name Description
token

An authorisation header containing meta information, see OAuth2.

Channel-Id

Channel-Id contains the user-defined channel name. This allows the resource to to be called without a channel ID in the path. If using this header, the channel ID in the path must be set to "user-defined".

Query Parameters

Name Description
count

The desired number of invite objects to be retrieved per page.

after

after is an invite UUID. The list of invites in the response will only contain invites sent earlier than the invite with this ID.

before

before is an invite UUID. The list of invites in the response will only contain invites sent later than the invite with this ID.

query

query is a search term that is matched against the transaction reference and customer email address properties (see the response schema). Only matching invites will be included in the response.

Responses

200 - The list of invites.

Name Description
application/json InviteResponseListDto

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/channels/{id}/invites
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const id = null; // Change me! const headers = { 'token': null, // Change me! 'Channel-Id': null, // Change me! }; const queryParameters = { 'count': null, // Change me! 'after': null, // Change me! 'before': null, // Change me! 'query': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/channels/${id}/invites`; 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('token', `${headers["token"]}`); xhr.setRequestHeader('Channel-Id', `${headers["Channel-Id"]}`); 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! 'Channel-Id': null, // Change me! }; const queryParameters = { 'count': null, // Change me! 'after': null, // Change me! 'before': null, // Change me! 'query': null, // Change me! }; const body = ""; //#endregion let urlAsString = `${baseUrl}/channels/${id}/invites`; 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"]}`, 'Channel-Id': `${headers["Channel-Id"]}`, } }; 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"; queryStringParameters = { "count": nil, # Change me! "after": nil, # Change me! "before": nil, # Change me! "query": nil, # Change me! } routeParameters = { "id": nil, # Change me! } headers = { "token": nil, # Change me! "Channel-Id": nil, # Change me! } queryStringValues = queryStringParameters.to_a queryStringPairs = queryStringValues.map { |entry| entry[0].to_s + "=" + (entry[1] || '') }; queryString = queryStringPairs.join('&') urlAsString = baseUrl + "/channels/{id}/invites" + (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"] request["Channel-Id"] = headers["Channel-Id"] 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! headers.put("Channel-Id", null); // Change me! queryStringValues.put("count", null); // Change me! queryStringValues.put("after", null); // Change me! queryStringValues.put("before", null); // Change me! queryStringValues.put("query", null); // Change me! //#endregion String urlAsString = baseUrl + "/channels/{id}/invites"; 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'; $id = null; // Change me! $count = null; // Change me! $after = null; // Change me! $before = null; // Change me! $query = null; // Change me! $headers = array( "token" => null, // Change me! "Channel-Id" => null, // Change me! ); $body = ""; //#endregion $url = "$baseUrl/channels/$id/invites"; $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_POSTFIELDS => json_encode($body), CURLOPT_HTTPHEADER => array( "token: " . $headers["token"], "Channel-Id: " . $headers["Channel-Id"], ), )); $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 query_string_parameters = { 'count': '', # Change me! 'after': '', # Change me! 'before': '', # Change me! 'query': '', # Change me! } route_parameters = { 'id': '', # Change me! } headers = { 'token': '', # Change me! 'Channel-Id': '', # Change me! } url_as_string = 'https://api.etrusted.com/channels/{id}/invites?count={count}&after={after}&before={before}&query={query}'.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/channels/{id}/invites?count={count}&after={after}&before={before}&query={query}' \ --request GET \ --header 'token: value' \ --header 'Channel-Id: value' \ --location

      <?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.etrusted.com/channels/{channelId}/invites?count=95&query=search_term",
  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(
    "Content-Type: application/json",
    "cache-control: no-cache"
  ),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}


    

      var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.etrusted.com/channels/{channelId}/invites?count=95&query=search_term",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "cache-control": "no-cache"
  },
  "processData": false,
  "data": ""
}
$.ajax(settings).done(function (response) {
  console.log(response);
});


    

      OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
  .url("https://api.etrusted.com/channels/{channelId}/invites?count=95&query=search_term")
  .get()
  .addHeader("Content-Type", "application/json")
  .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!

Schedule new invites

This endpoint allows for the scheduling of new review invites into eTrusted system.

Parameters

Body

Content-Type Type
application/json InvitesRequest
{ "channel": { "id": "chl-f8c8c9c3-93ff-48dd-1111-629196b5955a", "type": "user_defined, etrusted" }, "system": "Magento", "systemVersion": "1.0.0", "invites": [ { "questionnaireTemplate": { "id": "tpl-qst-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "template": { "id": "ivt-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "customer": { "firstName": "John", "lastName": "Doe", "email": "user@example.com" }, "locale": "de_DE", "transaction": { "reference": "ORDER-121416990", "date": "2017-11-01T13:30:15Z" }, "products": [ { "gtin": "1234567890123", "imageUrl": "https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg", "name": "Specialbrand T-Shirt White M", "mpn": "23687778", "sku": "1234-TS-WH-M", "brand": "specialbrand", "url": "https://www.specialbrandshop.com/article123-TS-WH-M/" } ], "preferredSendTime": "2018-02-01T17:09:41.79Z", "metadata": { "carModel": "Touareg", "carColor": "silver" } } ] }

Responses

207 - Multi-Status

Name Description
application/json InvitesResponse

400 - Bad Request

Name Description
application/json ErrorResponse

401 - Unauthorized

Name Description
application/json ErrorResponse
POST
https://api.etrusted.com/invites
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const body = { "channel": { "id": "chl-f8c8c9c3-93ff-48dd-1111-629196b5955a", "type": "user_defined, etrusted" }, "system": "Magento", "systemVersion": "1.0.0", "invites": [ { "questionnaireTemplate": { "id": "tpl-qst-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "template": { "id": "ivt-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "customer": { "firstName": "John", "lastName": "Doe", "email": "user@example.com" }, "locale": "de_DE", "transaction": { "reference": "ORDER-121416990", "date": "2017-11-01T13:30:15Z" }, "products": [ { "gtin": "1234567890123", "imageUrl": "https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg", "name": "Specialbrand T-Shirt White M", "mpn": "23687778", "sku": "1234-TS-WH-M", "brand": "specialbrand", "url": "https://www.specialbrandshop.com/article123-TS-WH-M/" } ], "preferredSendTime": "2018-02-01T17:09:41.79Z", "metadata": { "carModel": "Touareg", "carColor": "silver" } } ] }; //#endregion let url = `${baseUrl}/invites`; const xhr = new XMLHttpRequest(); xhr.open('POST', url, true); 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 body = { "channel": { "id": "chl-f8c8c9c3-93ff-48dd-1111-629196b5955a", "type": "user_defined, etrusted" }, "system": "Magento", "systemVersion": "1.0.0", "invites": [ { "questionnaireTemplate": { "id": "tpl-qst-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "template": { "id": "ivt-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "customer": { "firstName": "John", "lastName": "Doe", "email": "user@example.com" }, "locale": "de_DE", "transaction": { "reference": "ORDER-121416990", "date": "2017-11-01T13:30:15Z" }, "products": [ { "gtin": "1234567890123", "imageUrl": "https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg", "name": "Specialbrand T-Shirt White M", "mpn": "23687778", "sku": "1234-TS-WH-M", "brand": "specialbrand", "url": "https://www.specialbrandshop.com/article123-TS-WH-M/" } ], "preferredSendTime": "2018-02-01T17:09:41.79Z", "metadata": { "carModel": "Touareg", "carColor": "silver" } } ] }; //#endregion let urlAsString = `${baseUrl}/invites`; 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: { } }; 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"; queryStringParameters = { } routeParameters = { } headers = { } queryStringValues = queryStringParameters.to_a queryStringPairs = queryStringValues.map { |entry| entry[0].to_s + "=" + (entry[1] || '') }; queryString = queryStringPairs.join('&') urlAsString = baseUrl + "/invites" + (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["Content-Type"] = "application/json" request.body = JSON.dump({ "channel": { "id": "chl-f8c8c9c3-93ff-48dd-1111-629196b5955a", "type": "user_defined, etrusted" }, "system": "Magento", "systemVersion": "1.0.0", "invites": [ { "questionnaireTemplate": { "id": "tpl-qst-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "template": { "id": "ivt-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "customer": { "firstName": "John", "lastName": "Doe", "email": "user@example.com" }, "locale": "de_DE", "transaction": { "reference": "ORDER-121416990", "date": "2017-11-01T13:30:15Z" }, "products": [ { "gtin": "1234567890123", "imageUrl": "https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg", "name": "Specialbrand T-Shirt White M", "mpn": "23687778", "sku": "1234-TS-WH-M", "brand": "specialbrand", "url": "https://www.specialbrandshop.com/article123-TS-WH-M/" } ], "preferredSendTime": "2018-02-01T17:09:41.79Z", "metadata": { "carModel": "Touareg", "carColor": "silver" } } ] }) 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(" \"channel\": {") .append(" \"id\": \"chl-f8c8c9c3-93ff-48dd-1111-629196b5955a\",") .append(" \"type\": \"user_defined, etrusted\"") .append(" },") .append(" \"system\": \"Magento\",") .append(" \"systemVersion\": \"1.0.0\",") .append(" \"invites\": [") .append(" {") .append(" \"questionnaireTemplate\": {") .append(" \"id\": \"tpl-qst-12261ad3-d36b-4a3a-a4ab-850920d7b11f\"") .append(" },") .append(" \"template\": {") .append(" \"id\": \"ivt-12261ad3-d36b-4a3a-a4ab-850920d7b11f\"") .append(" },") .append(" \"customer\": {") .append(" \"firstName\": \"John\",") .append(" \"lastName\": \"Doe\",") .append(" \"email\": \"user@example.com\"") .append(" },") .append(" \"locale\": \"de_DE\",") .append(" \"transaction\": {") .append(" \"reference\": \"ORDER-121416990\",") .append(" \"date\": \"2017-11-01T13:30:15Z\"") .append(" },") .append(" \"products\": [") .append(" {") .append(" \"gtin\": \"1234567890123\",") .append(" \"imageUrl\": \"https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg\",") .append(" \"name\": \"Specialbrand T-Shirt White M\",") .append(" \"mpn\": \"23687778\",") .append(" \"sku\": \"1234-TS-WH-M\",") .append(" \"brand\": \"specialbrand\",") .append(" \"url\": \"https://www.specialbrandshop.com/article123-TS-WH-M/\"") .append(" }") .append(" ],") .append(" \"preferredSendTime\": \"2018-02-01T17:09:41.79Z\",") .append(" \"metadata\": {") .append(" \"carModel\": \"Touareg\",") .append(" \"carColor\": \"silver\"") .append(" }") .append(" }") .append(" ]") .append("}") .toString(); String baseUrl = "https://api.etrusted.com"; //#endregion String urlAsString = baseUrl + "/invites"; 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'; // Change me! $body = json_decode('{ "channel": { "id": "chl-f8c8c9c3-93ff-48dd-1111-629196b5955a", "type": "user_defined, etrusted" }, "system": "Magento", "systemVersion": "1.0.0", "invites": [ { "questionnaireTemplate": { "id": "tpl-qst-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "template": { "id": "ivt-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "customer": { "firstName": "John", "lastName": "Doe", "email": "user@example.com" }, "locale": "de_DE", "transaction": { "reference": "ORDER-121416990", "date": "2017-11-01T13:30:15Z" }, "products": [ { "gtin": "1234567890123", "imageUrl": "https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg", "name": "Specialbrand T-Shirt White M", "mpn": "23687778", "sku": "1234-TS-WH-M", "brand": "specialbrand", "url": "https://www.specialbrandshop.com/article123-TS-WH-M/" } ], "preferredSendTime": "2018-02-01T17:09:41.79Z", "metadata": { "carModel": "Touareg", "carColor": "silver" } } ] }'); //#endregion $url = "$baseUrl/invites"; $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", ), )); $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 query_string_parameters = { } route_parameters = { } headers = { 'Content-Type': 'application/json' } url_as_string = 'https://api.etrusted.com/invites'.format(**{ **query_string_parameters, **route_parameters }) payload = '' payload = json.dumps({ "channel": { "id": "chl-f8c8c9c3-93ff-48dd-1111-629196b5955a", "type": "user_defined, etrusted" }, "system": "Magento", "systemVersion": "1.0.0", "invites": [ { "questionnaireTemplate": { "id": "tpl-qst-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "template": { "id": "ivt-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "customer": { "firstName": "John", "lastName": "Doe", "email": "user@example.com" }, "locale": "de_DE", "transaction": { "reference": "ORDER-121416990", "date": "2017-11-01T13:30:15Z" }, "products": [ { "gtin": "1234567890123", "imageUrl": "https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg", "name": "Specialbrand T-Shirt White M", "mpn": "23687778", "sku": "1234-TS-WH-M", "brand": "specialbrand", "url": "https://www.specialbrandshop.com/article123-TS-WH-M/" } ], "preferredSendTime": "2018-02-01T17:09:41.79Z", "metadata": { "carModel": "Touareg", "carColor": "silver" } } ] }) 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/invites' \ --request POST \ --data-raw '{ "channel": { "id": "chl-f8c8c9c3-93ff-48dd-1111-629196b5955a", "type": "user_defined, etrusted" }, "system": "Magento", "systemVersion": "1.0.0", "invites": [ { "questionnaireTemplate": { "id": "tpl-qst-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "template": { "id": "ivt-12261ad3-d36b-4a3a-a4ab-850920d7b11f" }, "customer": { "firstName": "John", "lastName": "Doe", "email": "user@example.com" }, "locale": "de_DE", "transaction": { "reference": "ORDER-121416990", "date": "2017-11-01T13:30:15Z" }, "products": [ { "gtin": "1234567890123", "imageUrl": "https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg", "name": "Specialbrand T-Shirt White M", "mpn": "23687778", "sku": "1234-TS-WH-M", "brand": "specialbrand", "url": "https://www.specialbrandshop.com/article123-TS-WH-M/" } ], "preferredSendTime": "2018-02-01T17:09:41.79Z", "metadata": { "carModel": "Touareg", "carColor": "silver" } } ] }' \ --header 'Content-Type: application/json' \ --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

TemplateDto

The template used for generating the questionnaire for the invite.

Properties

id
string

A reference to the template used for generating the questionnaire.

name
string

The title of the questionnaire.

EmailDto

Email data for identifying a customer or an organisation by email address.

Properties

name
string

The customer's or organisation's name.

email
string

The email address.

InviteResponseDto

A single invite object retrieved via API.

Properties

id
string

The invite UUID.

_object
string

The invite object type.

mode
string

The invite mode.

Automatic invites are triggered by invite rules, while manual invites are triggered manually (e.g. in the Control Centre).

accountRef
string

A UUID as account reference.

channelRef
string

A UUID as channel reference.

locale
string

The channel locale that determines the language that is used for this channel.

platform
string

Represents the name of an external review platform.

customer
object

The data of the customer who is invited to the review.

Properties
id
string

The customer UUID.

firstName
string

First name of the customer.

lastName
string

Last name of the customer.

email
string

Email address of the customer. This must be a valid email address.

phoneNumber
string

A phone number in E.164 format.

preferredLocale
string

The preferred locale for this customer.

consents
[object Object][]

This is an array of consent objects for the customer.

inviteSource
string

The source system that triggered the invite. This property can have the following values:

  • TRUSTBADGE
  • IMPORTER
  • APP_IOS
  • APP_ANDROID
  • REVIEW_COLLECTOR
  • CUSTOM

transaction
object

The transaction associated with the invite.

Properties
id
string

The transaction UUID.

reference
string

The transaction reference, e.g. ORDER-12345.

date
string

The date and time when the transaction took place, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ.

scheduledAt
string

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

estimatedDeliveryDate
string

The estimated date of the delivery. It is a date in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd.

template

sender

replyTo

event
string

A UUID as event reference.

createdAt
string

The date and time when the invite 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 invite was last modified, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ.

sentAt
string

The date and time when the invite was sent to the customer, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ.

status
object

Status information of the invite when the API request was processed.

See our glossary entry for invites for more information about the statuses.

Properties
name
string
 

The invite state.

reason
string

The reason for the invite state.

InviteResponseListDto

Properties

totalElements
integer

This field has the default value of 0 and will be removed in the future cause backend compatibillity issue.

paging
object

The paging object holds pagination information for the invites retrieved via this API.

Properties
count
integer

The number of invites displayed in one page of the pagination.

Note that this number might be lower than the count number in the request. This happens when the last page is reached.

For example: A total number of 105 invites are displayed in chunks of 20 invites per page. The sixth and last page will only have 5 reviews. The count property will hold the value 5.

cursor
object

The cursor object contains information to navigate to the previous and next pages in a subsequent request.

Properties
after
string

after is an invite UUID to retrieve the next page in the pagination.

before
string

before is an invite UUID to retrieve the previous page in the pagination.

links
object

Links to the previous and next pages in the pagination.

Note that the links contain the same query filter parameters that was used in the request. This makes sure that the pagination is always relative to the same filter in subsequent requests. If you build URLs yourself using after, before, make sure that you recreate the same filter as well.

Properties
previous
string

The link to the previous page in the pagination.

next
string

The link to the next page in the pagination.

The list of invite objects.

Each item object represents a single retrieved invite.

Invite

The invite to be scheduled for later sendout.

Properties

questionnaireTemplate
object
 

The questionnaire template which will be used to render the actual questionnaire for this invite.

Properties
id
string
 

The eTrusted unique identifier of the questionnaire template.

template
object
 

The invite template which will be used for sending the invite.

Properties
id
string
 

The eTrusted unique identifier of the invite template.

customer
object
 

The customer invited to leave a review.

Properties
firstName
string

The customer's first name.

lastName
string

The customer's last name.

email
string
 

The customer's email address.

locale
string

The locale in which the customer will get the invite and questionnaire.

transaction
object
 

The transaction to be reviewed.

Properties
reference
string
 

An external reference to the transaction.

date
string

The date when the transaction occurred, given in the ISO8601 & RFC3339 valid format yyyy-MM-dd'T'HH:mm:ss.SSSZ.

products
[object 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.

preferredSendTime
string

The date and time when the invite should be sent. It is in the ISO 8601 & RFC3339 valid format yyyy-MM-dd'T'HH:mm:ss.SSSZ. If it is not set or the date is in the past, the invite will be scheduled immediately.

metadata
object

Key-value pairs of metadata associated with the invite.

InvitesRequest

The request, that contains all the needed information to schedule new invites.

Properties

channel
object
 

The channel which will be associated with the invites.

Properties
id
string
 

The unique identifier of the channel.

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. Visit channel IDs to read more

system
string
 

The system property identifies the clients system that issued the API call (e.g. “salesforce”, “sap”, etc.).

systemVersion
string
 

The systemVersion property identifies the version of the source system (e.g. “1.0”). This offers organisations the option to use different versions of the same integration without putting this information into the system name.

invites
 

The invites to be scheduled.

FailedInvite

The invite that was not scheduled.

Properties

initialInvite
 

status
integer
 

The HTTP status code of the error.

reasons
string[]
 

The reasons, why the invite was not scheduled.

InvitesResponse

The response, if something went wrong.

Properties

batchId
string

The eTrusted unique identifier of the request with invites. It will be returned only if some invites were successfully scheduled (successfulInvites>0).

successfulInvites
integer
 

The number of successfully scheduled invites.

failedInvites

The invites that were not scheduled.

ErrorResponse

The response, if the authorization or initial validation failed.

Properties

Message
string

Error message details

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.