Fields
A Field represents a single Field of data (for example a Product Rating
) to be applied to an entity. All Fields have a field_type (string
, integer
, boolean
, date
or relationship
), a default value and an optional set of validation rules.
There is a hard limit of 100 fields per flow
The Field Object
Attribute | Type | Description |
|
| The unique identifier for this field |
|
| Represents the type of object being returned |
|
| The name of the field |
|
| A unique slug identifier for the field |
|
| This field is immutable and cannot be updated. The type of field - |
|
| |
|
| Any description for this field |
|
|
|
|
|
|
|
| A default value if none is supplied and field is not required |
|
| If this field is enabled on the flow this should be |
|
| Denotes the order in which this field is returned relative to the rest of the flow fields |
|
| A relationship object to link this field to a flow |
|
| Hide this field from responses if the value is |
Get all Fields
GET
https://api.moltin.com/v2/fields
Headers
Name | Type | Description |
---|---|---|
Authorization | string | The Bearer token to grant access to the API |
Get all Fields by Flow
GET
https://api.moltin.com/v2/flows/:slug/fields
Path Parameters
Name | Type | Description |
---|---|---|
slug | string | The slug of the Flow you wish to return fields for |
Headers
Name | Type | Description |
---|---|---|
Authorization | string | The Bearer token to grant access to the API |
Get a Field
GET
https://api.moltin.com/v2/fields/:id
Path Parameters
Name | Type | Description |
---|---|---|
id | string | The ID for the field you are requesting |
Headers
Name | Type | Description |
---|---|---|
Authorization | string | The Bearer token to grant access to the API |
Create a Field
POST
https://api.moltin.com/v2/fields
Headers
Name | Type | Description |
---|---|---|
Authorization | string | The Bearer token to grant access to the API |
Request Body
Name | Type | Description |
---|---|---|
type | string | Represents the type of object being returned |
name | string | The name of the field |
slug | string | A unique slug identifier for the field |
field_type | string | The type of field - |
description | string | Any description for this field |
required | boolean |
|
unique | boolean |
|
default | string | A default value if none is supplied and field is not required |
enabled | boolean | If this field is enabled on the flow this should be |
order | integer | Denotes the order in which this field is returned relative to the rest of the flow fields |
omit_null | boolean | Omit this field from responses if the value is |
relationships | object | A relationship object to link this field to a flow. Please note that in this instance, you can link a field to only one flow. |
You cannot update the field_type
once a Field has been created.
Update a Field
PUT
https://api.moltin.com/v2/fields/:id
Path Parameters
Name | Type | Description |
---|---|---|
id | string | The ID for the field you are requesting to be updated |
Headers
Name | Type | Description |
---|---|---|
Authorization | string | The Bearer token to grant access to the API |
Request Body
Name | Type | Description |
---|---|---|
type | string | Represents the type of object being returned |
name | string | The name of the field |
slug | string | A unique slug identifier for the field |
description | string | Any description for this field |
required | boolean |
|
unique | boolean |
|
default | string | A default value if none is supplied and field is not required |
enabled | boolean | If this field is enabled on the flow this should be |
order | integer | Denotes the order in which this field is returned relative to the rest of the flow fields |
omit_null | boolean | Omit this field from responses if the value is |
relationships | object | A relationship object to link this field to a flow |
Delete a Field
DELETE
https://api.moltin.com/v2/fields/:id
Path Parameters
Name | Type | Description |
---|---|---|
id | string | The ID fir the field you are requesting to be deleted |
Headers
Name | Type | Description |
---|---|---|
Authorization | string | The Bearer token to grant access to the API |
Last updated