Get started

Solic API Endpoint
https://solic.io/api/
            

The Solic API provides access to forms created within solic.io so that you can access forms through your site or application and then send those requests back to the system.

To use this API, you need an API key. Create an account, go to API Tokens and you can create a new token to use to access the API.

List Forms


# Here is a curl example
curl -X GET "https://solic.io/api/forms" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json"
            

To get a list of all forms, make a GET call to the following URL:
https://solic.io/api/forms



Result example :

{
    "data": [
        {
            "id": "01gzytw1f682ntxnxm1443htg7",
            "name": "Test Contact Form",
            "created_at": "2023-05-08T23:24:13.000000Z",
            "updated_at": "2023-05-08T23:24:13.000000Z"
        }
    ]
}
                

Errors

Error documentation will be coming soon.

Get Form


# Here is a curl example
curl -X GET "https://solic.io/api/forms/show/01gzytw1f682ntxnxm1443htg7" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json"
                

To get a single form, make a GET call to the following URL passing the id of the form:
https://solic.io/api/forms/show/01gzytw1f682ntxnxm1443htg7

The response you receive from this endpoint will be used to build your form. There are several fields here that you will need to build your form. Each one will be discussed below. It's important the fields are submitted back to the API in the order they were received.

Important Note: Everytime you display your new form, you should call this endpoint to get your form data to generate your form, because you will be given a new field_token for each of your fields everytime.



Result example :

{
    "data": [
        {
            "id": "01gzytw1f682ntxnxm1443htg7",
            "name": "Test Contact Form",
            "csrf_token": "5de201941530f0f70a287e18266f1262e346a5f9a19ac3e06f5140f36cf7adeb",
            "created_at": "2023-05-08T23:24:13.000000Z",
            "updated_at": "2023-05-08T23:24:13.000000Z",
            "fields": [
                {
                    "name": "All your base are belong to us",
                    "field_token": "Uu9FyyouKeecykQHTwhrsBMLQvuWjlJ3",
                    "type": "honeypot"
                },
                {
                    "name": "Name",
                    "field_token": "zWPRl2KHndx8LyNyIBRw1j1tWjqT4P3G",
                    "type": "text"
                },
                {
                    "name": "Email Address",
                    "field_token": "FGtT3YnIq7bfz9X3UsJSvCwg0JuuPu1m",
                    "type": "text"
                },
                {
                    "name": "Phone",
                    "field_token": "k5sXajbrzzpgxGhKNGXkBamrihXXtzcI",
                    "type": "text"
                },
                {
                    "name": "Message",
                    "field_token": "on2qpOaEgQ1IxWTFSVbTkY7VsI7FBlOk",
                    "type": "textarea"
                }
            ]
        }
    ]
}                

RESPONSE INFORMATION

Field Type Description
id String The id of your form.
name String The name of you form.
csrf_token String This is a required field that will be a part of your form and should be the first field in the form. It should be a hidden field.
created_at DateTime The date and time you form was created.
updated_at DateTime The date and time you form was updated.
fields array A list of all the fields in your form. Information about the field items in the below table.

FIELDS INFORMATION

Field Type Description
name String The name of your field. This will usually be used as the label.
field_token String The token provided for your field. This field will change everytime you call this endpoint. The idea is that we provide new tokens everytime your form is loaded. You can look at these as one time use tokens. This field should be used as the id and name of your input.
For example:
<label for="zWPRl2KHndx8LyNyIBRw1j1tWjqT4P3G">Name</label>
<input type="text" name="zWPRl2KHndx8LyNyIBRw1j1tWjqT4P3G" id="zWPRl2KHndx8LyNyIBRw1j1tWjqT4P3G">
type String This is the type for your field. As of right now there are only four types. text, email, textarea, honeypot.

Important Note: If you field is of the type honeypot, this field will generate in different places inside the response. It may show up in a different position in the list the next time you call the endpoint. The honeypot field must be included as a input field with the type of text in your form. However, it isn't meant to be shown to the visitor. You will need to hide the field with JavaScript or CSS. Again, it's important the fields are sent back in the same order they were received in this list, including the honeypot.

Errors

Error documentation will be coming soon.

Submitting the Form


# Here is a curl example
curl -X POST "https://solic.io/api/forms/store" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -d '{
            "csrf_token": "5de201941530f0f70a287e18266f1262e346a5f9a19ac3e06f5140f36cf7adeb",
            "Uu9FyyouKeecykQHTwhrsBMLQvuWjlJ3": "",
            "zWPRl2KHndx8LyNyIBRw1j1tWjqT4P3G": "John",
            "FGtT3YnIq7bfz9X3UsJSvCwg0JuuPu1m": "john@test.com",
            "k5sXajbrzzpgxGhKNGXkBamrihXXtzcI": "888-888-8888",
            "on2qpOaEgQ1IxWTFSVbTkY7VsI7FBlOk": "The message of your contact form submission is here.",
            "submit_button": "Submit"
        }'
                

To submit and store you form content to the API endpoint, a POST request to the following URL is needed:
https://solic.io/api/forms/store

Important Note: When submitting this request to the API, it is important to submit the form fields in the order they were received. Solic attempts to prevent form tampering, so if the fields come back in an order they were not sent, or a missing fields, etc, Solic will assume the form may have been tampered with.



Result example :

{
    "data": {
        "spam_type": "not_spam",
        "request_data": {
            "All your base are belong to us": null,
            "Name": "John",
            "Email Address": "john@john.com",
            "Phone": "888-888-8888",
            "Message": "Hi, how are you doing?"
        }
    }
}
                

RESPONSE INFORMATION

Field Type Description
spam_type String Will be of two possible types and is used to determine if Solic determines the request to be spam or not. It will either be spam or not_spam.
request_data Array An array of the data that was submitted through your form.

Errors

Error documentation will be coming soon.