API
Overview
Evolution Forms uses the REST API WordPress provides and defines two routes to retrieve form data and form response data (leads). In order to use the API, the extension has to be purchased from the Extensions menu.
Base URL
In order for the API to work, the permalink setting in WordPress needs to be set to Post name (/wp-admin/options-permalink.php
on your WordPress instance). HTTPS needs to be enabled.
Evolution Forms provides
/evolution-forms/v1/responses
and
/evolution-forms/v1/forms
Here's an example for a complete URL:
https://test.evolution-forms.com/wp-json/evolution-forms/v1/responses
Authentication
The API uses application passwords which have to be generated in the WordPress user settings.
Test Authentication
You can test your credentials with cURL:
curl --user "USERNAME:APPLICATION_PASSWORD" https://test.evolution-forms.com/wp-json/wp/v2/users/me
Replace USERNAME
and APPLICATION_PASSWORD
with your credentials.
Routes
/wp-json/evolution-forms/v1/forms
Information about available forms
Parameters:
formIDs
(Array of integers): Which forms to query for. Leave empty to retrieve all forms. Can also be specified in the route: /wp-json/evolution-forms/v1/forms/23
/wp-json/evolution-forms/v1/responses
Form responses (leads)
Parameters
formIDs
(array of integers): Which forms to query for. Leave empty to retrieve responses to all forms.
responseIDs
(array of strings): Which specific responses to pick.
page
(integer: Number of page. Leave empty to retrieve all responses at once.
detailed
(boolean): Merges all steps from the steps
array so that all element responses are in one large array called elements
. Also adds stepID
, dateStart
and dateEnd
to element responses.
Examples
Responses to forms 22 and 33:
https://test.evolution-forms.com/wp-json/evolution-forms/v1/responses?formIDs[0]=22&formIDs[1]=33
Response with ID htUpIvGeNFadxpYk3jCPxXPXm
:
https://test.evolution-forms.com/wp-json/evolution-forms/1v1/responses?responseIDs[0]=htUpIvGeNFadxpYk3jCPxXPXm