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.