Reputation: 971
I'm trying to call the Marketo API and I keep getting this error:
net::ERR_NAME_NOT_RESOLVED
This is the function I'm using
var marketoAPIcallURL = 'https://182-EMG-811.mktorest.com/rest/v1/';
var apiToCall = 'lead/182.json';
var accessToken = '?access_token=8a385a92-4a87-4e89-9eda-xxxxxxxxxxxx:ab';
//
console.log(marketoAPIcallURL);
marketoAPIcallURL += apiToCall;
console.log(marketoAPIcallURL);
marketoAPIcallURL += accessToken;
console.log(marketoAPIcallURL);
//
function callMarketoV3() {
console.log('API CALL HAS BEGUN');
console.log(marketoAPIcallURL);
$.ajax({
url: marketoAPIcallURL,
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
console.log(data);
}
});
}
Does anyone has any idea what the problem may be?
Upvotes: 0
Views: 166
Reputation: 111
your ajax type is also set to "POST" but the get lead by ID is a GET method. But kelkington is right, your address is wrong.
http://developers.marketo.com/documentation/rest/get-lead-by-id/
Upvotes: 1
Reputation: 411
Your hostname can't be resolved by your client. It looks that domain isn't valid, so there may be an issue with your subscription, or your subscription may not have the API included. You probably want to have you or your admin file a support ticket.
Upvotes: 1