Is It Possible to Make API Endpoint Calls from a Front-End?

Sadat
Contributeur

This is more of a sanity check than anything else. We're trying to reduce our public app's architecture complexity as much as possible.

Taking into consideration the OAuth flow required to make requests to HubSpot's API endpoints, is it possible in any way to make a request directly from a static front-end (no server involved)? Or do the OAuth flow and the CORS limitations always prevent that?

0 Votes
1 Solution acceptée
Josh
Solution
Expert reconnu | Partenaire solutions Diamond
Expert reconnu | Partenaire solutions Diamond

Hi @Sadat,

 

I think you're right. The CORS limitations would prevent that. You’ll need a server-side component to handle the token exchange and work around the CORS requirements by acting as a go-between for your API calls.

 

Josh

 

 


Did this post help solve your problem? If so, please mark it as a solution.

Josh Curcio

HubSpot support and inbound marketing for OEMs, contract manufacturers, and industrial suppliers.
HubSpot Diamond Partner & HubSpot Certified Trainer

Voir la solution dans l'envoi d'origine

1 Réponse 1
Josh
Solution
Expert reconnu | Partenaire solutions Diamond
Expert reconnu | Partenaire solutions Diamond

Hi @Sadat,

 

I think you're right. The CORS limitations would prevent that. You’ll need a server-side component to handle the token exchange and work around the CORS requirements by acting as a go-between for your API calls.

 

Josh

 

 


Did this post help solve your problem? If so, please mark it as a solution.

Josh Curcio

HubSpot support and inbound marketing for OEMs, contract manufacturers, and industrial suppliers.
HubSpot Diamond Partner & HubSpot Certified Trainer