I'm trying to call the Marketo API and I'm 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 have an idea what the problem is?
that host name does not exist - i changed the first couple of numbers to 182.
why doesn't this work - could this work with node.js? If not - what method would I use to make this happen?
that host name does not exist - i changed the first couple of numbers to 182.
You changed the hostname and wondered why it was giving ERR_NAME_NOT_RESOLVED?
why doesn't this work - could this work with node.js? If not - what method would I use to make this happen?
I have no idea what you're trying to accomplish. Please explain the project goals.
In any case, the REST API should be used for bulk operations, or singleton operations whose volume is strictly controlled by the back end that is using them. It must not be used for uncontrolled singleton operations, such as making API calls in response to individual user web actions. Also, for technical reasons (same origin policy) you can't use the REST API via direct HTTP requests from a browser.
we want to have a landing page that can display data from the API. We want to personalize the landing page content to that it reflects who the user is. If there is no content related the user - we'll just render generic content. We could just use cookies - but it'll be a hosted outside of Marketo. Boss man already told me it wouldn't work - but he's not a day to day programmer - so I thought it would work. I use node as a backend - my company uses .net soooo - I guess I have my answer.
Yep, the answer is this isn't a safe/practical/secure application for the Marketo API.
I encourage the use of Marketo-hosted Landing Pages. They don't have to be built within Marketo, just imported. But being on the Marketo platform gives them a lot of leverage with the Marketo database.