Form implementation, webhooks, and check conditional

DanielDPAltra
Participant

Okay, i'm about to loose my mind :), I'm stuck on this points:

Things required :

Create a form, check the result after submit by a request to my API, give a response: Conditional: if my API returns true(finds a input requested in the form in our database) redirect the user to another form. if the user input is not found on the database, redirect the user to other url. Done.

  1. I already created a form from hubspot developer test,  in the marketing section. * (I dont know if its possible to create one by my own by coding it on php) *. So gues its done this part.
  2. Creating the conditional. But i dont know how it really works. I didn't found any option from hubspot that offers a API request. I thought there were differents ways to do this:
    1. When form submitted: Take the info from a webhook, and then do the stuff on the API, give a response. I don't know how would it be posssible to insert this on the workflow of the form. And then check the result of the API and do the conditional stuff.
    2. Second thought, I am missing the way to do this.
  3. Redirect the user to another form, or another url, deppends on how the 2º step is done.

Please, I would really appreciate the help. Text me if some information is missing.

DanielDPAltra_0-1734529365049.pngDanielDPAltra_1-1734529457429.png

 

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

Hi @DanielDPAltra,

 

To answer your first question:

 

I already created a form from hubspot developer test,  in the marketing section. * (I dont know if its possible to create one by my own by coding it on php) *

 

It is possible to create forms via API by using the Forms API Create endpoint (/marketing/v3/forms/).

 

https://api.hubapi.com/marketing/v3/forms/

 

There are instructions for PHP:

 

evaldas_0-1734535288217.png

 

 

 

In order to allow form submission via the API, you can use the Form Submission API.

 

https://api.hsforms.com/submissions/v3/integration/secure/submit/:portalId/:formGuid

 

When the user submits the form, they redirect should happen based on what you set up in the form.

 

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

View solution in original post

0 Upvotes
2 Replies 2
evaldas
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Hi @DanielDPAltra,

 

To answer your first question:

 

I already created a form from hubspot developer test,  in the marketing section. * (I dont know if its possible to create one by my own by coding it on php) *

 

It is possible to create forms via API by using the Forms API Create endpoint (/marketing/v3/forms/).

 

https://api.hubapi.com/marketing/v3/forms/

 

There are instructions for PHP:

 

evaldas_0-1734535288217.png

 

 

 

In order to allow form submission via the API, you can use the Form Submission API.

 

https://api.hsforms.com/submissions/v3/integration/secure/submit/:portalId/:formGuid

 

When the user submits the form, they redirect should happen based on what you set up in the form.

 

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

0 Upvotes
DanielDPAltra
Participant

If I wanted like the Standalone page, I would create myself an endpoint to the form created, the final thing is an url for the user.

I found that what you sent me but I read it carefully now jaja, I suposse the nervs of the firsts days.

Thanks you! I'll try, hope not asking agayn for help. but great work what you are doing daily guys, answering questions of plp.

Have a nice day!