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

Sadat
投稿者

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 いいね!
1件の承認済みベストアンサー
Josh
解決策
名誉エキスパート | Platinum Partner
名誉エキスパート | Platinum Partner

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

元の投稿で解決策を見る

1件の返信 1
Josh
解決策
名誉エキスパート | Platinum Partner
名誉エキスパート | Platinum Partner

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