With the Webhook integration, you can send data from the form using both the POST and GET methods – you can choose the method that suits you best.
Set up the Webhook integration
- Log in to your Smartpages account and go to the edition of your landing page.
- Navigate to the form Settings.
- In the Integrations tab, choose Webhook.
- In the Request URL field, enter the URL to which the form data will be sent.
- In the Request method field, select the way you want to send data from the form: you can choose the GET or POST method.
- Connect the Smartpages form fields with the fields on your server.
- In the Request headers fields, set the request headers that will be sent each time the form is sent. Remember that each heading consists of two parts: key and value, e.g., API_KEY: 1234-abcd-5678, where the first field concerns key and the second value. To add headers, click +.
- In the Request parameters fields, you can set additional parameters that will be sent together with the form. Similar to headers, it consists of two parts: key and value, which should be completed. For example, if we have a form with an email field and we set one parameter source:Smartpages, then each time someone sends this form, the query will send data to the API:
To add parameters, click +. The request parameters perform almost the same function as the hidden fields in the form, but their advantage is that they are invisible from the page code.
- Save and close.
Publish your landing page and check if the integration works correctly.