{"id":506,"date":"2019-03-20T15:12:29","date_gmt":"2019-03-20T15:12:29","guid":{"rendered":"https:\/\/bookingwithoverture.com\/blog\/?p=506"},"modified":"2019-07-10T12:14:39","modified_gmt":"2019-07-10T12:14:39","slug":"web-form-api","status":"publish","type":"post","link":"https:\/\/bookingwithoverture.com\/blog\/web-form-api\/","title":{"rendered":"Web Form API"},"content":{"rendered":"<p>Overture allows you to post information from a form on your website to create contacts and bookings.<\/p>\n<p>This article shows you how to setup Overture to allow access to the API, setting up an example form and including a list of all the fields available for you to send data to.<\/p>\n<p>Inside your Overture account, as an admin user, head over to your settings and in the sidebar look for the \u2018Custom Web Form\u2019 option. To begin the process, you will need to generate a web form key, click on the \u2018Generate Key\u2019 button.<\/p>\n<p>This key will need to be included somewhere in your form inside the name attribute of a hidden input field as the example shows below.<\/p>\n<p>Example form first steps \u2013 Adding the key and setting the form action<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;form method=&quot;post&quot; action=&quot;https:\/\/overturehq.com\/formapi\/webform\/submit.json&quot;&gt;\n  &lt;label&gt;Name:&lt;\/label&gt;\n&lt;input type=&quot;text&quot; name=&quot;personName&quot;&gt;\n&lt;label&gt;Email Address:&lt;\/label&gt;\n&lt;input type=&quot;text&quot; name=&quot;personEmailWork&quot;&gt;\n&lt;label&gt;Phone Number:&lt;\/label&gt;\n&lt;input type=&quot;text&quot; name=&quot;personPhoneWork&quot;&gt;\n&lt;label&gt;Event Date:&lt;\/label&gt;\n&lt;input type=&quot;text&quot; name=&quot;Date&quot;&gt;\n&lt;label&gt;What would you like to discuss with us?&lt;\/label&gt;\n&lt;textarea name=&quot;personNote&quot;&gt;&lt;\/textarea&gt;\n&lt;input type=&quot;submit&quot; value=&quot;Send Enquiry&quot;&gt;\n&lt;input type=&quot;hidden&quot; name=&quot;key&quot; value=&quot;Mzk4MzkwMTQxNjM=&quot;&gt;\n&lt;\/form&gt;<\/pre>\n<p>In the example form please note the Overture URL added as the action the form must post to.<\/p>\n<p>You will also need to setup a referrer inside Overture to tell Overture where you will be posting the data from. To do this head back to your Overture settings and click on the \u2018Add Field\u2019 button and enter the URL of where the form will be sending the information from.<\/p>\n<p>You can now go ahead and build out the rest of your form from the fields listed below as the name attribute inside the form inputs.<\/p>\n<p><strong>Fields available<\/strong><\/p>\n<p><strong>Contacts<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&#039;personName&#039;\n&#039;personFirstName&#039;\n&#039;personLastName&#039;\n&#039;personEmailWork&#039;\n&#039;personEmailPersonal&#039;\n&#039;personPhoneWork&#039;\n&#039;personPhonePersonal&#039;\n&#039;personWebsiteWork&#039;\n&#039;personWebsitePersonal&#039;\n&#039;personAddressLine1&#039;\n&#039;personAddressLine2&#039;\n&#039;personAddressLine3&#039;\n&#039;personAddressCity&#039;\n&#039;personAddressState&#039;\n&#039;personAddressZip&#039;\n&#039;personAddressCountry&#039;\n&#039;personNote&#039;\n&#039;companyName&#039;\n&#039;companyEmailWork&#039;\n&#039;companyPhoneWork&#039;\n&#039;companyWebsiteWork&#039;\n&#039;companyAddressLine1&#039;\n&#039;companyAddressLine2&#039;\n&#039;companyAddressLine3&#039;\n&#039;companyAddressCity&#039;\n&#039;companyAddressState&#039;\n&#039;companyAddressZip&#039;\n&#039;companyAddressCountry&#039;\n<\/pre>\n<p><strong>Bookings<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&#039;booking1Date&#039;\n&#039;booking1Name&#039;\n&#039;booking1Note&#039;\n&#039;booking1ArtisteName&#039;\n&#039;booking1VenueName&#039;\n&#039;booking1VenueAddressLine1&#039;\n&#039;booking1VenueAddressLine2&#039;\n&#039;booking1VenueAddressLine3&#039;\n&#039;booking1VenueAddressCity&#039;\n&#039;booking1VenueAddressState&#039;\n&#039;booking1VenueAddressZip&#039;\n&#039;booking1VenueAddressCountry&#039;\n<\/pre>\n<p><strong>Key<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&#039;key&#039; - Required in the value attribute of a hidden input field\n<\/pre>\n<p>You can also target Overture\u2019s further information fields on a booking. To do this, you first need to make sure that those fields are available by setting them up in a default further information block in your Overture booking settings.<\/p>\n<p>In the example here I have setup a new block called Enquiry and added a few example fields from the form I have created, in this instance \u2018Guests\u2019 and \u2018Budget\u2019.<\/p>\n<p>It\u2019s best to keep these field names short since they will form part of the name attribute in the HTML.<\/p>\n<p>Once setup inside Overture head over to your webform and add a label with a \u2018for\u2019 attribute of<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\nbooking1Info-Name_Of_Field\n<\/pre>\n<p>And a related form field with a matching name<\/p>\n<p>For example\u2026<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;fieldset class=&quot;event-further-information&quot;&gt;\n  &lt;label for=&quot;booking1Info-Budget&quot;&gt;Rough idea of budget?&lt;\/label&gt;\n&lt;input type=&quot;text&quot; id=&quot;budget&quot; name=&quot;booking1Info-Budget&quot;&gt;&lt;\/fieldset&gt;\n<\/pre>\n<p>You can add as many of these fields as required as long as they have a related field inside the Overture Bookings Settings.<\/p>\n<p>Sending data to booking further information fields allows you to send data that doesn\u2019t fit the standard Overture fields if you have information that is related to the contact name of the person submitting the form we recommend that you use person note to submit that data.<\/p>\n<p>The endpoint will respond with JSON encoded data.  We recommend that the form is submitted asynchronously, below is an example of how that might be done using jQuery and the jQuery form plugin..<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\n\/\/ Form to submit via ajax.\n$(&quot;form&quot;).ajaxForm({\n&quot;clearForm&quot;: false,\n&quot;resetForm&quot;: true,\n&quot;beforeSubmit&quot;: function() {\n},\n&quot;success&quot;: function(json) {\nif (json.success == true)\n{\n\/\/ Form has submitted successfully.\nalert(&quot;Thank you for getting in touch.&quot;);\n} else {\nfor (name in json.errors) {\n$(&quot;form&quot;).find(&quot;&#x5B;name$=&#039;&quot; + json.errors&#x5B;name] + &quot;&#039;]&quot;).css(&quot;border-color&quot;, &quot;red&quot;);\n};\n};\n},\n&quot;error&quot;: function() {}\n});\n<\/pre>\n<p><strong>Squarespace and WordPress<\/strong><\/p>\n<p>If you are designing a website for a client in Squarespace and are unsure how to use the Overture webform API here is an example file that has all the necessary HTML, JS and CSS to get a form up and running. You only need to change the fields where required to match the form your client would like.<\/p>\n<p><a href=\"https:\/\/bookingwithoverture.com\/blog\/wp-content\/uploads\/2019\/03\/overture-web-form-example.zip\">Download example HTML.<\/a><\/p>\n<p>You can copy and paste this code directly into the \u2018add code\u2019 to a page section on a Squarespace template.<\/p>\n<p>For WordPress there are many form plugins that allow you to directly edit the form HTML adding the name attributes where required. For example, the Advanced Forms plugin should allow all the required integration requirements to be met<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overture allows you to post information from a form on your website to create contacts and bookings. This article shows you how to setup Overture to allow access to the API, setting up an example form and including a list of all the fields available for you to send data to. Inside your Overture account,<\/p>\n<div><a class=\"moretag btn btn-wire\" href=\"https:\/\/bookingwithoverture.com\/blog\/web-form-api\/\">Read the full article<\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Web Form API - Overture | Blog","description":"Overture allows you to post information from a form on your website to create contacts and bookings. This article shows you how to setup Overture to allow acces"},"footnotes":""},"categories":[2,1],"tags":[],"class_list":["post-506","post","type-post","status-publish","format-standard","hentry","category-benefits","category-product-news"],"_links":{"self":[{"href":"https:\/\/bookingwithoverture.com\/blog\/wp-json\/wp\/v2\/posts\/506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bookingwithoverture.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bookingwithoverture.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bookingwithoverture.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bookingwithoverture.com\/blog\/wp-json\/wp\/v2\/comments?post=506"}],"version-history":[{"count":18,"href":"https:\/\/bookingwithoverture.com\/blog\/wp-json\/wp\/v2\/posts\/506\/revisions"}],"predecessor-version":[{"id":590,"href":"https:\/\/bookingwithoverture.com\/blog\/wp-json\/wp\/v2\/posts\/506\/revisions\/590"}],"wp:attachment":[{"href":"https:\/\/bookingwithoverture.com\/blog\/wp-json\/wp\/v2\/media?parent=506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bookingwithoverture.com\/blog\/wp-json\/wp\/v2\/categories?post=506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bookingwithoverture.com\/blog\/wp-json\/wp\/v2\/tags?post=506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}