Reviews

Get a list of reviews

This endpoint retrieves reviews for a specific channel, a set of channels or for your entire account.

The result set can be modified using a set of filters.

Query parameters can be added to the request, separated by &.

Conceptually, there are two types of categories for the query parameters: actual filter parameters on the one hand, channels, rating, submittedAfter and submittedBefore, and pagination parameters on the other, count, after and before. See our article on paginating response data for more information.

Parameters

HTTP Headers

Name Description
Authorization

An OAuth2 authorization header with an access token, see OAuth2

Query Parameters

Name Description
channels

The list of channels for which the list of reviews will be returned.

Example: channels=chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxx1,chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxx2

after

after is a review ID. The list of reviews in the response will only contain reviews submitted earlier than the review with this ID.

Example: rev-xxxxxxxa-yyyy-xxxx-yyyy-xxxxxxxxxxxx

before

before is a review ID. The list of reviews in the response will only contain reviews submitted later than the review with this ID.

Example: rev-xxxxxxxb-yyyy-xxxx-yyyy-xxxxxxxxxxxx

submittedAfter

submittedAfter is a timestamp 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 list of reviews will only contain reviews submitted with a later timestamp.

Example: 2018-02-01T17:10:42.733Z

submittedBefore

submittedBefore is a timestamp 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 list of reviews will only contain reviews submitted with an earlier timestamp.

Example: 2018-02-01T17:10:42.733Z

count

The desired number of customer reviews to be retrieved per page.

NB: This can be set to any number from 1 to 1000 with 1000 being the maximum number of records you can get per a page

rating

A comma-separated list of star ratings to be retrieved. If not set, all reviews are listed.

Example: 1, 2, 5

status

A comma-separated list of statuses to be retrieved. If not set, all reviews are listed.

The statuses you can filter for are:

  • APPROVED
  • MODERATION
  • REJECTED

Example: APPROVED, MODERATION

See our glossary entry for more information on review statuses.

type

A comma-separated list of review types to be retrieved. If not set, all reviews are listed.

The review types are:

  • SERVICE_REVIEW
  • PRODUCT_REVIEW

Example: PRODUCT_REVIEW

See our glossary entry for more information on review states.

hasReply

Reduces the list of reviews to only match reviews that either have been replied to or not. If not set, all reviews are listed.

Example: true

additionalInformation

A comma-separated list of additional pieces of information to be retrieved with the review.

If this property is not set, none of the of additional information are included in the review.

Currently there are the following valid additional information types:

  • VETO, which holds information about a veto by our customer
  • ATTACHMENTS, which hold information about file attachments for this review

Example: [VETO]

ignoreStatements

Filters the list to ignore statements. Default is true.

query

A full-text search query that is matched against the order reference and email properties.

orderBy

Specify the date to sort the returned list of reviews by. Possible options:

  • editedAt: This is the date when the consumer last changed the review.It sorts the reviews in descending order using the lastEditedAt date
  • updatedAt:This is the date when the review was last updated. It sorts the reviews in descending order using the updatedAt date
  • submittedAt: This is the date when the review was created by the consumer. Reviews will be sorted by default in descending order using the submittedAt date if the orderBy parameter is not set or set to a non existing value.

Responses

200 - The list of reviews for the given channels or all channels.

Name Description
application/json CustomerReviewListResponseDto

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/reviews
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const headers = { 'Authorization': null, // Change me! }; const queryParameters = { 'channels': null, // Change me! 'after': null, // Change me! 'before': null, // Change me! 'submittedAfter': null, // Change me! 'submittedBefore': null, // Change me! 'count': null, // Change me! 'rating': null, // Change me! 'status': null, // Change me! 'type': null, // Change me! 'hasReply': null, // Change me! 'additionalInformation': null, // Change me! 'ignoreStatements': null, // Change me! 'query': null, // Change me! 'orderBy': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/reviews`; 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! }; const queryParameters = { 'channels': null, // Change me! 'after': null, // Change me! 'before': null, // Change me! 'submittedAfter': null, // Change me! 'submittedBefore': null, // Change me! 'count': null, // Change me! 'rating': null, // Change me! 'status': null, // Change me! 'type': null, // Change me! 'hasReply': null, // Change me! 'additionalInformation': null, // Change me! 'ignoreStatements': null, // Change me! 'query': null, // Change me! 'orderBy': null, // Change me! }; const body = ""; //#endregion let urlAsString = `${baseUrl}/reviews`; 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"; queryStringParameters = { "channels": nil, # Change me! "after": nil, # Change me! "before": nil, # Change me! "submittedAfter": nil, # Change me! "submittedBefore": nil, # Change me! "count": nil, # Change me! "rating": nil, # Change me! "status": nil, # Change me! "type": nil, # Change me! "hasReply": nil, # Change me! "additionalInformation": nil, # Change me! "ignoreStatements": nil, # Change me! "query": nil, # Change me! "orderBy": 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 + "/reviews" + (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! queryStringValues.put("channels", null); // Change me! queryStringValues.put("after", null); // Change me! queryStringValues.put("before", null); // Change me! queryStringValues.put("submittedAfter", null); // Change me! queryStringValues.put("submittedBefore", null); // Change me! queryStringValues.put("count", null); // Change me! queryStringValues.put("rating", null); // Change me! queryStringValues.put("status", null); // Change me! queryStringValues.put("type", null); // Change me! queryStringValues.put("hasReply", null); // Change me! queryStringValues.put("additionalInformation", null); // Change me! queryStringValues.put("ignoreStatements", null); // Change me! queryStringValues.put("query", null); // Change me! queryStringValues.put("orderBy", null); // Change me! //#endregion String urlAsString = baseUrl + "/reviews"; 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'; $channels = null; // Change me! $after = null; // Change me! $before = null; // Change me! $submittedAfter = null; // Change me! $submittedBefore = null; // Change me! $count = null; // Change me! $rating = null; // Change me! $status = null; // Change me! $type = null; // Change me! $hasReply = null; // Change me! $additionalInformation = null; // Change me! $ignoreStatements = null; // Change me! $query = null; // Change me! $orderBy = null; // Change me! $headers = array( "Authorization" => null, // Change me! );//#endregion $url = "$baseUrl/reviews"; $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 query_string_parameters = { 'channels': '', # Change me! 'after': '', # Change me! 'before': '', # Change me! 'submittedAfter': '', # Change me! 'submittedBefore': '', # Change me! 'count': '', # Change me! 'rating': '', # Change me! 'status': '', # Change me! 'type': '', # Change me! 'hasReply': '', # Change me! 'additionalInformation': '', # Change me! 'ignoreStatements': '', # Change me! 'query': '', # Change me! 'orderBy': '', # Change me! } route_parameters = { } headers = { 'Authorization': '', # Change me! } url_as_string = 'https://api.etrusted.com/reviews?channels={channels}&after={after}&before={before}&submittedAfter={submittedAfter}&submittedBefore={submittedBefore}&count={count}&rating={rating}&status={status}&type={type}&hasReply={hasReply}&additionalInformation={additionalInformation}&ignoreStatements={ignoreStatements}&query={query}&orderBy={orderBy}'.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/reviews?channels={channels}&after={after}&before={before}&submittedAfter={submittedAfter}&submittedBefore={submittedBefore}&count={count}&rating={rating}&status={status}&type={type}&hasReply={hasReply}&additionalInformation={additionalInformation}&ignoreStatements={ignoreStatements}&query={query}&orderBy={orderBy}' \ --request GET \ --header 'Authorization: value' \ --location

      <?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.etrusted.com/reviews?count=95&rating=2,3,4,5",
  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/reviews?count=95&rating=2,3,4,5",
  "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/reviews?count=95&rating=2,3,4,5")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("cache-control", "no-cache")
  .build();

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


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

Get a review by ID

This endpoint retrieves a review by its ID.

Parameters

Route Parameters

Name Description
reviewId

The review ID.

Example: rev-xxxxxxxa-yyyy-xxxx-yyyy-xxxxxxxxxxxx

HTTP Headers

Name Description
Authorization

An OAuth2 authorization header with an access token, see OAuth2

Responses

200 - The review with the specified ID.

Name Description
application/json CustomerReviewResponseDto

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/reviews/{reviewId}
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const reviewId = null; // Change me! const headers = { 'Authorization': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/reviews/${reviewId}`; 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 reviewId = null; // Change me! const headers = { 'Authorization': null, // Change me! }; const body = ""; //#endregion let urlAsString = `${baseUrl}/reviews/${reviewId}`; 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"; queryStringParameters = { } routeParameters = { "reviewId": 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 + "/reviews/{reviewId}" + (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("reviewId", null); // Change me! headers.put("Authorization", null); // Change me! //#endregion String urlAsString = baseUrl + "/reviews/{reviewId}"; 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'; $reviewId = null; // Change me! $headers = array( "Authorization" => null, // Change me! );//#endregion $url = "$baseUrl/reviews/$reviewId"; $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 query_string_parameters = { } route_parameters = { 'reviewId': '', # Change me! } headers = { 'Authorization': '', # Change me! } url_as_string = 'https://api.etrusted.com/reviews/{reviewId}'.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/reviews/{reviewId}' \ --request GET \ --header 'Authorization: value' \ --location

      <?php

$curl = curl_init();

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

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


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

Create a veto for a review

This endpoint creates a veto for the specified review. A veto flags a review as inappropriate and suggests that the review should be removed or investigated. Veto objects consist of a comment, a reason and the associated channel name.

Note that whenever this method is called, eTrusted will create a ticket in Trusted Shops' Review Team board containing the veto data for further investigation.

Parameters

Route Parameters

Name Description
reviewId

The review ID.

HTTP Headers

Name Description
Authorization

A token header containing information such as the account ID.

Body

Content-Type Type
application/json ReviewVetoRequestDto
{ "comment": "My veto comment.", "reason": "UNTRUTHFUL", "vetoReporterEmail": "my-name@my-domain.com", "channelName": "My channel name." }

Responses

200 - The veto has been saved succesfully.

Name Description
application/json ReviewVetoResponseDto

400 - Bad Request

No body is sent for this status code.

401 - Unauthorized

No body is sent for this status code.

403 - Forbidden

No body is sent for this status code.

404 - Not Found

No body is sent for this status code.
POST
https://api.etrusted.com/reviews/{reviewId}/vetos
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const reviewId = null; // Change me! const headers = { 'Authorization': null, // Change me! }; const body = { "comment": "My veto comment.", "reason": "UNTRUTHFUL", "vetoReporterEmail": "my-name@my-domain.com", "channelName": "My channel name." }; //#endregion let url = `${baseUrl}/reviews/${reviewId}/vetos`; 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 reviewId = null; // Change me! const headers = { 'Authorization': null, // Change me! }; const body = { "comment": "My veto comment.", "reason": "UNTRUTHFUL", "vetoReporterEmail": "my-name@my-domain.com", "channelName": "My channel name." }; //#endregion let urlAsString = `${baseUrl}/reviews/${reviewId}/vetos`; 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"; queryStringParameters = { } routeParameters = { "reviewId": 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 + "/reviews/{reviewId}/vetos" + (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({ "comment": "My veto comment.", "reason": "UNTRUTHFUL", "vetoReporterEmail": "my-name@my-domain.com", "channelName": "My channel name." }) response = https.request(request) puts response.read_body
//#region Imports import java.net.URL; import java.net.URLEncoder; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.lang.StringBuffer; import java.util.Map; import java.util.HashMap; import java.util.AbstractMap; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.ArrayList; //#endregion public class main { public static final Pattern PATTERN = Pattern.compile("\\{([^\\}]*)\\}"); public static void main(String[] args) throws IOException { try { Map<String, String> headers = new HashMap<>(); Map<String, String> queryStringValues = new HashMap<>(); Map<String, String> routeParameters = new HashMap<>(); //#region Parameters String body = new StringBuilder() .append("{") .append(" \"comment\": \"My veto comment.\",") .append(" \"reason\": \"UNTRUTHFUL\",") .append(" \"vetoReporterEmail\": \"my-name@my-domain.com\",") .append(" \"channelName\": \"My channel name.\"") .append("}") .toString(); String baseUrl = "https://api.etrusted.com"; routeParameters.put("reviewId", null); // Change me! headers.put("Authorization", null); // Change me! //#endregion String urlAsString = baseUrl + "/reviews/{reviewId}/vetos"; 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'; $reviewId = null; // Change me! $headers = array( "Authorization" => null, // Change me! ); // Change me! $body = json_decode('{ "comment": "My veto comment.", "reason": "UNTRUTHFUL", "vetoReporterEmail": "my-name@my-domain.com", "channelName": "My channel name." }'); //#endregion $url = "$baseUrl/reviews/$reviewId/vetos"; $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 query_string_parameters = { } route_parameters = { 'reviewId': '', # Change me! } headers = { 'Content-Type': 'application/json' 'Authorization': '', # Change me! } url_as_string = 'https://api.etrusted.com/reviews/{reviewId}/vetos'.format(**{ **query_string_parameters, **route_parameters }) payload = '' payload = json.dumps({ "comment": "My veto comment.", "reason": "UNTRUTHFUL", "vetoReporterEmail": "my-name@my-domain.com", "channelName": "My channel name." }) url = urlparse(url_as_string) http_client = http.client.HTTPSConnection(url.netloc) http_client.request("POST", url_as_string, payload, headers) response = http_client.getresponse() data = response.read() print(data.decode("utf-8"))
curl 'https://api.etrusted.com/reviews/{reviewId}/vetos' \ --request POST \ --data-raw '{ "comment": "My veto comment.", "reason": "UNTRUTHFUL", "vetoReporterEmail": "my-name@my-domain.com", "channelName": "My channel name." }' \ --header 'Content-Type: application/json' \ --header 'Authorization: value' \ --location

      <?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.etrusted.com/reviews/{reviewId}/vetos",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>
  '{
    "comment": "My veto comment.",
    "reason": "UNTRUTHFUL",
    "channelName": "My channel name."
   }',
  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/reviews/{reviewId}/vetos",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer {access_token}",
    "cache-control": "no-cache",
  },
  "processData": false,
  "data": {
    "comment": "My veto comment.",
    "reason": "UNTRUTHFUL",
    "channelName": "My channel name."
    }
}

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


    

      OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType,
  "{" +
     "\"comment\": \"My veto comment.\"," +
     "\"reason\": \"UNTRUTHFUL\"," +
     "\"channelName\": \"My channel name.\"" +
 "}"
);

Request request = new Request.Builder()
  .url("https://api.etrusted.com/reviews/{reviewId}/vetos")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("cache-control", "no-cache")
  .build();

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


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

Get a review Veto by reviewID

This endpoint retrieves the veto for a specific review.

Parameters

Route Parameters

Name Description
reviewId

The review ID.

HTTP Headers

Name Description
Authorization

An OAuth2 authorization header with an access token, see OAuth2

Responses

200 - The vetos for the given reviews.

Name Description
application/json ReviewVetoResponseDto

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/reviews/{reviewId}/vetos
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const reviewId = null; // Change me! const headers = { 'Authorization': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/reviews/${reviewId}/vetos`; 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 reviewId = null; // Change me! const headers = { 'Authorization': null, // Change me! }; const body = ""; //#endregion let urlAsString = `${baseUrl}/reviews/${reviewId}/vetos`; 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"; queryStringParameters = { } routeParameters = { "reviewId": 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 + "/reviews/{reviewId}/vetos" + (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("reviewId", null); // Change me! headers.put("Authorization", null); // Change me! //#endregion String urlAsString = baseUrl + "/reviews/{reviewId}/vetos"; 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'; $reviewId = null; // Change me! $headers = array( "Authorization" => null, // Change me! );//#endregion $url = "$baseUrl/reviews/$reviewId/vetos"; $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 query_string_parameters = { } route_parameters = { 'reviewId': '', # Change me! } headers = { 'Authorization': '', # Change me! } url_as_string = 'https://api.etrusted.com/reviews/{reviewId}/vetos'.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/reviews/{reviewId}/vetos' \ --request GET \ --header 'Authorization: value' \ --location

      <?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.etrusted.com/reviews/rev-xxxxxx1/vetos",
  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/reviews/rev-xxxxxx1/vetos",
  "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/reviews/rev-xxxxxx1/vetos")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("cache-control", "no-cache")
  .build();
Response response = client.newCall(request).execute();


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

Get the total number of reviews based on a filter.

This endpoint retrieves count of reviews for a specific channel The result set can be modified using a set of filters. Query parameters can be added to the request, separated by &.

Parameters

HTTP Headers

Name Description
Authorization

An OAuth2 authorization header with an access token, see OAuth2

Query Parameters

Name Description
channels

The list of channels for which the list of reviews will be returned.

Example: channels=chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxx1,chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxx2

submittedAfter

submittedAfter is a timestamp 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 list of reviews will only contain reviews submitted with a later timestamp.

Example: 2018-02-01T17:10:42.733Z

submittedBefore

submittedBefore is a timestamp 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 list of reviews will only contain reviews submitted with an earlier timestamp.

Example: 2018-02-01T17:10:42.733Z

rating

A comma-separated list of star ratings to be retrieved. If not set, all reviews are listed.

Example: 1, 2, 5

status

A comma-separated list of statuses to be retrieved. If not set, all reviews are listed.

The statuses you can filter for are:

  • APPROVED
  • MODERATION
  • REJECTED

Example: APPROVED, MODERATION

See our glossary entry for more information on review statuses.

type

A comma-separated list of review types to be retrieved. If not set, all reviews are listed.

The review types are:

  • SERVICE_REVIEW
  • PRODUCT_REVIEW

Example: PRODUCT_REVIEW

See our glossary entry for more information on review states.

hasReply

Reduces the list of reviews to only match reviews that either have been replied to or not. If not set, all reviews are listed.

Example: true

additionalInformation

A comma-separated list of additional pieces of information to be retrieved with the review.

If this property is not set, none of the of additional information are included in the review.

Currently there are the following valid additional information types:

  • VETO, which holds information about a veto by our customer
  • ATTACHMENTS, which hold information about file attachments for this review
  • ORIGINAL_REVIEW, which holds information about the original review, in case the consumer edited their review via our B2C world.

Example: [VETO]

ignoreStatements

Filters the list to ignore statements. Default is true.

query

A full-text search query that is matched against the order reference and email properties.

Responses

200 - The count of reviews for the given channel.

Name Description
application/json ChannelReviewCountResponseDto

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/reviews/count
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const headers = { 'Authorization': null, // Change me! }; const queryParameters = { 'channels': null, // Change me! 'submittedAfter': null, // Change me! 'submittedBefore': null, // Change me! 'rating': null, // Change me! 'status': null, // Change me! 'type': null, // Change me! 'hasReply': null, // Change me! 'additionalInformation': null, // Change me! 'ignoreStatements': null, // Change me! 'query': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/reviews/count`; 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! }; const queryParameters = { 'channels': null, // Change me! 'submittedAfter': null, // Change me! 'submittedBefore': null, // Change me! 'rating': null, // Change me! 'status': null, // Change me! 'type': null, // Change me! 'hasReply': null, // Change me! 'additionalInformation': null, // Change me! 'ignoreStatements': null, // Change me! 'query': null, // Change me! }; const body = ""; //#endregion let urlAsString = `${baseUrl}/reviews/count`; 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"; queryStringParameters = { "channels": nil, # Change me! "submittedAfter": nil, # Change me! "submittedBefore": nil, # Change me! "rating": nil, # Change me! "status": nil, # Change me! "type": nil, # Change me! "hasReply": nil, # Change me! "additionalInformation": nil, # Change me! "ignoreStatements": nil, # Change me! "query": 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 + "/reviews/count" + (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! queryStringValues.put("channels", null); // Change me! queryStringValues.put("submittedAfter", null); // Change me! queryStringValues.put("submittedBefore", null); // Change me! queryStringValues.put("rating", null); // Change me! queryStringValues.put("status", null); // Change me! queryStringValues.put("type", null); // Change me! queryStringValues.put("hasReply", null); // Change me! queryStringValues.put("additionalInformation", null); // Change me! queryStringValues.put("ignoreStatements", null); // Change me! queryStringValues.put("query", null); // Change me! //#endregion String urlAsString = baseUrl + "/reviews/count"; 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'; $channels = null; // Change me! $submittedAfter = null; // Change me! $submittedBefore = null; // Change me! $rating = null; // Change me! $status = null; // Change me! $type = null; // Change me! $hasReply = null; // Change me! $additionalInformation = null; // Change me! $ignoreStatements = null; // Change me! $query = null; // Change me! $headers = array( "Authorization" => null, // Change me! );//#endregion $url = "$baseUrl/reviews/count"; $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 query_string_parameters = { 'channels': '', # Change me! 'submittedAfter': '', # Change me! 'submittedBefore': '', # Change me! 'rating': '', # Change me! 'status': '', # Change me! 'type': '', # Change me! 'hasReply': '', # Change me! 'additionalInformation': '', # Change me! 'ignoreStatements': '', # Change me! 'query': '', # Change me! } route_parameters = { } headers = { 'Authorization': '', # Change me! } url_as_string = 'https://api.etrusted.com/reviews/count?channels={channels}&submittedAfter={submittedAfter}&submittedBefore={submittedBefore}&rating={rating}&status={status}&type={type}&hasReply={hasReply}&additionalInformation={additionalInformation}&ignoreStatements={ignoreStatements}&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/reviews/count?channels={channels}&submittedAfter={submittedAfter}&submittedBefore={submittedBefore}&rating={rating}&status={status}&type={type}&hasReply={hasReply}&additionalInformation={additionalInformation}&ignoreStatements={ignoreStatements}&query={query}' \ --request GET \ --header 'Authorization: value' \ --location

      <?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.etrusted.com/reviews?count=95&rating=2,3,4,5",
  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/reviews?count=95&rating=2,3,4,5",
  "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/reviews?count=95&rating=2,3,4,5")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("cache-control", "no-cache")
  .build();

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


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

Get a list of reviews with fewer properties per each item.

This endpoint retrieves reviews for a specific channel, a set of channels or for your entire account.

The response items have fewer properties compared to that of the /reviews endpoint which returns review items containing all properties.

The results can be filtered by appending any of the provided query parameters to the endpoint URL. Remember to use & as a separator for multiple parameters eg: /reviews-minimal?channels=chl-xxx-yyyy&submittedAfter=2018-02-01T17:10:42.733Z

Also, for pagination, you have the following query parameters count, after and before. See our article on paginating response data to learn how to use them.

Parameters

HTTP Headers

Name Description
Authorization

An OAuth2 authorization header with an access token, see OAuth2

Query Parameters

Name Description
channels

The list of channels for which the list of reviews will be returned.

Example: channels=chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxx1,chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxx2

after

after is a review ID. The list of reviews in the response will only contain reviews submitted earlier than the review with this ID.

Example: rev-xxxxxxxa-yyyy-xxxx-yyyy-xxxxxxxxxxxx

before

before is a review ID. The list of reviews in the response will only contain reviews submitted later than the review with this ID.

Example: rev-xxxxxxxb-yyyy-xxxx-yyyy-xxxxxxxxxxxx

submittedAfter

submittedAfter is a timestamp 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 list of reviews will only contain reviews submitted with a later timestamp.

Example: 2018-02-01T17:10:42.733Z

submittedBefore

submittedBefore is a timestamp 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 list of reviews will only contain reviews submitted with an earlier timestamp.

Example: 2018-02-01T17:10:42.733Z

count

The desired number of reviews to be retrieved per page.

rating

A comma-separated list of star ratings to be retrieved. If not set, all reviews are listed.

Example: 1, 2, 5

status

A comma-separated list of statuses to be retrieved. If not set, all reviews are listed.

The statuses you can filter for are:

  • APPROVED
  • MODERATION
  • REJECTED

Example: APPROVED, MODERATION

See our glossary entry for more information on review statuses.

type

A comma-separated list of review types to be retrieved. If not set, all reviews are listed.

The review types are:

  • SERVICE_REVIEW
  • PRODUCT_REVIEW

Example: PRODUCT_REVIEW

See our glossary entry for more information on review states.

hasReply

Reduces the list of reviews to only match reviews that either have been replied to or not. If not set, all reviews are listed.

Example: true

ignoreStatements

Filters the list to ignore statements. Default is true.

query

A full-text search query that is matched against the order reference and email properties.

orderBy

Specify the date to sort the returned list of reviews by. Possible options:

  • editedAt: This is the date when the consumer last changed the review.It sorts the reviews in descending order using the lastEditedAt date
  • updatedAt:This is the date when the review was last updated. It sorts the reviews in descending order using the updatedAt date
  • submittedAt: This is the date when the review was created by the consumer. Reviews will be sorted by default in descending order using the submittedAt date if the orderBy parameter is not set or set to a non existing value.

Responses

200 - The list of reviews for the given channels or all channels.

Name Description
application/json MinimalCustomerReviewListResponseDto

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/reviews-minimal
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const headers = { 'Authorization': null, // Change me! }; const queryParameters = { 'channels': null, // Change me! 'after': null, // Change me! 'before': null, // Change me! 'submittedAfter': null, // Change me! 'submittedBefore': null, // Change me! 'count': null, // Change me! 'rating': null, // Change me! 'status': null, // Change me! 'type': null, // Change me! 'hasReply': null, // Change me! 'ignoreStatements': null, // Change me! 'query': null, // Change me! 'orderBy': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/reviews-minimal`; 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! }; const queryParameters = { 'channels': null, // Change me! 'after': null, // Change me! 'before': null, // Change me! 'submittedAfter': null, // Change me! 'submittedBefore': null, // Change me! 'count': null, // Change me! 'rating': null, // Change me! 'status': null, // Change me! 'type': null, // Change me! 'hasReply': null, // Change me! 'ignoreStatements': null, // Change me! 'query': null, // Change me! 'orderBy': null, // Change me! }; const body = ""; //#endregion let urlAsString = `${baseUrl}/reviews-minimal`; 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"; queryStringParameters = { "channels": nil, # Change me! "after": nil, # Change me! "before": nil, # Change me! "submittedAfter": nil, # Change me! "submittedBefore": nil, # Change me! "count": nil, # Change me! "rating": nil, # Change me! "status": nil, # Change me! "type": nil, # Change me! "hasReply": nil, # Change me! "ignoreStatements": nil, # Change me! "query": nil, # Change me! "orderBy": 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 + "/reviews-minimal" + (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! queryStringValues.put("channels", null); // Change me! queryStringValues.put("after", null); // Change me! queryStringValues.put("before", null); // Change me! queryStringValues.put("submittedAfter", null); // Change me! queryStringValues.put("submittedBefore", null); // Change me! queryStringValues.put("count", null); // Change me! queryStringValues.put("rating", null); // Change me! queryStringValues.put("status", null); // Change me! queryStringValues.put("type", null); // Change me! queryStringValues.put("hasReply", null); // Change me! queryStringValues.put("ignoreStatements", null); // Change me! queryStringValues.put("query", null); // Change me! queryStringValues.put("orderBy", null); // Change me! //#endregion String urlAsString = baseUrl + "/reviews-minimal"; 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'; $channels = null; // Change me! $after = null; // Change me! $before = null; // Change me! $submittedAfter = null; // Change me! $submittedBefore = null; // Change me! $count = null; // Change me! $rating = null; // Change me! $status = null; // Change me! $type = null; // Change me! $hasReply = null; // Change me! $ignoreStatements = null; // Change me! $query = null; // Change me! $orderBy = null; // Change me! $headers = array( "Authorization" => null, // Change me! );//#endregion $url = "$baseUrl/reviews-minimal"; $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 query_string_parameters = { 'channels': '', # Change me! 'after': '', # Change me! 'before': '', # Change me! 'submittedAfter': '', # Change me! 'submittedBefore': '', # Change me! 'count': '', # Change me! 'rating': '', # Change me! 'status': '', # Change me! 'type': '', # Change me! 'hasReply': '', # Change me! 'ignoreStatements': '', # Change me! 'query': '', # Change me! 'orderBy': '', # Change me! } route_parameters = { } headers = { 'Authorization': '', # Change me! } url_as_string = 'https://api.etrusted.com/reviews-minimal?channels={channels}&after={after}&before={before}&submittedAfter={submittedAfter}&submittedBefore={submittedBefore}&count={count}&rating={rating}&status={status}&type={type}&hasReply={hasReply}&ignoreStatements={ignoreStatements}&query={query}&orderBy={orderBy}'.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/reviews-minimal?channels={channels}&after={after}&before={before}&submittedAfter={submittedAfter}&submittedBefore={submittedBefore}&count={count}&rating={rating}&status={status}&type={type}&hasReply={hasReply}&ignoreStatements={ignoreStatements}&query={query}&orderBy={orderBy}' \ --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!

Get service review rating by channel ID

This endpoint retrieves aggregate ratings for service reviews by channel ID.

The response will contain aggregates for five periods of time: the last seven, 30, 90 days, the last year, and overall. If the overall period of collecting reviews is shorter than one or several of the fix periods, the aggregates will still be calculated and returned.

For example, if a channel only collects service reviews for 14 days, the answer will still contain the aggregates for 30, 90 and 365 days, but they will be the same, except for the start property (see objects below).

Parameters

Route Parameters

Name Description
channelId

The channel ID for which to retrieve the aggregate ratings.

Example: chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx

Responses

200 - The retrieved aggregate ratings.

Name Description
application/json AggregateRatingResponse

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/{channelId}/service-reviews/aggregate-rating
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const channelId = null; // Change me! const body = ""; //#endregion let url = `${baseUrl}/channels/${channelId}/service-reviews/aggregate-rating`; const xhr = new XMLHttpRequest(); xhr.open('GET', 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 channelId = null; // Change me! const body = ""; //#endregion let urlAsString = `${baseUrl}/channels/${channelId}/service-reviews/aggregate-rating`; 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: { } }; 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 = { "channelId": nil, # Change me! } headers = { } queryStringValues = queryStringParameters.to_a queryStringPairs = queryStringValues.map { |entry| entry[0].to_s + "=" + (entry[1] || '') }; queryString = queryStringPairs.join('&') urlAsString = baseUrl + "/channels/{channelId}/service-reviews/aggregate-rating" + (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) 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("channelId", null); // Change me! //#endregion String urlAsString = baseUrl + "/channels/{channelId}/service-reviews/aggregate-rating"; 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'; $channelId = null; // Change me! //#endregion $url = "$baseUrl/channels/$channelId/service-reviews/aggregate-rating"; $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( ), )); $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 = { 'channelId': '', # Change me! } headers = { } url_as_string = 'https://api.etrusted.com/channels/{channelId}/service-reviews/aggregate-rating'.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/{channelId}/service-reviews/aggregate-rating' \ --request GET \ --location

      <?php

$request = new HttpRequest();
$request->setUrl('https://api.etrusted.com/channels/{channelId}/service-reviews/aggregate-rating');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'Authorization' => 'Bearer {access_token}',
  'Content-Type' => 'application/json'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}


    

      var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.etrusted.com/channels/{channelId}/service-reviews/aggregate-rating",
  "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/channels/{channelId}/service-reviews/aggregate-rating")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("cache-control", "no-cache")
  .build();

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


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

Get review stats over different time frames

NB: This endpoint is currently not publicly accessible. Please reach out to your respective CSMs our account executive if you will like to use this API.

You can combine a number of filters known as tags to select specific reviews you will like to collect stats on.

Here is the list of supported tags:

  • Channel: You can include reviews belonging to a single or group of channels to be aggregated for the stats.

  • Event type (touchpoint): You can also filter out reviews based on the event type (touchpoint),

  • Metadata properties: You can get the stats based on specific metadata properties that you added when creating an event.

NB: Besides metadata properties, all other keywords must be prefixed with the $ sign to denote that they are reserved keywords within the system eg: channel should be $channel and touchpoint $touchpoint. Also, stats are collected for only approved reviews.

To fetch the stats for reviews belonging to the channel chl-abc and chl-xyz at touchpoint checkout and a productCategory of shoes from the metadata your request payload will look something like the one below:

{
    "tags": [
   {"category":"$channel","value":"chl-abc"},
   {"category":"$channel","value":"chl-xyz"},
   {"category":"$touchpoint","value":"checkout"},
   {"category":"productCategory","value":"shoes"}
   ]
}

Parameters

HTTP Headers

Name Description
Authorization

An OAuth token in the form "Bearer {accessToken}"

Body

Content-Type Type
application/json ReviewRequestDto
{ "tags": [ {} ] }

Responses

200 - The stats was fetched successfully.

Name Description
application/json ReviewResponseDto

400 - Bad Request

No body is sent for this status code.

401 - Unauthorized

No body is sent for this status code.

403 - Forbidden

No body is sent for this status code.

404 - Not Found

No body is sent for this status code.
POST
https://api.etrusted.com/aggregations-metadata
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const headers = { 'Authorization': null, // Change me! }; const body = { "tags": [ {} ] }; //#endregion let url = `${baseUrl}/aggregations-metadata`; 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 = { "tags": [ {} ] }; //#endregion let urlAsString = `${baseUrl}/aggregations-metadata`; 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"; 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 + "/aggregations-metadata" + (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({ "tags": [ {} ] }) 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(" \"tags\": [") .append(" {}") .append(" ]") .append("}") .toString(); String baseUrl = "https://api.etrusted.com"; headers.put("Authorization", null); // Change me! //#endregion String urlAsString = baseUrl + "/aggregations-metadata"; 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('{ "tags": [ {} ] }'); //#endregion $url = "$baseUrl/aggregations-metadata"; $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 query_string_parameters = { } route_parameters = { } headers = { 'Content-Type': 'application/json' 'Authorization': '', # Change me! } url_as_string = 'https://api.etrusted.com/aggregations-metadata'.format(**{ **query_string_parameters, **route_parameters }) payload = '' payload = json.dumps({ "tags": [ {} ] }) 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/aggregations-metadata' \ --request POST \ --data-raw '{ "tags": [ {} ] }' \ --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!

Save a review reply

Reply to a review

Parameters

Route Parameters

Name Description
reviewId

The review ID.

HTTP Headers

Name Description
Authorization

A token header containing meta information such as the account ID.

Body

Content-Type Type
application/json ReviewReply
{}

Responses

200 - The review reply was saved.

No body is sent for this status code.

400 - Bad Request

No body is sent for this status code.

401 - Unauthorized

No body is sent for this status code.

403 - Forbidden

No body is sent for this status code.

404 - Not Found

No body is sent for this status code.
POST
https://api.etrusted.com/reviews/{reviewId}/reply
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const reviewId = null; // Change me! const headers = { 'Authorization': null, // Change me! }; const body = {}; //#endregion let url = `${baseUrl}/reviews/${reviewId}/reply`; 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 reviewId = null; // Change me! const headers = { 'Authorization': null, // Change me! }; const body = {}; //#endregion let urlAsString = `${baseUrl}/reviews/${reviewId}/reply`; 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"; queryStringParameters = { } routeParameters = { "reviewId": 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 + "/reviews/{reviewId}/reply" + (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({}) 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("{}") .toString(); String baseUrl = "https://api.etrusted.com"; routeParameters.put("reviewId", null); // Change me! headers.put("Authorization", null); // Change me! //#endregion String urlAsString = baseUrl + "/reviews/{reviewId}/reply"; 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'; $reviewId = null; // Change me! $headers = array( "Authorization" => null, // Change me! ); // Change me! $body = json_decode('{}'); //#endregion $url = "$baseUrl/reviews/$reviewId/reply"; $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 query_string_parameters = { } route_parameters = { 'reviewId': '', # Change me! } headers = { 'Content-Type': 'application/json' 'Authorization': '', # Change me! } url_as_string = 'https://api.etrusted.com/reviews/{reviewId}/reply'.format(**{ **query_string_parameters, **route_parameters }) payload = '' payload = json.dumps({}) 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/reviews/{reviewId}/reply' \ --request POST \ --data-raw '{}' \ --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 a review reply

Delete a reply to a review. NB: Because you can only have a single reply to a review you only need to provide the review id to delete it.

Parameters

Route Parameters

Name Description
reviewId

The review ID.

HTTP Headers

Name Description
Authorization

A token header containing meta information such as the account ID.

Responses

204 - The review reply was deleted.

No body is sent for this status code.

400 - Bad Request

No body is sent for this status code.

401 - Unauthorized

No body is sent for this status code.

403 - Forbidden

No body is sent for this status code.

404 - Not Found

No body is sent for this status code.
DELETE
https://api.etrusted.com/reviews/{reviewId}/reply
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const reviewId = null; // Change me! const headers = { 'Authorization': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/reviews/${reviewId}/reply`; 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 reviewId = null; // Change me! const headers = { 'Authorization': null, // Change me! }; const body = ""; //#endregion let urlAsString = `${baseUrl}/reviews/${reviewId}/reply`; 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"; queryStringParameters = { } routeParameters = { "reviewId": 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 + "/reviews/{reviewId}/reply" + (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("reviewId", null); // Change me! headers.put("Authorization", null); // Change me! //#endregion String urlAsString = baseUrl + "/reviews/{reviewId}/reply"; 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'; $reviewId = null; // Change me! $headers = array( "Authorization" => null, // Change me! );//#endregion $url = "$baseUrl/reviews/$reviewId/reply"; $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 query_string_parameters = { } route_parameters = { 'reviewId': '', # Change me! } headers = { 'Authorization': '', # Change me! } url_as_string = 'https://api.etrusted.com/reviews/{reviewId}/reply'.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/reviews/{reviewId}/reply' \ --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

FeedbackType

The feedback type which is determined by the customer review title, comment and rating. The type is REVIEW unless either the comment or the rating are missing. In that case it is STATEMENT.

Properties

ReviewState

The state of the customer review when the API request was processed. See our glossary entry for more information on review states.

Properties

Type

The customer review type.

A service review is a review for a channel as a whole, e.g. a shop or a store, while a product review is tied to a single product.

Properties

VerificationType

Specifies whether the collection method in combination with the provider/source can be trusted. A Review will be VERIFIED unless it comes from an external import by an account that is not explicitly marked as verified.

Properties

CustomerReviewReplyDto

The reply to the customer review, written by the channel owner.

Properties

createdAt
string
 

The date and time when the reply was stored initially, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ. Check the glossary for examples of valid datetime formats.

updatedAt
string
 

The date and time when the reply was last updated, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ. Check the glossary for examples of valid datetime formats.

comment
string
 

The text message of the reply.

sendNotification
boolean

Indicates whether the reviewer is notified about the reply by eTrusted or not.

CustomerReviewResponseProductDto

The product data retrieved with the customer review.

Properties

id
string
 

The product UUID.

sku
string
 

The Stock Keeping Unit is a specific article number of the product, most often assigned by a specific retail shop as a scannable bar code. It lets the shops track movement of inventory. The SKU must be unique and usually consists of about 8 characters.

mpn
string

The Manufacturer Part Number is an identifier for a product by the manufacturer if applicable. In some cases it can serve as a substitute for the GTIN.

gtin
string

The GTIN is a unique string that identifies the product globally. A GTIN can be an ISBN, an EAN, and much more. Refer to gtin.info.

name
string
 

The product name contains information about a product that is associated with the customer review. E.g. Specialbrand T-Shirt White M.

url
string
 

The link to the product detail page in your online shop or public catalog (e.g. http://www.specialbrandshop.com/article123-TS-WH-M/).

imageUrl
string

The link to the product image of the product. eTrusted shows a picture of the product to the customer who wants to write a review. This makes it easier for customers to remember the purchase and recognize the product.

brand
string

The brand of the product. A product can only have one brand.

OriginalReview

This is the initial unedited customer review. This object will not change when the review gets edited.

Properties

rating
number

The original core review star rating. The value ranges from 1 to 5.

comment
string

The original review comment. It is a string of up to 4000 characters.

title
string

The original review title.

reply
object

The original reply to the customer review, written by the channel owner.

Properties
replyComment
string

The text message of the reply.

replyCreatedAt
string

The date and time when the reply was stored initially, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ. Check the glossary for examples of valid datetime formats.

replyUpdatedAt
string

The date and time when the reply was last updated, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ. Check the glossary for examples of valid datetime formats.

CustomerReviewResponseDto

A single retrieved customer review.

Properties

_object
string
 

The object type of this response object, which is CustomerReview.

id
string
 

The customer review UUID.

accountRef
string
 

A UUID as account reference.

channelRef
string
 

A UUID as channel reference.

inviteRef
string

A UUID as invite reference.

rating
number
 

The star rating.

The value ranges from 1.0 to 5.0.

title
string
 

A title headline for this customer review.

comment
string
 

The review text for this customer review.

createdAt
string
 

The date and time when the customer review was stored initially, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ. Check the glossary for examples of valid datetime formats. This date will be after submittedAt for imported reviews.

updatedAt
string
 

The date and time when the customer review was last modified, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ. Check the glossary for examples of valid datetime formats.

submittedAt
string
 

The date and time when the customer review was submitted by the reviewer, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ. Check the glossary for examples of valid datetime formats.

feedbackType

state
 

type
 

verificationType

customer
object

This object holds information about the customer who wrote the review.

Properties
firstName
string

The first name of the customer.

lastName
string

The last name of the customer.

fullName
string

The full name of the customer.

email
string

An email address of the customer.

mobile
string

A mobile phone number of the customer.

transaction
object

The transaction associated with the customer review.

Properties
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. Check the glossary for examples of valid datetime formats.

event
object

The event object that is associated with the customer review.

Properties
id
string
 

The event UUID.

type
string
 

The event type.

metadata
object

The metadata object is a collection of user-defined data added to the customer review.

surveyData
object

The surveyData object holds custom response data from additional questions from eTrusted questionnaires.

questionnaire
object
 

The questionnaire that was used to collect the customer review.

Properties
id
string
 

The questionnaire UUID.

locale
string
 

The questionnaire locale.

templateRef
string
 

A UUID as questionnaire template reference.

hasAttachments
boolean

This indicates if the whether the customer review has attachments, such as images.

additionalInformation
object

This object containts all of the additional information that is stored with the customer review.

Properties
veto
object

The veto of this customer review.

Properties
createdAt
string
 

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

comment
string
 

The comment in the ticket that was created internally at Trusted Shops for this veto.

reason
string
 

The reason for this veto.

This string may only have the following values:

  • UNTRUTHFUL
  • ABUSIVE
  • VIOLATES_THE_TERMS_OF_USE

ticketId
string
 

A reference to the ticket that was created internally at Trusted Shops for this veto. The ID is a sequence of six digits.

attachments
object

Holds information about the attachments of this customer review.

Properties
images
object[]

This is a list of image objects.

Each image object represents a single image attached to this customer review.

originalReview
object

This object contains the original review, in case the consumer edited their review via our B2C world.

Properties
rating
number

The star rating before the changes.

The value ranges from 1.0 to 5.0.

title
string

A title headline for this customer review before any changes.

comment
string

The review text for this customer review before any changes.

editedAt
string

The date and time when the customer review was last edited by the consumer via our B2C world, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ. Check the glossary for examples of valid datetime formats. Will not be present in the response when the review was never edited by the consumer.

originalReview

CustomerReviewListResponseDto

The list of retrieved reviews.

Properties

totalElements
integer
 

Deprecated. Use review/count. The value will return 0.

paging
object
 

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

Properties
count
integer
 

This is the number of reviews 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 reviews are displayed in chunks of 20 reviews 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
before
string
 

This is a review ID to retrieve the previous page in the pagination.

after
string
 

This is a review ID to retrieve the next page in the pagination.

links
object
 

Links to the previous and next pages in the pagination.

Note that the links contain the exact filter parameters that were used in the request (rating, submittedBefore, submittedAfter). This makes sure that the pagination is always relative to the same filter in subsequent requests. If developers build URLs themselves using after, before, and the matching information inside the cursor object, they may need to ensure to 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.

items
 

This is the list of review objects.

Each item object represents a single retrieved review.

ReviewVetoRequestDto

Properties

comment
string
 

The veto comment. Provide additional information on the review or your veto here.

reason
string
 

The reason for the veto.

This string may only have the following values:

  • UNTRUTHFUL
  • ABUSIVE,
  • VIOLATES_THE_TERMS_OF_USE

vetoReporterEmail
string

The E-Mail address of the veto reporter.

channelName
string

The name of the channel the review is associated with.

ReviewVetoResponseDto

The veto has been saved successfully.

Properties

id
string
 

The veto UUID.

ticketId
string
 

A reference to the ticket that was created internally at Trusted Shops for this veto. The ID is a sequence of six digits.

comment
string
 

The comment in the ticket that was created internally at Trusted Shops for this veto.

reason
string
 

The reason for this veto.

This string may only have the following values:

  • UNTRUTHFUL
  • ABUSIVE
  • VIOLATES_THE_TERMS_OF_USE

createdAt
string
 

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

ChannelReviewCountResponseDto

The count of reviews for a channel.

Properties

accountId
string

The account ID

channelList
[]

The ID of the channels for which the review count will be returned.

totalElements
integer

The amount of reviews of a channel dependant of filter

MinimalCustomerReviewResponseDto

A single minimal retrieved customer review.

Properties

id
string
 

The customer review UUID.

channelRef
string
 

A UUID as channel reference.

rating
number
 

The star rating.

The value ranges from 1.0 to 5.0.

title
string
 

A title headline for this customer review.

comment
string
 

The review text for this customer review.

submittedAt
string
 

The date and time when the customer review was submitted by the reviewer, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ. Check the glossary for examples of valid datetime formats.

state
 

customer
object

This object holds information about the customer who wrote the review.

Properties
firstName
string

The first name of the customer.

lastName
string

The last name of the customer.

fullName
string

The full name of the customer.

email
string

An email address of the customer.

mobile
string

A mobile phone number of the customer.

hasAttachments
boolean

This indicates if the whether the customer review has attachments, such as images.

editedAt
string

The date and time when the customer review was last edited by the consumer via our B2C world, in the ISO 8601 and RFC 3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ. Check the glossary for examples of valid datetime formats. Will not be present in the response when the review was never edited by the consumer.

MinimalCustomerReviewListResponseDto

The list of retrieved reviews with mininal fields.

Properties

paging
object
 

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

Properties
cursor
object
 

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

Properties
before
string
 

This is a review ID to retrieve the previous page in the pagination.

after
string
 

This is a review ID to retrieve the next page in the pagination.

items
 

This is the list of review objects.

Each item object represents a single retrieved review.

AggregateRatingDistribution

The rating distribution per star.

Properties

oneStar
integer
 

The number of service reviews with a one star rating in the specified duration.

twoStars
integer
 

The number of service reviews with a two star rating in the specified duration.

threeStars
integer
 

The number of service reviews with a three star rating in the specified duration.

fourStars
integer
 

The number of service reviews with a four star rating in the specified duration.

fiveStars
integer
 

The number of service reviews with a five star rating in the specified duration.

AggregateRatingPeriod

The aggregation period for this aggregate rating object.

Properties

start
string
 

The start date and time of the aggregation period, in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd'T'HH:mm:ss.SSSZ.

end
string
 

The end date and time of the aggregation period, in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd'T'HH:mm:ss.SSSZ.

firstConsideredReviewSubmission
string
 

The date and time when the first review was collected during the aggregation period, in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd'T'HH:mm:ss.SSSZ.

lastConsideredReviewSubmission
string
 

The date and time when the last review was collected during the aggregation period, in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd'T'HH:mm:ss.SSSZ.

calculatedAt
string

The date and time when the aggregate rating was calculated, in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd'T'HH:mm:ss.SSSZ.

ratingTrend
string

The rating trend for the aggregation period, compared to the overall average rating. When calculating the trend, there is a five percent tolerance per grade, i.e. 5 * 0.05 tolerance.

Note that the overall period does not contain a ratingTrend as a comparison with itself would be meaningless.

AggregateRating

The average rating based on multiple reviews.

Properties

count
integer
 

The total number of service reviews in this aggregation.

rating
number
 

The average rating of the service reviews in the aggregation period, i.e. the sum of all their ratings divided by count and rounded to two digits after the decimal point.

AggregateRatingResponse

The average rating based on multiple service review ratings, each within the specified duration.

Properties

The aggregate service review rating for the last year.

ReviewRequestDto

Properties

tags
object[]

ReviewResponseDto

The stats was fetched successfully.

Properties

summaries
object

Properties
7days
object

Properties
rating
string

count
integer

distribution
object

Properties
oneStar
integer

twoStars
integer

threeStars
integer

fourStars
integer

fiveStars
integer

30days
object

Properties
rating
string

count
integer

distribution
object

Properties
oneStar
integer

twoStars
integer

threeStars
integer

fourStars
integer

fiveStars
integer

90days
object

Properties
rating
string

count
integer

distribution
object

Properties
oneStar
integer

twoStars
integer

threeStars
integer

fourStars
integer

fiveStars
integer

365days
object

Properties
rating
string

count
integer

distribution
object

Properties
oneStar
integer

twoStars
integer

threeStars
integer

fourStars
integer

fiveStars
integer

ReviewReply

The reply to a review

Properties

comment
string
 

The value to be used as review reply comment.

sendNotification
boolean

The value to be used to send review reply notification.

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.