Introduction
Welcome to the Formidable Forms API official documentation! The Formidable Forms API is fully integrated with the WordPress REST API. This allows Formidable data to be created, read, updated, and deleted using requests in JSON format and using WordPress REST API Authentication methods and standard HTTP verbs which are understood by most HTTP clients.
The following table shows API versions present in each major version of WooCommerce:
API Version | FF Version | WP Version | Documentation |
---|---|---|---|
v2 |
- | 4.4 or later | - |
v1 |
- | 4.4 or later | v1 docs |
Requirements
To use the latest version of the REST API you must be using:
- Formidable 2.0+
- Formidable API 1.0+
- WordPress 4.4+
- Pretty permalinks in Settings > Permalinks so that the custom endpoints are supported. Default permalinks will not work.
- You may access the API over either HTTP or HTTPS, but HTTPS is recommended where possible.
Download and install
- Download the latest version of the Formidable API add-on.
- In your WordPress admin, go to ‘Plugins’ → ‘Add New’ and click the ‘Upload Plugin’ button at the top of the page.
- Upload the zip file you just downloaded in step two. Once the plugin is installed, click ‘Activate Plugin’ or go to the ‘Plugins’ page, find ‘Formidable API’ and click ‘Activate’.
HTTP Methods
GET
Make a GET request to retrieve data. GET requests will never cause an update or change to your data because they’re safe and idempotent.
POST
Use a POST request to create new entries, forms, Views, or fields. POST can also be used to update an entry, form, View, or field.
PATCH
Make a PATCH request to update an entry, form, View, or field. With PATCH requests, you only need to provide the data you want to change.
PUT
Use a PUT request to create or update an entry, form, View, or field.
DELETE
Make a DELETE request to delete an entry, form, View, or field.
Request/Response Format
The default response format is JSON. Requests with a message-body use plain JSON to set or update resource attributes. Successful requests will return a 200 OK
HTTP status.
Errors
Occasionally you might encounter errors when accessing the REST API. There are four possible types:
Error Code | Error Type |
---|---|
400 Bad Request |
Invalid request, e.g. using an unsupported HTTP method |
401 Unauthorized |
Authentication or permission error, e.g. incorrect API keys |
403 Forbidden |
Your API key didn’t log you in. If you are using Basic Authentication, your server may not be recognizing your authorization headers. |
404 Not Found |
Requests to resources that don’t exist or are missing |
500 Internal Server Error |
Server error |
WP REST API error example:
{
"code": "rest_no_route",
"message": "No route was found matching the URL and request method",
"data": {
"status": 404
}
}
Errors return both an appropriate HTTP status code and response object which contains a code
, message
and data
attribute.
Parameters
Almost all endpoints accept optional parameters which can be passed as a HTTP query string parameter, e.g. GET /entries?search=Test
. All parameters are documented along each endpoint.
Tools
Some useful tools you can use to access the API include:
- Postman - A multi platform REST API GUI client (using Google Chrome or installing the app on Mac OS X or Windows).
- CocoaRestClient - A Mac OS X GUI client for interacting with the API.
- Paw HTTP Client - Another HTTP client for Mac OS X.
- RESTClient, a debugger for RESTful web services - Free Firefox add-on.
- Advanced REST client - Free Google Chrome extension.
Forms
Get All forms
This endpoint retrieves an array of all forms.
HTTP Request
GET https://example.com/wp-json/frm/v2/forms
Query Parameters
Parameter | Default | Description |
---|---|---|
limit | 20 | Limit the number of forms returned |
order | ASC | Use ASC or DESC |
order_by | created_at | Order the entries by id, created_at, updated_at, form_id |
page | 1 | The page number to retrieve. |
page_size | 10 | Change the number of forms returned per page |
return | array | Use ?return=html to return HTML instead of JSON |
search | “ | Search all fields in the entries for a value. |
Pagination
Requests that return multiple items will be paginated to 10 items by default. The items per page can be specified with the ?page_size
parameter:
GET /forms?page_size=15
You can specify further pages with the ?page
parameter:
GET /forms?page=2
curl -user 95SX-LM4Z-DDTC-HP8A:x https://example.com/wp-json/frm/v2/forms
<?php
$headers = array (
'Authorization' => 'Basic ' . base64_encode( '95SX-LM4Z-DDTC-HP8A:x' ),
);
$response = wp_remote_request( 'https://example.com/wp-json/frm/v2/forms', array(
'method' => 'GET',
'headers' => $headers
));
?>
jQuery(document).ready(function($) {
$.ajax({
beforeSend: function(xhr){
xhr.setRequestHeader ("Authorization", "Basic " + btoa("95SX-LM4Z-DDTC-HP8A:x"));
},
dataType: "json",
url: "https://example.com/jonathan/wp-json/frm/v2/forms",
success: function(json){
//do something with the json
console.log(json);
}
});
});
JSON response example:
{
"3qshv": {
"id": "40",
"form_key": "3qshv",
"name": "Example Form",
"description": "",
"parent_form_id": "0",
"logged_in": "0",
"is_template": "0",
"created_at": "2017-05-15 05:28:46",
"link": "https://example.com/wp-admin/admin-ajax.php?action=frm_forms_preview&form=3qshv",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/frm/v2/forms/40"
}
],
"collection": [
{
"href": "https://example.com/wp-json/frm/v2/forms"
}
],
"fields": [
{
"embeddable": true,
"href": "https://example.com/wp-json/frm/v2/forms/40/fields"
}
]
}
}
}
Get a Single Form
This endpoint gets a single form.
HTTP Request
GET https://example.com/wp-json/frm/v2/forms/{formID}
curl -user 95SX-LM4Z-DDTC-HP8A:x https://example.com/wp-json/frm/v2/forms/40
<?php
$headers = array (
'Authorization' => 'Basic ' . base64_encode( '95SX-LM4Z-DDTC-HP8A:x' ),
);
$response = wp_remote_request( 'https://example.com/wp-json/frm/v2/forms/40', array(
'method' => 'GET',
'headers' => $headers
));
?>
jQuery(document).ready(function($) {
$.ajax({
beforeSend: function(xhr){
xhr.setRequestHeader ("Authorization", "Basic " + btoa("95SX-LM4Z-DDTC-HP8A:x"));
},
dataType: "json",
url: "https://example.com/jonathan/wp-json/frm/v2/forms/40",
success: function(json){
//do something with the json
console.log(json);
}
});
});
JSON response example:
{
"id": "40",
"form_key": "3qshv",
"name": "Example Form",
"description": "",
"parent_form_id": "0",
"logged_in": "0",
"is_template": "0",
"created_at": "2017-05-15 05:28:46",
"link": "https://example.com/wp-admin/admin-ajax.php?action=frm_forms_preview&form=3qshv",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/frm/v2/forms/40"
}
],
"collection": [
{
"href": "https://example.com/wp-json/frm/v2/forms"
}
],
"fields": [
{
"embeddable": true,
"href": "https://example.com/wp-json/frm/v2/forms/40/fields"
}
]
}
}
Create a Form
This endpoint creates a single form.
HTTP Request
POST http://example.com/wp-json/frm/v2/forms/
curl -user 95SX-LM4Z-DDTC-HP8A:x -X POST https://example.com/wp-json/frm/v2/forms
<?php
$headers = array (
'Authorization' => 'Basic ' . base64_encode( '95SX-LM4Z-DDTC-HP8A:x' ),
);
$response = wp_remote_request( 'https://example.com/wp-json/frm/v2/forms', array(
'method' => 'POST',
'headers' => $headers
));
?>
jQuery(document).ready(function($) {
$.ajax({
beforeSend: function(xhr){
xhr.setRequestHeader ("Authorization", "Basic " + btoa("95SX-LM4Z-DDTC-HP8A:x"));
},
dataType: "json",
method: "POST",
url: "https://example.com/wp-json/frm/v2/forms",
success: function(json){
//do something with the json
console.log(json);
}
});
});
JSON response example:
{
"id": "40",
"form_key": "3qshv",
"name": "",
"description": "",
"status": "draft",
"parent_form_id": "0",
"logged_in": "0",
"is_template": "0",
"options": {
"submit_value": "Submit",
"success_action": "message",
"success_msg": "Your responses were successfully submitted. Thank you!",
"show_form": 0,
"akismet": "",
"no_save": 0,
"ajax_load": 0,
"form_class": "",
"custom_style": 1,
"before_html": "<legend class=\"frm_hidden\">[form_name]</legend>\n[if form_name]<h3 class=\"frm_form_title\">[form_name]</h3>[/if form_name]\n[if form_description]<div class=\"frm_description\">[form_description]</div>[/if form_description]",
"after_html": "",
"submit_html": "<div class=\"frm_submit\">\n[if back_button]<button type=\"submit\" name=\"frm_prev_page\" formnovalidate=\"formnovalidate\" class=\"frm_prev_page\" [back_hook]>[back_label]</button>[/if back_button]\n<button class=\"frm_button_submit\" type=\"submit\" [button_action]>[button_label]</button>\n[if save_draft]<a href=\"#\" class=\"frm_save_draft\" [draft_hook]>[draft_label]</a>[/if save_draft]\n</div>"
},
"editable": "0",
"created_at": "2017-05-20 04:47:56",
"link": "https://example.com/wp-admin/admin-ajax.php?action=frm_forms_preview&form=3qshv",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/frm/v2/forms/40"
}
],
"collection": [
{
"href": "https://example.com/wp-json/frm/v2/forms"
}
],
"fields": [
{
"embeddable": true,
"href": "https://example.com/wp-json/frm/v2/forms/40/fields"
}
]
}
}
Delete a Form
This endpoint deletes a single form.
HTTP Request
DELETE http://example.com/wp-json/frm/v2/forms/{formID}
curl -user 95SX-LM4Z-DDTC-HP8A:x -X DELETE https://example.com/wp-json/frm/v2/forms/40
<?php
$headers = array (
'Authorization' => 'Basic ' . base64_encode( '95SX-LM4Z-DDTC-HP8A:x' ),
);
$response = wp_remote_request( 'https://example.com/wp-json/frm/v2/forms/40', array(
'method' => 'DELETE',
'headers' => $headers
));
?>
jQuery(document).ready(function($) {
$.ajax({
beforeSend: function(xhr){
xhr.setRequestHeader ("Authorization", "Basic " + btoa("95SX-LM4Z-DDTC-HP8A:x"));
},
dataType: "json",
method: "DELETE",
url: "https://example.com/wp-json/frm/v2/forms/40",
success: function(json){
//do something with the json
console.log(json);
}
});
});
JSON response example:
{
"id": "40",
"form_key": "3qshv",
"name": "Example Form",
"description": "",
"status": "draft",
"parent_form_id": "0",
"logged_in": "0",
"is_template": "0",
"options": {
"submit_value": "Submit",
"success_action": "message",
"success_msg": "Your responses were successfully submitted. Thank you!",
"show_form": 0,
"akismet": "",
"no_save": 0,
"ajax_load": 0,
"form_class": "",
"custom_style": 1,
"before_html": "<legend class=\"frm_hidden\">[form_name]</legend>\n[if form_name]<h3 class=\"frm_form_title\">[form_name]</h3>[/if form_name]\n[if form_description]<div class=\"frm_description\">[form_description]</div>[/if form_description]",
"after_html": "",
"submit_html": "<div class=\"frm_submit\">\n[if back_button]<button type=\"submit\" name=\"frm_prev_page\" formnovalidate=\"formnovalidate\" class=\"frm_prev_page\" [back_hook]>[back_label]</button>[/if back_button]\n<button class=\"frm_button_submit\" type=\"submit\" [button_action]>[button_label]</button>\n[if save_draft]<a href=\"#\" class=\"frm_save_draft\" [draft_hook]>[draft_label]</a>[/if save_draft]\n</div>"
},
"editable": "0",
"created_at": "2017-05-20 04:47:56",
"link": "https://example.com/wp-admin/admin-ajax.php?action=frm_forms_preview&form=3qshv",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/frm/v2/forms/568"
}
],
"collection": [
{
"href": "https://example.com/wp-json/frm/v2/forms"
}
],
"fields": [
{
"embeddable": true,
"href": "https://example.com/wp-json/frm/v2/forms/568/fields"
}
]
}
}
Fields
Get All Fields from a Form
This endpoint will get an array of all fields from a single form.
HTTP Request
GET http://example.com/wp-json/frm/v2/forms/{formID}/fields
Query Parameters
There are no query parameters at this time.
curl -user 95SX-LM4Z-DDTC-HP8A:x https://example.com/wp-json/frm/v2/forms/40/fields
<?php
$headers = array (
'Authorization' => 'Basic ' . base64_encode( '95SX-LM4Z-DDTC-HP8A:x' ),
);
$response = wp_remote_request( 'https://example.com/wp-json/frm/v2/forms/40/fields', array(
'method' => 'GET',
'headers' => $headers
));
?>
jQuery(document).ready(function($) {
$.ajax({
beforeSend: function(xhr){
xhr.setRequestHeader ("Authorization", "Basic " + btoa("95SX-LM4Z-DDTC-HP8A:x"));
},
dataType: "json",
url: "https://example.com/jonathan/wp-json/frm/v2/forms/40/fields",
success: function(json){
//do something with the json
console.log(json);
}
});
});
JSON response example:
{
"atkg5": {
"id": "686",
"field_key": "atkg5",
"name": "Dropdown",
"description": "",
"type": "select",
"default_value": "",
"options": [
{
"label": "",
"value": ""
},
{
"label": "Option 1",
"value": "Option 1"
}
],
"field_order": "0",
"required": "0",
"field_options": {
"size": "",
"max": "",
"label": "",
"blank": "This field cannot be blank.",
"required_indicator": "*",
"invalid": "",
"separate_value": 0,
"clear_on_focus": 0,
"default_blank": "0",
"classes": "",
"custom_html": "<div id=\"frm_field_[id]_container\" class=\"frm_form_field form-field [required_class][error_class]\">\r\n <label for=\"field_[key]\" class=\"frm_primary_label\">[field_name]\r\n <span class=\"frm_required\">[required_label]</span>\r\n </label>\r\n [input]\r\n [if description]<div class=\"frm_description\">[description]</div>[/if description]\r\n [if error]<div class=\"frm_error\">[error]</div>[/if error]\r\n</div>",
"captcha_size": "normal",
"captcha_theme": "light",
"in_section": "0",
"slide": 0,
"form_select": "",
"show_hide": "show",
"any_all": "any",
"align": "block",
"hide_field": [],
"hide_field_cond": [
"=="
],
"hide_opt": [],
"star": 0,
"ftypes": [],
"data_type": "select",
"restrict": 0,
"start_year": 2000,
"end_year": 2020,
"read_only": 0,
"admin_only": "",
"locale": "",
"attach": false,
"minnum": 0,
"maxnum": 9999,
"delete": false,
"step": 1,
"clock": 12,
"single_time": 0,
"start_time": "00:00",
"end_time": "23:59",
"unique": 0,
"use_calc": 0,
"calc": "",
"calc_dec": "",
"calc_type": "",
"dyn_default_value": "",
"multiple": 0,
"unique_msg": "",
"autocom": 0,
"format": "",
"repeat": 0,
"add_label": "Add",
"remove_label": "Remove",
"conf_field": "",
"conf_input": "",
"conf_desc": "",
"conf_msg": "The entered values do not match",
"other": "0",
"autopopulate_value": false,
"get_values_form": "",
"get_values_field": "",
"watch_lookup": [
""
],
"get_most_recent_value": "",
"lookup_filter_current_user": false,
"custom_field": "",
"post_field": "",
"taxonomy": "category",
"exclude_cat": 0
},
"created_at": "2017-06-05 06:04:54"
},
"enfr": {
"id": "685",
"field_key": "enfr",
"name": "Single Line Text",
"description": "",
"type": "text",
"default_value": "",
"options": "",
"field_order": "1",
"required": "0",
"field_options": {
"size": "",
"max": "",
"label": "",
"blank": "This field cannot be blank.",
"required_indicator": "*",
"invalid": "",
"separate_value": 0,
"clear_on_focus": "0",
"default_blank": "0",
"classes": "",
"custom_html": "<div id=\"frm_field_[id]_container\" class=\"frm_form_field form-field [required_class][error_class]\">\r\n <label for=\"field_[key]\" class=\"frm_primary_label\">[field_name]\r\n <span class=\"frm_required\">[required_label]</span>\r\n </label>\r\n [input]\r\n [if description]<div class=\"frm_description\">[description]</div>[/if description]\r\n [if error]<div class=\"frm_error\">[error]</div>[/if error]\r\n</div>",
"captcha_size": "normal",
"captcha_theme": "light",
"in_section": "0",
"slide": 0,
"form_select": "",
"show_hide": "show",
"any_all": "any",
"align": "block",
"hide_field": [],
"hide_field_cond": [
"=="
],
"hide_opt": [],
"star": 0,
"ftypes": [],
"data_type": "select",
"restrict": 0,
"start_year": 2000,
"end_year": 2020,
"read_only": 0,
"admin_only": "",
"locale": "",
"attach": false,
"minnum": 0,
"maxnum": 9999,
"delete": false,
"step": 1,
"clock": 12,
"single_time": 0,
"start_time": "00:00",
"end_time": "23:59",
"unique": 0,
"use_calc": 0,
"calc": "",
"calc_dec": "",
"calc_type": "",
"dyn_default_value": "",
"multiple": 0,
"unique_msg": "",
"autocom": 0,
"format": "",
"repeat": 0,
"add_label": "Add",
"remove_label": "Remove",
"conf_field": "",
"conf_input": "",
"conf_desc": "",
"conf_msg": "The entered values do not match",
"other": 0,
"autopopulate_value": false,
"get_values_form": "",
"get_values_field": "",
"watch_lookup": [
""
],
"get_most_recent_value": "",
"lookup_filter_current_user": false,
"custom_field": "",
"post_field": "",
"taxonomy": "category",
"exclude_cat": 0
},
"created_at": "2017-06-05 06:04:51"
}
}
Create a Field in a Form
This endpoint will allow you to create a field in a form.
HTTP Request
POST http://example.com/wp-json/frm/v2/forms/{formID}/fields
curl -user 95SX-LM4Z-DDTC-HP8A:x -X POST https://example.com/wp-json/frm/v2/forms/40/fields
<?php
$headers = array (
'Authorization' => 'Basic ' . base64_encode( '95SX-LM4Z-DDTC-HP8A:x' ),
);
$response = wp_remote_request( 'https://example.com/wp-json/frm/v2/forms/40/fields', array(
'method' => 'POST',
'headers' => $headers
));
?>
jQuery(document).ready(function($) {
$.ajax({
beforeSend: function(xhr){
xhr.setRequestHeader ("Authorization", "Basic " + btoa("95SX-LM4Z-DDTC-HP8A:x"));
},
dataType: "json",
method: "POST",
url: "https://example.com/jonathan/wp-json/frm/v2/forms/40/fields",
success: function(json){
//do something with the json
console.log(json);
}
});
});
JSON response example:
{
"atkg5": {
"id": "686",
"field_key": "atkg5",
"name": "Dropdown",
"description": "",
"type": "select",
"default_value": "",
"options": [
{
"label": "",
"value": ""
},
{
"label": "Option 1",
"value": "Option 1"
}
],
"field_order": "0",
"required": "0",
"field_options": {
"size": "",
"max": "",
"label": "",
"blank": "This field cannot be blank.",
"required_indicator": "*",
"invalid": "",
"separate_value": 0,
"clear_on_focus": 0,
"default_blank": "0",
"classes": "",
"custom_html": "<div id=\"frm_field_[id]_container\" class=\"frm_form_field form-field [required_class][error_class]\">\r\n <label for=\"field_[key]\" class=\"frm_primary_label\">[field_name]\r\n <span class=\"frm_required\">[required_label]</span>\r\n </label>\r\n [input]\r\n [if description]<div class=\"frm_description\">[description]</div>[/if description]\r\n [if error]<div class=\"frm_error\">[error]</div>[/if error]\r\n</div>",
"captcha_size": "normal",
"captcha_theme": "light",
"in_section": "0",
"slide": 0,
"form_select": "",
"show_hide": "show",
"any_all": "any",
"align": "block",
"hide_field": [],
"hide_field_cond": [
"=="
],
"hide_opt": [],
"star": 0,
"ftypes": [],
"data_type": "select",
"restrict": 0,
"start_year": 2000,
"end_year": 2020,
"read_only": 0,
"admin_only": "",
"locale": "",
"attach": false,
"minnum": 0,
"maxnum": 9999,
"delete": false,
"step": 1,
"clock": 12,
"single_time": 0,
"start_time": "00:00",
"end_time": "23:59",
"unique": 0,
"use_calc": 0,
"calc": "",
"calc_dec": "",
"calc_type": "",
"dyn_default_value": "",
"multiple": 0,
"unique_msg": "",
"autocom": 0,
"format": "",
"repeat": 0,
"add_label": "Add",
"remove_label": "Remove",
"conf_field": "",
"conf_input": "",
"conf_desc": "",
"conf_msg": "The entered values do not match",
"other": "0",
"autopopulate_value": false,
"get_values_form": "",
"get_values_field": "",
"watch_lookup": [
""
],
"get_most_recent_value": "",
"lookup_filter_current_user": false,
"custom_field": "",
"post_field": "",
"taxonomy": "category",
"exclude_cat": 0
},
"created_at": "2017-06-05 06:04:54"
},
"enfr": {
"id": "685",
"field_key": "enfr",
"name": "Single Line Text",
"description": "",
"type": "text",
"default_value": "",
"options": "",
"field_order": "1",
"required": "0",
"field_options": {
"size": "",
"max": "",
"label": "",
"blank": "This field cannot be blank.",
"required_indicator": "*",
"invalid": "",
"separate_value": 0,
"clear_on_focus": "0",
"default_blank": "0",
"classes": "",
"custom_html": "<div id=\"frm_field_[id]_container\" class=\"frm_form_field form-field [required_class][error_class]\">\r\n <label for=\"field_[key]\" class=\"frm_primary_label\">[field_name]\r\n <span class=\"frm_required\">[required_label]</span>\r\n </label>\r\n [input]\r\n [if description]<div class=\"frm_description\">[description]</div>[/if description]\r\n [if error]<div class=\"frm_error\">[error]</div>[/if error]\r\n</div>",
"captcha_size": "normal",
"captcha_theme": "light",
"in_section": "0",
"slide": 0,
"form_select": "",
"show_hide": "show",
"any_all": "any",
"align": "block",
"hide_field": [],
"hide_field_cond": [
"=="
],
"hide_opt": [],
"star": 0,
"ftypes": [],
"data_type": "select",
"restrict": 0,
"start_year": 2000,
"end_year": 2020,
"read_only": 0,
"admin_only": "",
"locale": "",
"attach": false,
"minnum": 0,
"maxnum": 9999,
"delete": false,
"step": 1,
"clock": 12,
"single_time": 0,
"start_time": "00:00",
"end_time": "23:59",
"unique": 0,
"use_calc": 0,
"calc": "",
"calc_dec": "",
"calc_type": "",
"dyn_default_value": "",
"multiple": 0,
"unique_msg": "",
"autocom": 0,
"format": "",
"repeat": 0,
"add_label": "Add",
"remove_label": "Remove",
"conf_field": "",
"conf_input": "",
"conf_desc": "",
"conf_msg": "The entered values do not match",
"other": 0,
"autopopulate_value": false,
"get_values_form": "",
"get_values_field": "",
"watch_lookup": [
""
],
"get_most_recent_value": "",
"lookup_filter_current_user": false,
"custom_field": "",
"post_field": "",
"taxonomy": "category",
"exclude_cat": 0
},
"created_at": "2017-06-05 06:04:51"
}
}
Get a Field from a Form
This endpoint will allow you to get a single field from a form.
HTTP Request
GET http://example.com/wp-json/frm/v2/forms/{formID}/fields/{fieldID}
curl -user 95SX-LM4Z-DDTC-HP8A:x https://example.com/wp-json/frm/v2/forms/40/fields/686
<?php
$headers = array (
'Authorization' => 'Basic ' . base64_encode( '95SX-LM4Z-DDTC-HP8A:x' ),
);
$response = wp_remote_request( 'https://example.com/wp-json/frm/v2/forms/40/fields/686', array(
'method' => 'GET',
'headers' => $headers
));
?>
jQuery(document).ready(function($) {
$.ajax({
beforeSend: function(xhr){
xhr.setRequestHeader ("Authorization", "Basic " + btoa("95SX-LM4Z-DDTC-HP8A:x"));
},
dataType: "json",
url: "https://example.com/jonathan/wp-json/frm/v2/forms/40/fields/686",
success: function(json){
//do something with the json
console.log(json);
}
});
});
JSON response example:
{
"id": "686",
"field_key": "atkg5",
"name": "Dropdown",
"description": "",
"type": "select",
"default_value": "",
"options": [
{
"label": "",
"value": ""
},
{
"label": "Option 1",
"value": "Option 1"
}
],
"field_order": "0",
"required": "0",
"field_options": {
"size": "",
"max": "",
"label": "",
"blank": "This field cannot be blank.",
"required_indicator": "*",
"invalid": "",
"separate_value": 0,
"clear_on_focus": 0,
"default_blank": "0",
"classes": "",
"custom_html": "<div id=\"frm_field_[id]_container\" class=\"frm_form_field form-field [required_class][error_class]\">\r\n <label for=\"field_[key]\" class=\"frm_primary_label\">[field_name]\r\n <span class=\"frm_required\">[required_label]</span>\r\n </label>\r\n [input]\r\n [if description]<div class=\"frm_description\">[description]</div>[/if description]\r\n [if error]<div class=\"frm_error\">[error]</div>[/if error]\r\n</div>",
"captcha_size": "normal",
"captcha_theme": "light",
"in_section": "0",
"slide": 0,
"form_select": "",
"show_hide": "show",
"any_all": "any",
"align": "block",
"hide_field": [],
"hide_field_cond": [
"=="
],
"hide_opt": [],
"star": 0,
"ftypes": [],
"data_type": "select",
"restrict": 0,
"start_year": 2000,
"end_year": 2020,
"read_only": 0,
"admin_only": "",
"locale": "",
"attach": false,
"minnum": 0,
"maxnum": 9999,
"delete": false,
"step": 1,
"clock": 12,
"single_time": 0,
"start_time": "00:00",
"end_time": "23:59",
"unique": 0,
"use_calc": 0,
"calc": "",
"calc_dec": "",
"calc_type": "",
"dyn_default_value": "",
"multiple": 0,
"unique_msg": "",
"autocom": 0,
"format": "",
"repeat": 0,
"add_label": "Add",
"remove_label": "Remove",
"conf_field": "",
"conf_input": "",
"conf_desc": "",
"conf_msg": "The entered values do not match",
"other": "0",
"autopopulate_value": false,
"get_values_form": "",
"get_values_field": "",
"watch_lookup": [
""
],
"get_most_recent_value": "",
"lookup_filter_current_user": false,
"custom_field": "",
"post_field": "",
"taxonomy": "category",
"exclude_cat": 0
},
"created_at": "2017-06-05 06:04:54"
}
Delete a Field from a Form
This endpoint will allow you to delete a single field from a form.
HTTP Request
DELETE http://example.com/wp-json/frm/v2/forms/{formID}/fields/{fieldID}
curl -user 95SX-LM4Z-DDTC-HP8A:x -X DELETE https://example.com/wp-json/frm/v2/forms/40/fields/686
<?php
$headers = array (
'Authorization' => 'Basic ' . base64_encode( '95SX-LM4Z-DDTC-HP8A:x' ),
);
$response = wp_remote_request( 'https://example.com/wp-json/frm/v2/forms/40/fields/686', array(
'method' => 'DELETE',
'headers' => $headers
));
?>
jQuery(document).ready(function($) {
$.ajax({
beforeSend: function(xhr){
xhr.setRequestHeader ("Authorization", "Basic " + btoa("95SX-LM4Z-DDTC-HP8A:x"));
},
dataType: "json",
method: "DELETE",
url: "https://example.com/jonathan/wp-json/frm/v2/forms/40/fields/686",
success: function(json){
//do something with the json
console.log(json);
}
});
});
JSON response example:
{
"id": "686",
"field_key": "atkg5",
"name": "Dropdown",
"description": "",
"type": "select",
"default_value": "",
"options": [
{
"label": "",
"value": ""
},
{
"label": "Option 1",
"value": "Option 1"
}
],
"field_order": "0",
"required": "0",
"field_options": {
"size": "",
"max": "",
"label": "",
"blank": "This field cannot be blank.",
"required_indicator": "*",
"invalid": "",
"separate_value": 0,
"clear_on_focus": 0,
"default_blank": "0",
"classes": "",
"custom_html": "<div id=\"frm_field_[id]_container\" class=\"frm_form_field form-field [required_class][error_class]\">\r\n <label for=\"field_[key]\" class=\"frm_primary_label\">[field_name]\r\n <span class=\"frm_required\">[required_label]</span>\r\n </label>\r\n [input]\r\n [if description]<div class=\"frm_description\">[description]</div>[/if description]\r\n [if error]<div class=\"frm_error\">[error]</div>[/if error]\r\n</div>",
"captcha_size": "normal",
"captcha_theme": "light",
"in_section": "0",
"slide": 0,
"form_select": "",
"show_hide": "show",
"any_all": "any",
"align": "block",
"hide_field": [],
"hide_field_cond": [
"=="
],
"hide_opt": [],
"star": 0,
"ftypes": [],
"data_type": "select",
"restrict": 0,
"start_year": 2000,
"end_year": 2020,
"read_only": 0,
"admin_only": "",
"locale": "",
"attach": false,
"minnum": 0,
"maxnum": 9999,
"delete": false,
"step": 1,
"clock": 12,
"single_time": 0,
"start_time": "00:00",
"end_time": "23:59",
"unique": 0,
"use_calc": 0,
"calc": "",
"calc_dec": "",
"calc_type": "",
"dyn_default_value": "",
"multiple": 0,
"unique_msg": "",
"autocom": 0,
"format": "",
"repeat": 0,
"add_label": "Add",
"remove_label": "Remove",
"conf_field": "",
"conf_input": "",
"conf_desc": "",
"conf_msg": "The entered values do not match",
"other": "0",
"autopopulate_value": false,
"get_values_form": "",
"get_values_field": "",
"watch_lookup": [
""
],
"get_most_recent_value": "",
"lookup_filter_current_user": false,
"custom_field": "",
"post_field": "",
"taxonomy": "category",
"exclude_cat": 0
},
"form_id": "53",
"created_at": "2017-06-05 06:04:54"
}
Entries
Get All Entries
This endpoint retrieves all entries.
import kittn
api = kittn.authorize('meowmeowmeow')
api.kittens.get()
const kittn = require('kittn');
let api = kittn.authorize('meowmeowmeow');
let kittens = api.kittens.get();
The above command returns JSON structured like this:
[
{
"id": 1,
"name": "Fluffums",
"breed": "calico",
"fluffiness": 6,
"cuteness": 7
},
{
"id": 2,
"name": "Max",
"breed": "unknown",
"fluffiness": 5,
"cuteness": 10
}
]
HTTP Request
GET http://example.com/wp-json/frm/v2/entries
Query Parameters
Parameter | Default | Description |
---|---|---|
form_id | 0 | Get all entries from a specific form |
page | 1 | The page number to retrieve. |
page_size | 25 | Change the number of entries returned |
order | ASC | Use ASC or DESC |
order_by | id | Order the entries by id, created_at, updated_at, form_id |
search | Search all fields in the entries for a value. |
GET http://example.com/wp-json/frm/v2/forms/1/entries
Pagination
Requests that return multiple items will be paginated to 25 items by default. The items per page can be specified with the ?page_size
parameter:
GET /entries?page_size=15
You can specify further pages with the ?page
parameter:
GET /entries?page=2
Get a single entry by Entry ID
This endpoint retrieves a single entry using the Entry ID.
HTTP Request
GET http://example.com/wp-json/frm/v2/entries/{entryID}
Create a single entry by Entry ID
This endpoint creates a single entry.
HTTP Request
POST http://example.com/wp-json/frm/v2/entries/{entryID}
Update a single entry by Entry ID
These endpoints update a single entry.
HTTP Request
POST http://example.com/wp-json/frm/v2/entries/{entryID}
PUT http://example.com/wp-json/frm/v2/entries/{entryID}
PATCH http://example.com/wp-json/frm/v2/entries/{entryID}