Authentication
header to authenticate, add an authorization header to your api request that contains an api key (see below) we are using basic authentication https //developer mozilla org/en us/docs/web/http/headers/authorization#basic authentication so you need to construct the credentials first combining any string as first value and the password (your api key) with a colon then encode the string base64 https //developer mozilla org/en us/docs/glossary/base64 api key an api key can be generated in your trust account example private void getauthenticationheader(httpclient client) { var bytearray = encoding ascii getbytes("dummy" + " " + apikey); client defaultrequestheaders authorization = new authenticationheadervalue("basic", convert tobase64string(bytearray)); } let http = require('http'); const host = "https //api usetrust app/v1/testimonial/all/c2cd39b7 239c 4455 a4e6 aa5879a1e858"; let request = http request({'hostname' host', 'auth' 'dummy ' + apikey }, function (response) { console log('status ' + response statuscode); console log('headers ' + json stringify(response headers)); response setencoding('utf8'); response on('data', function (chunk) { console log('body ' + chunk); }); }); request end(); let request = require('request'); const username = "dummy"; const password = apikey; const auth = "basic " + new buffer(username + " " + password) tostring("base64"); const url = "https //api usetrust app/v1/testimonial/all/c2cd39b7 239c 4455 a4e6 aa5879a1e858"; request get( { url url, headers { "authorization" auth } }, function(error, response, body) { console log('body ', body); } );