Hi all,
I have the below code ,which
var str = 'esendextest1@gmail.com' + ':' + 'login1234'; logInfo(Base64.encode(str));
var str1 = Base64.encode(str); logInfo('str1:'+ str1);
var url = 'https://api.esendex.com/v1.0/messageheaders';
var send1 = 'https://api.esendex.com/v1.0/messageheadersfilterBy=account&filterValue=EX0228368'+ str1 ;
logInfo('send1:'+ send1);
var http = new HttpClientRequest(send1);
http.method = "GET";
http.header["Content-Type"] = "application/json";
http.header["Accept"] = "application/json";
logInfo('After TRY');
http.execute();
var response = http.response;
logInfo(response.code);
I am trying to get the status of messages which have been sent.However i am getting the error code 401.
Any ideas on this ?
Regards
Shiva
str1 should be set as a Basic Auth header.
Instead of appending Base64.encode('esendextest1@gmail.com' + ':' + 'login1234') to the URL, you should set the header...
Try adding:
http.header["Authorization"] = "Basic ZXNlbmRleHRlc3QxQGdtYWlsLmNvbTpsb2dpbjEyMzQ=";
User | Count |
---|---|
5 | |
2 | |
2 | |
1 | |
1 |