Form Field Sets

A Form Field Set is a custom form to be used for bundle and inbox registrations.

Each Form Field Set contains one or more Form Fields. A form and all of its form fields are submitted in a single create request. The order of form fields in the array is the order they will be displayed.

Once created, a form field set can then be associated with one or more bundle(s) and/or inbox(s). Once associated, you will be required to submit well-formatted form-data when creating a bundle-registration or inbox registration.

List Form Field Sets

Endpoint

GET/form_field_sets

Return Object

FormFieldSet[]

Authorization Requirement

Available to all authenticated keys or sessions.

Request Parameters

ParameterDescription
user_id
int64
User ID. Provide a value of 0 to operate the current session's user.

Additional Arguments

Example Request

curl "https://app.files.com/api/rest/v1/form_field_sets.json?user_id=1" \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": 1,
    "title": "Sample Form Title",
    "form_layout": [
      1,
      2,
      3,
      4
    ],
    "form_fields": [
      {
        "id": 1,
        "label": "Sample Label",
        "required": true,
        "help_text": "Help Text",
        "field_type": "text",
        "options_for_select": [
          "red",
          "green",
          "blue"
        ],
        "default_option": "red",
        "form_field_set_id": 1
      }
    ],
    "skip_name": true,
    "skip_email": true,
    "skip_company": true,
    "in_use": true
  }
]

Show Form Field Set

Endpoint

GET/form_field_sets/{id}

Return Object

FormFieldSet

Authorization Requirement

Available to all authenticated keys or sessions.

Request Parameters

ParameterDescription
id
int64
Required
Form Field Set ID.

Example Request

curl https://app.files.com/api/rest/v1/form_field_sets/{id}.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "title": "Sample Form Title",
  "form_layout": [
    1,
    2,
    3,
    4
  ],
  "form_fields": [
    {
      "id": 1,
      "label": "Sample Label",
      "required": true,
      "help_text": "Help Text",
      "field_type": "text",
      "options_for_select": [
        "red",
        "green",
        "blue"
      ],
      "default_option": "red",
      "form_field_set_id": 1
    }
  ],
  "skip_name": true,
  "skip_email": true,
  "skip_company": true,
  "in_use": true
}

Create Form Field Set

Endpoint

POST/form_field_sets

Return Object

FormFieldSet

Authorization Requirement

Available to all authenticated keys or sessions.

Request Parameters

ParameterDescription
user_id
int64
User ID. Provide a value of 0 to operate the current session's user.
title
string
Title to be displayed
workspace_id
int64
Workspace ID
skip_email
boolean
Skip validating form email
skip_name
boolean
Skip validating form name
skip_company
boolean
Skip validating company
form_fields
array(object)

Example Request

curl https://app.files.com/api/rest/v1/form_field_sets.json \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"user_id":1,"title":"Sample Form Title","workspace_id":1,"skip_email":false,"skip_name":false,"skip_company":false,"form_fields":[{"label":"Sample Label","required":true,"help_text":"Help Text","field_type":"text","options_for_select":["red","green","blue"],"default_option":"red","form_field_set_id":1}]}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "title": "Sample Form Title",
  "form_layout": [
    1,
    2,
    3,
    4
  ],
  "form_fields": [
    {
      "id": 1,
      "label": "Sample Label",
      "required": true,
      "help_text": "Help Text",
      "field_type": "text",
      "options_for_select": [
        "red",
        "green",
        "blue"
      ],
      "default_option": "red",
      "form_field_set_id": 1
    }
  ],
  "skip_name": true,
  "skip_email": true,
  "skip_company": true,
  "in_use": true
}

Update Form Field Set

Endpoint

PATCH/form_field_sets/{id}

Return Object

FormFieldSet

Authorization Requirement

Available to all authenticated keys or sessions.

Request Parameters

ParameterDescription
id
int64
Required
Form Field Set ID.
title
string
Title to be displayed
workspace_id
int64
Workspace ID
skip_email
boolean
Skip validating form email
skip_name
boolean
Skip validating form name
skip_company
boolean
Skip validating company
form_fields
array(object)

Example Request

curl https://app.files.com/api/rest/v1/form_field_sets/{id}.json \
  -X PATCH \
  -H 'Content-Type: application/json' \
  -d '{"title":"Sample Form Title","workspace_id":1,"skip_email":false,"skip_name":false,"skip_company":false,"form_fields":[{"id":1,"label":"Sample Label","required":true,"help_text":"Help Text","field_type":"text","options_for_select":["red","green","blue"],"default_option":"red","form_field_set_id":1}]}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "title": "Sample Form Title",
  "form_layout": [
    1,
    2,
    3,
    4
  ],
  "form_fields": [
    {
      "id": 1,
      "label": "Sample Label",
      "required": true,
      "help_text": "Help Text",
      "field_type": "text",
      "options_for_select": [
        "red",
        "green",
        "blue"
      ],
      "default_option": "red",
      "form_field_set_id": 1
    }
  ],
  "skip_name": true,
  "skip_email": true,
  "skip_company": true,
  "in_use": true
}

Delete Form Field Set

Endpoint

DELETE/form_field_sets/{id}

Return Object

No return value.

Authorization Requirement

Available to all authenticated keys or sessions.

Request Parameters

ParameterDescription
id
int64
Required
Form Field Set ID.

Example Request

curl https://app.files.com/api/rest/v1/form_field_sets/{id}.json \
  -X DELETE \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

The FormFieldSet Object

Some of the endpoints above return a FormFieldSet object. The attributes of this object are listed below.

AttributeDescription
id
int64
Form field set id
title
string
Title to be displayed
form_layout
array(int64)
Layout of the form
form_fields
array(object)
Associated form fields
skip_name
boolean
Any associated InboxRegistrations or BundleRegistrations can be saved without providing name
skip_email
boolean
Any associated InboxRegistrations or BundleRegistrations can be saved without providing email
skip_company
boolean
Any associated InboxRegistrations or BundleRegistrations can be saved without providing company
in_use
boolean
Form Field Set is in use by an active Inbox / Bundle / Inbox Registration / Bundle Registration

Example FormFieldSet Object

{
  "id": 1,
  "title": "Sample Form Title",
  "form_layout": [
    1,
    2,
    3,
    4
  ],
  "form_fields": [
    {
      "id": 1,
      "label": "Sample Label",
      "required": true,
      "help_text": "Help Text",
      "field_type": "text",
      "options_for_select": [
        "red",
        "green",
        "blue"
      ],
      "default_option": "red",
      "form_field_set_id": 1
    }
  ],
  "skip_name": true,
  "skip_email": true,
  "skip_company": true,
  "in_use": true
}