How to integrate REST calls securely in a Custom Module?

Mark1
Contributor

I'd like to pull in information from another 3rd party system into our custom page templates/custom modules using API calls.

 

The 3rd party system has extensive API's and authentication using API keys but this is not an available option using client side Javascript (server side calls only for security reasons). 

 

Can anyone suggest a way of doing this inside of HubSpot?  I'm open to all ideas!

 

NB: The HubSpot page that will be displaying the 3rd part data is secured using HubSpot Private Registration if that makes any difference.

 

Thanks in advance.

0 Upvotes
2 Replies 2
stefen
Key Advisor | Partner

@Mark1 I wrote a blog post about ways of doing this while keeping the majority of the code in HubSpot. It does require a server outside of HubSpot unfortunately: https://www.kelp.agency/blog/how-to-enable-cors-ajax-requests-for-any-hubspot-api

Stefen Phelps, Community Champion, Kelp Web Developer
0 Upvotes
Mark1
Contributor

Thanks Stefen, I guess the key here in terms of security is only allowing calls from our own HubSpot domain (or IP range). 

 

All of the API's for the 3rd party (it's actually us but a different app) are actually hosted on a server we manage so no problem there. 

 

It would be nice to be able to make server side API calls from HubSpot and have the data delivered to the client. 

 

This is a solution that could work for us. What else are people doing?

 

 

0 Upvotes