Blocked cross-origin response in LandingPage (CORB)


Dear Hubspot Developer Team,

I'm trying to make an API request from my custom HubL in my Hubspot Template.
This is how I implemented the request:

	function check_ContactExists(vobjInput) { 
		var vobjRequest = new XMLHttpRequest();
		vobjRequest.onreadystatechange = function() {
			if (this.readyState == 4 && this.status == 200) {
			var vobjResponse = JSON.parse(this.responseText);
				if (vobjResponse.status == "error"){
				  alert('Contact does not exists!');
				  alert('Contact exists: ' + vobjResponse.vid);
		};"GET", "", true);

But now I keep getting this error message:
Cross-Origin Read Blocking (CORB) blocked cross-origin response with MIME type application/json. See for more details.

What can I do to retrieve the response?

Kind regards


Welcome, @sfis!

At this time, the Contacts API does not support cross-origin (CORS) requests because they would expose authentication to anyone browsing your site.

To check the existence of a contact, you must first make a request to an external server that could then add the needed authentication (whether API key or OAuth token) to this Contacts API endpoint server-side.