• Créditos da HubSpot: Desbloqueie ferramentas poderosas para o crescimento

    Dúvidas?

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

Sadat
Colaborador(a)

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 Avaliação positiva
1 Solução aceita
Josh
Solução
Especialista reconhecido(a) | Parceiro Diamante
Especialista reconhecido(a) | Parceiro Diamante

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

Exibir solução no post original

1 Resposta 1
Josh
Solução
Especialista reconhecido(a) | Parceiro Diamante
Especialista reconhecido(a) | Parceiro Diamante

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