APIs & Integrations

avolk
Participant

Forms Api - Captcha Handling

SOLVE

I am currently using the v2 Forms API, but ran into an issue where forms with captcha enabled returns an error.

Switching to v3 does not seem to return an error if captcha is enabled – which is good – but, since captcha handing is not mentioned in either the v2 or v3 documentation I'm not sure if this is what's intended.

I am hoping to get confirmation that this is the intended result and it will not break in the future. Any information would be helpful.

Thanks!

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Forms Api - Captcha Handling

SOLVE

Hey, @Adam_Volkman.

I've only found one other topic reporting reCAPTCHA issues with the v2 Forms API. Does this sound like the issue you encountered? If so, what error was returned? Can you send me a link to the HubSpot form you were testing?

I don't have specific insight into reCAPTCHA-related support in the v3 Forms API, but it was designed to be more flexible and powerful than the second version. Since it's in stable release, I can confirm the team doesn't plan to make any major updates to it, so the behavior you're seeing should not change in the future.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
5 Replies 5
IsaacTakushi
HubSpot Employee
HubSpot Employee

Forms Api - Captcha Handling

SOLVE

Thanks for the feedback, @Adam_Volkman! This is super helpful. We're actually in the middle of auditing all of our developer documentation so I will make a note to have reCAPTCHA mentioned (I personally never knew this v2 restriction existed).

Isaac Takushi

Associate Certification Manager
0 Upvotes
mdare_usablenet
Member

Forms Api - Captcha Handling

SOLVE

Hello,

I tried to upgrade to v3 but I still received the reCAPTCHA error message by API

errors": [
    {
      "message": "Form '********' can't receive API submissions as Captcha (SPAM prevention) is enabled.",
      "errorType": "FORM_HAS_RECAPTCHA_ENABLED"
    }
  ],

By the previous comments, I understood the v3 works with reCAPTCHA enabled but I don't know what I wrong. Could you help me?

 

URL https://api.hsforms.com/submissions/v3/integration/submit/:***/:***

BODY:

{
  "submittedAt": "1582798776000",
  "skipValidation": true,
  "fields": [
    {
      "name": "firstname",
      "value": "test"
    },
    {
      "name": "lastname",
      "value": "test"
    },
    {
      "name": "company",
      "value": "Test"
    },
    {
      "name": "email",
      "value": "****"
    }
  ],
  "context": {
	"hutk": "***********",
        "pageUri": "test.com",
        "pageName": "test page",
"ipAddress": "**.**.**.**" } }

Thanks,

Marco

soydiaz
Participant | Elite Partner
Participant | Elite Partner

Forms Api - Captcha Handling

SOLVE

I have the same problem, I have tried to migrate to v3, but it returns the following message.

 

"can't receive API submissions as Captcha (SPAM prevention) is enabled.",
"errorType": "FORM_HAS_RECAPTCHA_ENABLED"

0 Upvotes
avolk
Participant

Forms Api - Captcha Handling

SOLVE

Thanks @Isaac_Takushi.

Yes, that appears to be the same issue we ran into. Sorry for the lack of detail - I was mostly concerned with the new api. Here is the html response we received when trying to submit to a form with reCAPTCHA enabled.

It appears there's no support for this, since it says "If you've manually integrated this form, please turn off reCaptcha". If that's the case, it's fine, but I would recommend noting this restriction somewhere in the api documentation. It could help avoid some confusion for developers in the future.

Upgrading to the v3 Api works for us as a solution and I'm glad to hear it should continue to work with reCAPTCHA enabled forms. Again, it would be helpful to note in the docs that reCAPTCHA will be ignored for api submissions (or however the api handles it). When working with APIs it's not ideal to have to make assumptions, since it can come back to bite you – as it did for us :sweat_smile:

Thanks again for your help!

IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Forms Api - Captcha Handling

SOLVE

Hey, @Adam_Volkman.

I've only found one other topic reporting reCAPTCHA issues with the v2 Forms API. Does this sound like the issue you encountered? If so, what error was returned? Can you send me a link to the HubSpot form you were testing?

I don't have specific insight into reCAPTCHA-related support in the v3 Forms API, but it was designed to be more flexible and powerful than the second version. Since it's in stable release, I can confirm the team doesn't plan to make any major updates to it, so the behavior you're seeing should not change in the future.

Isaac Takushi

Associate Certification Manager
0 Upvotes