Forms

Introduction

The Form is the base component which needs to be configured to provide Forms to an User. It keeps general information about the Form behaviour and settings.

Usually there is at least one FormField attached to a Form.

Model Definition

Alias

form

Relations

Relation
Key
Type
Relation Field(s)

user

Belongs to

user_id

icon

Belongs to

icon_id

formFields

Has many

form_fields.form_id

formMessages

Has many

form_messages.form_id

layouts

Has many

layouts.layoutable_type, layouts.layoutable_id

Computed Properties

  • hash - The hashed id of the Form

Traits

List

Get a list of all Forms the current authenticated User is allowed to view.

Definition

GET /api/forms

Example Request

Example Response

Show

Show a single Form by id.

Definition

GET /api/forms/{id}

Example Request

Example Response

Send

Send an existing Form by id.

By sending a Form, the FormFieldValidations are triggered. These FormFieldValidations ensure that the input of the FormMessageFields match the expected input for the used FormFields.

Definition

POST /api/forms/{id}/send

Request Keys

Key
Type
Default
Description

form_id **

integer

-

The related Form

Keys with * are required. Keys with ** are normalized to the information given by the route.


Example Request

Example Response

[Adm.] List

Get a list of all Forms.

Definition

GET /api/administration/forms

Example Request

Example Response

[Adm.] Create

Create a new Form.

Definition

POST /api/administration/forms

Request Keys

Key
Type
Default
Description

icon_id

integer

70

The related Icon

name *

string

-

The name of the Form (unique by all Forms)

slug

string

Slugged name

The slugged name of the Form (unique by all Forms)

recipient *

email

-

Array of the email address(es) to receive the FormMessage (separated by commas)

subject

string

Default value

The subject of the Form

email_template

string

Default value

The template used to generate the FormMessage body

always_send_to_recipient

boolean

false

Whether to send the FormMessage also to the recipient when a recipient-select FormField is present in the Form

send_empty_fields

boolean

false

Whether empty FormMessageFields should be present in the FormMessage body

send_description_fields

boolean

false

Whether description FormFields should be present in the FormMessage body

has_personal_information

boolean

false

Whether the FormMessage is shown to Group Accounts

user_confirmation_required

boolean

true

Whether a confirmation of a specific User is required in Group Accounts

request_receipt

boolean

false

Whether the recipients of the FormMessage should confirm the receipt

request_confirmation

boolean

false

Whether the recipients of the FormMessage should accept or decline the content

sort_number

integer

Current highest +1

The index of the Form

Keys with * are required.

Example Request

Example Response

[Adm.] Update

Update an existing Form by id.

Definition

PUT /api/administration/forms/{id}

Request Keys

Key
Type
Description

icon_id

integer

The related Icon

name *

string

The name of the Form (unique by all Forms)

slug

string

The slugged name of the Form (unique by all Forms)

recipient *

email

Array of the email address(es) to receive the FormMessage (separated by commas)

subject

string

The subject of the Form

email_template

string

The template used to generate the FormMessage body

always_send_to_recipient

boolean

Whether to send the FormMessage also to the recipient when a recipient-select FormField is present in the Form

send_empty_fields

boolean

Whether empty FormMessageFields should be present in the FormMessage body

send_description_fields

boolean

Whether description FormFields should be present in the FormMessage body

has_personal_information

boolean

Whether the FormMessage is shown to Group Accounts

user_confirmation_required

boolean

Whether a confirmation of a specific User is required in Group Accounts

request_receipt

boolean

Whether the recipients of the FormMessage should confirm the receipt

request_confirmation

boolean

Whether the recipients of the FormMessage should accept or decline the content

sort_number

integer

The index of the Form

Example Request

Example Response

[Adm.] Delete

Delete an existing Form by id.

Definition

DELETE /api/administration/forms/{id}

Example Request

Example Response

Last updated