Discussions
Noobie Question: Authentican Failure
6 months ago by James Kepler
Sorry for being a noobie here, have a question:
Connecting our Salesforce Org to etherFax via the REST API...first, we reach out to the base endpoint to see if the port is alive and get a good response. Next, we authenticate using my credentials BASE64 encoded with a good response of 200. Then, just to start building out I attempt to make a GET to the /accounts at:
08:02:40.1 (200902223)|USER_DEBUG|[209]|DEBUG|[ETHERFAX006I] -> con_ETHERFAXHTTPAPIENDPOINT=https://na.connect.etherfax.net/rest/3.0/api/accounts
...adding the Authentication header to which my credentials are denied (401). I also tried the /accounts interactive test snippet in the API Library and it too, denied my credentials. Is there something extra that is required for developers?
public static String accounts(Boolean bol_etherFaxDebugFlag)
{
String accounts = '';
Http http = new Http();
HttpRequest httprequest = new HttpRequest();
httprequest.setMethod('GET');
httprequest.setHeader('Accept','application/json');
httprequest.setHeader('Authorization', str_httpauthorizationHeader);
httprequest.setEndpoint(con_ETHERFAXHTTPAPIENDPOINT + '/accounts');
if (bol_etherFaxDebugFlag)
EtherFaxDebugMessage('006', 'I', 'con_ETHERFAXHTTPAPIENDPOINT=' + con_ETHERFAXHTTPAPIENDPOINT + '/accounts');
HttpResponse httpresponse = http.send(httprequest);
int_HTTPResponseCode = httpresponse.getStatusCode();
Thanks for the help in advance!
James Kepler - PenServ Plan Services, Columbia SC