Sending form with ajax recaptcha

Bent1
Participant | Elite Partner
Participant | Elite Partner

Hello,

Is it possible to send a form via ajax when the form also has a recaptcha?

      $.ajax({
          type: 'POST',
          url: 'https://api.hsforms.com/submissions/v3/integration/submit/******/******-*****-*****',
          data: JSON.stringify(data),
          dataType: 'json',
          contentType: 'application/json',
          success: function(_data) {
              console.log('HubSpot submission success', _data);
          },
          error: function(xhr, status, error) {
              console.error('HubSpot submission failed');
              console.error('Status:', status);
              console.error('Error:', error);
              console.error('Response text:', xhr.responseText);
          }
      });


This code works without Recaptcha but when enabling it on this form it will give me the error that recaptcha is not correct.

Is there a way to send the recaptcha token in this ajax post?

1 Accepted solution
evaldas
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Hi @Bent1,

 

According to an older thread, looks like Captcha is not supported on v3 endpoints:

 

https://community.hubspot.com/t5/APIs-Integrations/Forms-Api-v3-Captcha-Handling/m-p/323042/highligh...

✔️ Did this post help answer your query? Help the community by marking it as a solution.

View solution in original post

3 Replies 3
GRajput
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Hi @Bent1 

 

Hey, the captcha is not supported by the V3 endpoint, so you can skip this in the call.

 

Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


0 Upvotes
evaldas
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

What new information are you providing in this response? This was already said in the accepted solution.

✔️ Did this post help answer your query? Help the community by marking it as a solution.

evaldas
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Hi @Bent1,

 

According to an older thread, looks like Captcha is not supported on v3 endpoints:

 

https://community.hubspot.com/t5/APIs-Integrations/Forms-Api-v3-Captcha-Handling/m-p/323042/highligh...

✔️ Did this post help answer your query? Help the community by marking it as a solution.