Authorising AJAX / CORS Requests
By default (and for security reasons), we block such requests. IF you wish to use AJAX to submit your form data to your LeadByte account, you will need to make adjustments on how you submit data directly from your website to LeadByte.
For example, instead of having an AJAX request direct to your LeadByte REST API endpoint, you have an AJAX request to a script on your own site which then pushes the data into LeadByte using curl (for example). From a security view point, this is important as the script you host will hide the credentials that you use to submit data to your LeadByte account.
Steps in LeadByte
Step 1 - Generate a REST API key in your account with the permission to CREATE leads
Step 2 - Authorise the domain you are making the request from
Generate REST API with permission to CREATE lead(s) (STEP 1)
Further reading here: CREATE Lead via REST API
Authorise Domain / IP (STEP 2)
Firstly, you need to ensure that you have the permission. This is only something Admin users can do. To authorise your domain(s) go to Admin > Tech Hub > Domain Authorisation. Follow the instructions on the screen and save changes. Please note, it can take up to 5 minutes for the domain to be authorised.
If this request comes from a server (server-to-server request), please ensure you add the IP address here. Server=to-Server is authorised by IP or API Key (if you whitelist your key). NOTE: If you are running off a subdomain, please include that as the entry i.e. hello.mydomain.com