API Reference - Form Fields

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108076

← Back to API Reference | Getting Started

Form Fields

Form Fields define the individual input elements that make up a form. Each field belongs to a form (identified by form_name) and controls how data is displayed, entered, searched, and emailed. Fields can be text inputs, textareas, dropdowns, checkboxes, hidden fields, and more.

Model name in URL: form_fields — DB table: form_fields

The Form Fields Object

FieldTypeDescription
field_idintegerUnique field ID (primary key, read-only)
form_namestringMachine name of the parent form this field belongs to
field_texttextLabel text displayed to the user, or a template token (EG %%%field_label%%%)
field_namestringDatabase column name the field maps to in the target table
field_typestringInput type (EG text, textarea, select, checkbox, Hidden, Button, HTML)
field_orderintegerDisplay order of the field within the form (lower numbers appear first)
field_sdesctextShort description or help text shown near the field
field_ldesctextLong description or extended help text for the field
field_placeholderstringPlaceholder text shown inside the input when it is empty
field_requiredintegerWhether the field is required: 1 = required, 0 = optional
field_optionstextPipe-delimited list of options for select, checkbox, or radio fields (EG Option 1|Option 2|Option 3)
input_classstringCSS class(es) applied to the input element
display_classstringCSS class(es) applied to the display wrapper element
default_valuetextDefault value pre-filled in the field when the form loads
field_display_viewstringWhether to show the field in the public display view: 1 = yes, 0 = no
field_input_viewstringWhether to show the field in the input/edit view: 1 = yes, 0 = no
field_grid_viewstringWhether to show the field in grid/listing views: 1 = yes, 0 = no
field_email_viewstringWhether to include the field in email notifications: 1 = yes, 0 = no
form_sectionstringSection or group name used to visually group related fields
field_search_viewstringWhether to show the field in search forms: 1 = yes, 0 = no
display_div_idstringHTML element ID wrapping the display output of this field
input_div_idstringHTML element ID wrapping the input element of this field
revision_timestamptimestampDate and time the field was last modified
field_iconstringIcon class (EG a Font Awesome class) displayed alongside the field label
json_metatextJSON-encoded metadata for extended field configuration options
field_display_view_button_targetstringDisplay view button link target setting
input_view_labelstringCustom label for input view
display_view_labelstringCustom label for display view
field_display_view_button_textstringDisplay view button text
field_display_view_buttonstringDisplay view button toggle
search_view_labelstringCustom label for search view
email_view_labelstringCustom label for email view
grid_view_labelstringCustom label for grid view
field_input_view_admin_onlystringAdmin-only input view toggle

List Form Fields Records

GET /api/v2/form_fields/get

Returns a paginated list of form field records.

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/form_fields/get?limit=25" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "tablesExists": true,
      "field_id": "45351",
      "form_name": "member_listing_details",
      "field_text": "%%%member_listing_honors%%%",
      "field_name": "awards",
      "field_type": "textarea",
      "field_order": "10",
      "field_sdesc": "",
      "field_ldesc": "",
      "field_placeholder": "",
      "field_required": "0",
      "field_options": "",
      "input_class": "",
      "display_class": "",
      "default_value": "",
      "field_display_view": "1",
      "field_input_view": "1",
      "field_grid_view": "0",
      "field_email_view": "0",
      "form_section": "",
      "field_search_view": "0",
      "display_div_id": "",
      "input_div_id": "",
      "revision_timestamp": "2025-01-06 09:06:48",
      "field_icon": "",
      "json_meta": ""
    }
  ],
  "total": "149",
  "current_page": 1,
  "total_pages": 6,
  "next_page": "MipfKjM="
}

Retrieve a Form Field

GET /api/v2/form_fields/get/{field_id}

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/form_fields/get/45351" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "tablesExists": true,
      "field_id": "45351",
      "form_name": "member_listing_details",
      "field_text": "%%%member_listing_honors%%%",
      "field_name": "awards",
      "field_type": "textarea",
      "field_order": "10",
      "field_sdesc": "",
      "field_ldesc": "",
      "field_placeholder": "",
      "field_required": "0",
      "field_options": "",
      "input_class": "",
      "display_class": "",
      "default_value": "",
      "field_display_view": "1",
      "field_input_view": "1",
      "field_grid_view": "0",
      "field_email_view": "0",
      "form_section": "",
      "field_search_view": "0",
      "display_div_id": "",
      "input_div_id": "",
      "revision_timestamp": "2025-01-06 09:06:48",
      "field_icon": "",
      "json_meta": ""
    }
  ],
  "total": "1",
  "current_page": 1,
  "total_pages": 1
}

Create a Form Field

POST /api/v2/form_fields/create

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/form_fields/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "form_name=contact_form" \
  -d "field_name=phone_number" \
  -d "field_text=Phone+Number" \
  -d "field_type=text" \
  -d "field_order=3" \
  -d "field_required=0" \
  -d "field_placeholder=Enter+your+phone+number" \
  -d "field_input_view=1" \
  -d "field_display_view=1" \
  -d "field_email_view=1"

Example Response

Copy
{
  "status": "success",
  "message": {
    "field_id": "46715",
    "form_name": "contact_form",
    "field_text": "Phone Number",
    "field_name": "phone_number",
    "field_type": "text",
    "field_order": "3",
    "field_sdesc": null,
    "field_ldesc": null,
    "field_placeholder": "Enter your phone number",
    "field_required": "0",
    "field_options": null,
    "input_class": null,
    "display_class": null,
    "default_value": null,
    "field_display_view": "1",
    "field_input_view": "1",
    "field_grid_view": null,
    "field_email_view": "1",
    "form_section": null,
    "field_search_view": null,
    "display_div_id": null,
    "input_div_id": null,
    "revision_timestamp": null,
    "field_icon": null,
    "json_meta": null
  }
}

Update a Form Field

PUT /api/v2/form_fields/update

Example Request

Copy
curl -X PUT "https://www.yourdomain.com/api/v2/form_fields/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "field_id=46715" \
  -d "field_text=Phone+Number+%28Optional%29" \
  -d "field_placeholder=555-555-5555"

Example Response

Copy
{
  "status": "success",
  "message": {
    "field_id": "46715",
    "form_name": "contact_form",
    "field_text": "Phone Number (Optional)",
    "field_name": "phone_number",
    "field_type": "text",
    "field_order": "3",
    "field_sdesc": "",
    "field_ldesc": "",
    "field_placeholder": "555-555-5555",
    "field_required": "0",
    "field_options": "",
    "input_class": "",
    "display_class": "",
    "default_value": "",
    "field_display_view": "1",
    "field_input_view": "1",
    "field_grid_view": "1",
    "field_email_view": "1",
    "form_section": "",
    "field_search_view": "",
    "display_div_id": "",
    "input_div_id": "",
    "revision_timestamp": "2026-04-03 23:42:59",
    "field_icon": "",
    "json_meta": ""
  }
}

Delete a Form Field

DELETE /api/v2/form_fields/delete

Example Request

Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/form_fields/delete" \
  -H "X-Api-Key: your-api-key-here" \
  -d "field_id=46715"

Example Response

Copy
{
  "status": "success",
  "message": "form_fields record was deleted"
}