Skip to content

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

NameTypeDefaultDescription
form_idintegerThe form ID.

Query

NameTypeDefaultDescription
statusesarrayread, unread, unapproved, approved, declined, unconfirmed, confirmedCount 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_items has one key per reportable field, keyed by field name. Reportable fields are dropdowns, radios, checkboxes, ratings, net promoter score, country lists and checkable grids. The fluentform/reportable_inputs filter changes this list.
  • report_items is an empty object {} when the form has no reportable fields.
  • reports[].count and the values in browsers and devices are strings. total_entry and total_entries are integers.
  • total_entry is the number of entries that answered that field. total_entries is the number of entries in the selected statuses.
  • For checkable grids, each value reads <row> : <column> and sub_field holds 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

  • 422 with {"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.

Fluent Forms developer documentation