I’m working on a project where I need to check if a user-entered email exists in the submissions of a specific HubSpot form. Currently, my approach involves fetching all the form submissions and validating the entered email against the retrieved data. However, this method takes too long to respond.
Is there an API call that allows me to pass the user email directly in the URL and validate it efficiently, instead of fetching all the submissions?
Hey, @Boomika I don’t have “the” solution. But I do have some clarifying questions
are you querying “all” forms each time? Or only a specific form?
do you need additional contact information beyond knowing if the email exists in submissions?
what is the current response time for your queries? What would be an acceptable or “better” response time?
Without knowing more details, my back of the napkin approach might be:
Query the Search API to verify if the contact exists
If yes, then search the specific Form for submissions
The other option you can explore is seeing if you can do this via GraphQL. This would (requires testing) be the only way to make these requests in a single unified call. Otherwise, we’ll need an approach like what you are already doing — some combination of at least two calls.
Hey Jaycee,
Thanks for the questions!
I’m fetching data from a specific form only, and I don’t need any
additional contact information—just verifying if the email exists in
submissions. Currently, the response time is around a minute since I’m
dealing with ~2 lakh records, but I’m hoping to bring it down to just a
few seconds.
I agree that searching the contacts for the email first and then fetching
form submissions sounds promising, especially when the email doesn’t
exist. However, in cases where the email does exist, this approach would
involve two API calls, which might actually increase the response time
further.
Let me know if you’ve encountered a more efficient workaround!