I am wondering if anyone might possibly have any kind of reference, or specific code example that may help me with the road block I have found myself in. I am attempting to integrate DLS World Ship so we can be able to send the process shipment file, without having to copy/paste information into their ship software.
Unfortunately, the API call has to be done in backend code, as when it is sent from JAVASCRIPT, I get the cors error.
Here is the JS outbound API call I have:
var RateRequestViewModel = {
};
var jsonURL ="https://dlsworldwideproxy-dev.rrd.com/services/api/v1/RateShop/RateRequest";
$.ajax({
type:"POST",
data:JSON.stringify(RateRequestViewModel),
contentType:"application/json",
url:jsonURL,
beforeSend: function (request) {
request.setRequestHeader("UserName", "Example Company Inc.");
request.setRequestHeader('ApiKey',"insertAPIkeyhere");
},
success:function(data)
{
}
});
If anyone has any suggestions, or any kind of reference to get me out of this roadblock, it would be much appreciated!