APIs & Integrations

methnen
Member

How to check if a form has been submitted already by a visitor via the API or some other method

SOLVE

I'm trying to check via the API if a form has already been submitted by a visitor.

 

I see the UTK value in the cookies and see that I can retrieve a VID value from the API using that. 

 

I've also got the Hubspot Form ID value.

 

It seems like with those two values I should be able to check if the visitor has already filled out a given form but I'm having a bit of a trouble. Anyone able to point me in the right direction?

0 Upvotes
1 Accepted solution
methnen
Solution
Member

How to check if a form has been submitted already by a visitor via the API or some other method

SOLVE

Hey @dennisedson. I actually figured this out pretty easily.

 

The values returned when you get a contact by their token include appears to include form submissions if any exist. So the one API query is all that's really needed.

 

If there's no form submissions then they didn't submit the form. If there are you then you can loop through them easily enough and see if the form id values match up.

View solution in original post

2 Replies 2
methnen
Solution
Member

How to check if a form has been submitted already by a visitor via the API or some other method

SOLVE

Hey @dennisedson. I actually figured this out pretty easily.

 

The values returned when you get a contact by their token include appears to include form submissions if any exist. So the one API query is all that's really needed.

 

If there's no form submissions then they didn't submit the form. If there are you then you can loop through them easily enough and see if the form id values match up.

dennisedson
HubSpot Product Team
HubSpot Product Team

How to check if a form has been submitted already by a visitor via the API or some other method

SOLVE

@tjoyce , how would you go about this?

@methnen have you seen the get submissions for a form endpoint?

0 Upvotes