Reports
Use this endpoint to read the answer breakdown of a form's choice fields and its entry, browser and device counts.
GET /report/forms/{form_id}
Get the report of one form.
Permission: fluentform_entries_viewer
The check runs against form_id.
Parameters
Path
| Name | Type | Default | Description |
|---|---|---|---|
form_id | integer | The form ID. |
Query
| Name | Type | Default | Description |
|---|---|---|---|
statuses | array | read, unread, unapproved, approved, declined, unconfirmed, confirmed | Count only entries with these statuses. Spam and trashed entries are left out by default. Send as statuses[]=read&statuses[]=unread. |
Example request
bash
curl 'https://your-site.com/wp-json/fluentform/v1/report/forms/12?statuses[]=read&statuses[]=unread' \
-u 'admin:xxxx xxxx xxxx xxxx xxxx xxxx'Example response
json
{
"report_items": {
"input_radio": {
"reports": [
{
"value": "Email",
"count": "48",
"sub_field": ""
}
],
"total_entry": 79,
"label": "Preferred contact",
"element": "input_radio",
"options": {
"Email": "Email",
"Phone": "Phone"
}
}
},
"total_entries": 132,
"browsers": {
"Chrome": "120"
},
"devices": {
"Apple": "95"
}
}report_itemshas one key per reportable field, keyed by field name. Reportable fields are dropdowns, radios, checkboxes, ratings, net promoter score, country lists and checkable grids. Thefluentform/reportable_inputsfilter changes this list.report_itemsis an empty object{}when the form has no reportable fields.reports[].countand the values inbrowsersanddevicesare strings.total_entryandtotal_entriesare integers.total_entryis the number of entries that answered that field.total_entriesis the number of entries in the selected statuses.- For checkable grids, each
valuereads<row> : <column>andsub_fieldholds the row. - A field's item can carry extra keys when a plugin hooks
fluentform/reports/format_field_{element}. Fluent Forms Pro does this for its ranking field.
Errors
422with{"message": "The form couldn't be found."}when no form has this ID.
Side effects
- The first time a form's report is requested, Fluent Forms starts a background job that builds the form's report data from its entries.