Do HubSpot APIs support CORS / AJAX requests? I am getting error while calling ajax call


I would like to get blog details of your website through ajax call but I am getting “Uncaught SyntaxError: Unexpected identifier” please address it as soon as possible.
dataType: “jsonp”,
success: function (data) {} });

404 Error from external POST to Forms API

@nagavalli We do not support CORS requests. All requests must be made server-side


1.when we request blog data in Hubspot it is working fine where as we publish that module on our page it raising Allow Origin Access error, our blogs total content working only through HubSpot. our requirement is we want to pull our blog data through Hubspot to our site.

2.Is Hubspot support c# coding can we write c# code if yes where we have to add that data.

3.If we want to pull all Blog related JSON data to your site what are the different alternatives.




  1. How are you publishing it onto your page. Are you making a Frond-End request?

  2. HubSpot does not support adding any sort of server-side code to it.

  3. Do you mean pulling data from our site? The only option is to do it through the API.



  1. our company have Hubspot Marketing and sales account through that they will publish the Blogs website in this website total Blogs and resources are completely handled by Hubspot.

our requirement is we have to pull blogs data based on the topicId we have to give one popup based on topicId.



@nagavalli You won’t be able to pull the actual Blog data through the API. If you want to pull a blog you can use this endpoint here:

This won’t return the analytics for you.

You can get some information about a specific topic from here:


@nagavalli This is a developer’s forum and not a support forum. We don’t offer phone support through this medium.


Ok thanks,
Actually, we are getting complete JSON data using URL*****, through this URL but when we publish that Module to Pixentia website it through an uncaught syntax error unexpected token for blogs data.
when we run the same code in Hubspot it is working fine.Issue after we publish that data.


@nagavalli Are you trying to move one blog from one HubSpot account to a different HubSpot account? Where is your Pixentia website hosted? If it isn’t hosted on HubSpot the page where you are trying to push it to, the syntax error could be that the other system wouldn’t understand HubL which is our templating language.


No, we are not moving data from one account to another account we are creating Modules and simply publishing that modules on our site.

after publishing it automatically reflect in Pixentia.


@nagavalli You are going to run into some code issues as our modules are wrapped in HubL which is a proprietary templating language. You will need to change/edit the code a bit so it will be compatible with Pixentia.

<div class="modal">
<div class="modal-close-outer">
	<div class="modal-close">X</div>
<div class="Test_Modal"></div>

this is what I write in Module it is working pretty good in Hubspot but after publish it is not working in Pixentia site.


Does that part actually work for you? We don’t allow Front-End requests to our APIs and require server-side requests. I’m surprised you are getting a blog properly returned to you with that.


yes, I am getting complete Blog data at the console in Hubspot. with API key.


In the console do you see any HubL? It would look similar to Jinja. The browser would not be able to render this and that is why you are receiving that error.


@pmanca, I am stuck with similar issue, My motive is simple to get data from crm, using hubspot api,

I did try to use ajax, dataType: “json”,

dataType: “json”,

success: function(data) {
// console.log(data);
error: function() {
// alert();


Result I got cross origin error :slight_smile:
Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response.

  1. I used datatype : jsonp

type: “GET”,

dataType: "jsonp",
jsonp: "callback",
 crossOrigin: true,
jsonpCallback: "my_callback",
 url: "",
headers:{"Content-Type":"text/html; charset=utf-8"},
success: function(data) {
error: function() {

Result : I got error
“Uncaught SyntaxError: Unexpected token : ”

------------------------------------------------------ its been like 3 days to figure outo some thing

On our blog pages we need to pull data from crm, contact details, and on basis of these details we need to create blog post dynamically;

@nagavalli @pmanca , we do get data on console,

why you have

if we can’t use it, I need to pull user data, by making call to crm

being on same domain it dosen’t help::


@ume.a We only support server-side requests. Client-side requests aren’t typically allowed and if you see it in the browser console it is not by design.


An easy way I have found to make requests to the API is using Google App Engine. It’s free to use on the first tier and it’s very easy to set up an endpoint that makes requests to the API. I am using the Java API for this so I don’t know what languages you’re fimiliar with but that has proven to be the cheapest and easiest way to avoid CORS errors. IME most APIs do not support cross origin requests so this is a helpful method to use with any API. This method also adds a layer of security to your API key as you can let the server only take requests from whitelisted URLs.



I have to say that yesterday I was able to send request via CORS to the API successfully. though I got an error in the console (chrome), but in the response I got all the data (in my case contact information). And also I was able to manipulate contact properties via post and CORS.

I think this shouldn’t be possible?

Kind regards, Oliver


Can you share how you got this to work? I just built a script to bulk change several blogs, only to find out that CORS wasn't viable.