Channels

Get channels

This endpoint retrieves all channels for your account.

Parameters

HTTP Headers

Name Description
token

An authorisation token containing meta information, see OAuth2.

Responses

200 - The list of channels associated with your account.

Name Description
application/json ChannelDto

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
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const headers = { 'token': null, // Change me! }; const body = ""; //#endregion let url = `${baseUrl}/channels`; const xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.setRequestHeader('token', `${headers["token"]}`); 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 = { 'token': null, // Change me! }; const body = ""; //#endregion let urlAsString = `${baseUrl}/channels`; const queryString = Object .keys(queryParameters) .map(key => `${key}=${encodeURIComponent(queryParameters[key])}`) .join('&'); urlAsString = queryString ? `${urlAsString}?${queryString}` : urlAsString; const url = new URL(urlAsString); const options = { hostname: url.hostname, port: url.port, path: url.path, method: 'GET', headers: { 'token': `${headers["token"]}`, } }; 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 = { "token": nil, # Change me! } queryStringValues = queryStringParameters.to_a queryStringPairs = queryStringValues.map { |entry| entry[0].to_s + "=" + (entry[1] || '') }; queryString = queryStringPairs.join('&') urlAsString = baseUrl + "/channels" + (queryString != "" ? "?" + queryString : "") urlAsString.gsub!(/\{[^\}]*\}/) { |m| routeParameters[m[1...-1].to_sym] } if urlAsString url = URI(urlAsString) https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) request["token"] = headers["token"] 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("token", null); // Change me! //#endregion String urlAsString = baseUrl + "/channels"; 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'; $headers = array( "token" => null, // Change me! ); $body = ""; //#endregion $url = "$baseUrl/channels"; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_POSTFIELDS => json_encode($body), CURLOPT_HTTPHEADER => array( "token: " . $headers["token"], ), )); $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 = { 'token': '', # Change me! } url_as_string = 'https://api.etrusted.com/channels'.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' \ --request GET \ --header 'token: value' \ --location

      <?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.etrusted.com/channels/",
  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",
  "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")
  .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!

Update a channel by ID

This endpoint updates the channel with the specified ID.

Parameters

Route Parameters

Name Description
id

The channel ID.

HTTP Headers

Name Description
Authorization

An authorisation token containing meta information, see OAuth2.

Body

Content-Type Type
application/json UpdateChannelDto
{ "name": "my_example_channel", "address": "Anystr. 17, 12345, Anycity, Anystate 12345", "url": "https://wwww.myshop.fiction", "logoUrl": "https://wwww.myshop.fiction/logo.png", "locale": "en_US" }

Responses

200 - The ID of the updated channel.

Name Description
application/json ChannelResponseDto

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.
PUT
https://api.etrusted.com/channels/{id}
//#region Parameters const baseUrl = 'https://api.etrusted.com'; const id = null; // Change me! const headers = { 'Authorization': null, // Change me! }; const body = { "name": "my_example_channel", "address": "Anystr. 17, 12345, Anycity, Anystate 12345", "url": "https://wwww.myshop.fiction", "logoUrl": "https://wwww.myshop.fiction/logo.png", "locale": "en_US" }; //#endregion let url = `${baseUrl}/channels/${id}`; const xhr = new XMLHttpRequest(); xhr.open('PUT', url, true); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('Authorization', `${headers["Authorization"]}`); xhr.onreadystatechange = function() { if(xhr.readyState == 4 && xhr.status == 200) { console.log(xhr.responseText); } }; xhr.send(body || undefined);
const https = require('https'); //#region Parameters const baseUrl = 'https://api.etrusted.com'; const id = null; // Change me! const headers = { 'Authorization': null, // Change me! }; const body = { "name": "my_example_channel", "address": "Anystr. 17, 12345, Anycity, Anystate 12345", "url": "https://wwww.myshop.fiction", "logoUrl": "https://wwww.myshop.fiction/logo.png", "locale": "en_US" }; //#endregion let urlAsString = `${baseUrl}/channels/${id}`; const queryString = Object .keys(queryParameters) .map(key => `${key}=${encodeURIComponent(queryParameters[key])}`) .join('&'); urlAsString = queryString ? `${urlAsString}?${queryString}` : urlAsString; const url = new URL(urlAsString); const options = { hostname: url.hostname, port: url.port, path: url.path, method: 'PUT', headers: { 'Authorization': `${headers["Authorization"]}`, 'Content-Type': 'application/json' } }; const req = https.request(options, res => { console.log(`statusCode: ${res.statusCode}`) res.on('data', d => { process.stdout.write(d) }); }); req.on('error', error => { console.error(error) }); if (body) { req.write(JSON.stringify(data)); } req.end();
require "uri" require "json" require "net/http" baseUrl = "https://api.etrusted.com"; queryStringParameters = { } routeParameters = { "id": nil, # Change me! } headers = { "Authorization": nil, # Change me! } queryStringValues = queryStringParameters.to_a queryStringPairs = queryStringValues.map { |entry| entry[0].to_s + "=" + (entry[1] || '') }; queryString = queryStringPairs.join('&') urlAsString = baseUrl + "/channels/{id}" + (queryString != "" ? "?" + queryString : "") urlAsString.gsub!(/\{[^\}]*\}/) { |m| routeParameters[m[1...-1].to_sym] } if urlAsString url = URI(urlAsString) https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Put.new(url) request["Authorization"] = headers["Authorization"] request["Content-Type"] = "application/json" request.body = JSON.dump({ "name": "my_example_channel", "address": "Anystr. 17, 12345, Anycity, Anystate 12345", "url": "https://wwww.myshop.fiction", "logoUrl": "https://wwww.myshop.fiction/logo.png", "locale": "en_US" }) 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(" \"name\": \"my_example_channel\",") .append(" \"address\": \"Anystr. 17, 12345, Anycity, Anystate 12345\",") .append(" \"url\": \"https://wwww.myshop.fiction\",") .append(" \"logoUrl\": \"https://wwww.myshop.fiction/logo.png\",") .append(" \"locale\": \"en_US\"") .append("}") .toString(); String baseUrl = "https://api.etrusted.com"; routeParameters.put("id", null); // Change me! headers.put("Authorization", null); // Change me! //#endregion String urlAsString = baseUrl + "/channels/{id}"; Matcher matcher = PATTERN.matcher(urlAsString); StringBuffer out = new StringBuffer(); while (matcher.find()) { String variable = routeParameters.get(matcher.group(1)); matcher.appendReplacement(out, variable); } matcher.appendTail(out); urlAsString = out.toString(); ArrayList<String> queryStringParts = new ArrayList<>(); for (String key : queryStringValues.keySet()){ queryStringParts.add(key + "=" + URLEncoder.encode(queryStringValues.get(key))); } if (queryStringParts.size() > 0) { urlAsString += "?" + String.join("&", queryStringParts); } URL url = new URL(urlAsString); HttpURLConnection httpRequest = (HttpURLConnection) url.openConnection(); for (String key : headers.keySet()){ httpRequest.setRequestProperty(key, headers.get(key)); } httpRequest.setRequestMethod("PUT"); httpRequest.setRequestProperty("Content-Type", "application/json"); httpRequest.setDoOutput(true); OutputStream outputStream = httpRequest.getOutputStream(); OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, "UTF-8"); outputStreamWriter.write(body); outputStreamWriter.flush(); outputStreamWriter.close(); outputStream.close(); httpRequest.connect(); BufferedReader in = new BufferedReader(new InputStreamReader(httpRequest.getInputStream())); String inputLine; StringBuffer content = new StringBuffer(); while ((inputLine = in.readLine()) != null) { content.append(inputLine); } in.close(); int status = httpRequest.getResponseCode(); httpRequest.disconnect(); System.out.println("Response Status: " + String.valueOf(status)); System.out.println("Response Body: " + content.toString()); } catch (MalformedURLException ex) { System.out.println("URL provided not valid"); } catch (IOException ex) { System.out.println("Error reading HTTP connection" + ex.toString()); throw ex; } } }
<?php //#region Parameters $baseUrl = 'https://api.etrusted.com'; $id = null; // Change me! $headers = array( "Authorization" => null, // Change me! ); // Change me! $body = json_decode('{ "name": "my_example_channel", "address": "Anystr. 17, 12345, Anycity, Anystate 12345", "url": "https://wwww.myshop.fiction", "logoUrl": "https://wwww.myshop.fiction/logo.png", "locale": "en_US" }'); //#endregion $url = "$baseUrl/channels/$id"; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_POSTFIELDS => json_encode($body), CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: " . $headers["Authorization"], ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
import http.client import json from urllib.parse import urlparse query_string_parameters = { } route_parameters = { 'id': '', # Change me! } headers = { 'Content-Type': 'application/json' 'Authorization': '', # Change me! } url_as_string = 'https://api.etrusted.com/channels/{id}'.format(**{ **query_string_parameters, **route_parameters }) payload = '' payload = json.dumps({ "name": "my_example_channel", "address": "Anystr. 17, 12345, Anycity, Anystate 12345", "url": "https://wwww.myshop.fiction", "logoUrl": "https://wwww.myshop.fiction/logo.png", "locale": "en_US" }) url = urlparse(url_as_string) http_client = http.client.HTTPSConnection(url.netloc) http_client.request("PUT", url_as_string, payload, headers) response = http_client.getresponse() data = response.read() print(data.decode("utf-8"))
curl 'https://api.etrusted.com/channels/{id}' \ --request PUT \ --data-raw '{ "name": "my_example_channel", "address": "Anystr. 17, 12345, Anycity, Anystate 12345", "url": "https://wwww.myshop.fiction", "logoUrl": "https://wwww.myshop.fiction/logo.png", "locale": "en_US" }' \ --header 'Content-Type: application/json' \ --header 'Authorization: value' \ --location

      <?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.etrusted.com/channels/{id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => '{
    "name": "my_example_channel",
    "address": "Anystr. 17, 12345, Anycity, Anystate 12345",
    "url": "https://wwww.myshop.fiction",
    "logoUrl": "https://wwww.myshop.fiction/logo.png",
    "locale": "en_US"
  }',
  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/{id}",
  "method": "PUT",
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer {access_token}",
    "cache-control": "no-cache",
  },
  "processData": false,
  "data": {
    "name": "my_example_channel",
    "address": "Anystr. 17, 12345, Anycity, Anystate 12345",
    "url": "https://wwww.myshop.fiction",
    "logoUrl": "https://wwww.myshop.fiction/logo.png",
    "locale": "en_US"
  }
}

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


    

      OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{" +
  "\"name\": \"my_example_channel\"," +
  "\"address\": \"Anystr. 17, 12345, Anycity, Anystate 12345\"," +
  "\"url\": \"https://wwww.myshop.fiction\"," +
  "\"logoUrl\": \"https://wwww.myshop.fiction/logo.png\"," +
  "\"locale\": \"en_US\"" +
"}" +
);

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

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


    
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

ChannelDto

Properties

id
string

The channel UUID.

createdAt
string

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

updatedAt
string

The date and time when the channel was last modified, in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ.

name
string

The name of the channel.

address
string

The address that is associated with the channel.

url
string

A URL that to a website that the channel represents.

logoUrl
string

A URL to the channel logo.

accountRef
string

A UUID as account reference.

locale
string

The locale that is associated with the channel.

UpdateChannelDto

Properties

name
string
 

The name of the channel.

address
string

The address that is associated with the channel.

url
string

A URL that to a website that the channel represents.

logoUrl
string

A URL to the channel logo.

locale
string

The locale that is associated with the channel.

ChannelResponseDto

Properties

id
string

The unique identifier for this channel object.

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.