APIs & Integrations

umeshnevase
Member

How to do subscription by ajax and auth2.0 without redirection

I've created custom form for user subscription. On submitting the form, I'm sending email to Hubspot API with ajax, It is working for me with Hapikey, but I want use Auth2.0 for same functionality, but in Auth2.0, as per this guid https://developers.hubspot.com/docs/methods/oauth2/oauth2-quickstart , it will Hubspot will return a consent window. How can I show this window on ajax request and again pass request to for token in single ajax request.  

0 Upvotes
3 Replies 3
cbarley
HubSpot Alumni
HubSpot Alumni

How to do subscription by ajax and auth2.0 without redirection

Hi @umeshnevase , this wouldn't be possible as we must redirect to the HubSpot page in order for folks to authorize your application against their account. 

0 Upvotes
umeshnevase
Member

How to do subscription by ajax and auth2.0 without redirection

Is there any way, that I can send subscription from client side by API to hubspot by ajax, 

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

How to do subscription by ajax and auth2.0 without redirection

Hi @umeshnevase , our APIs mostly do not support CORS/AJAX requests, so that wouldn't be possible https://developers.hubspot.com/docs/faq/do-hubspot-apis-support-ajax-request

0 Upvotes