CTA Get Fields (optional)¶
This webhook is executed synchronously upon creating a CTA instance of a Form CTA Type. If the webhook fails, the CTA creation is aborted.
The event can be triggered manually during the Create CTA wizard on the Layout tab, managing the Form Fields, each time that you try to add a new field using the Field Name Integration input. If the webhook for this event has not being defined, the Field Name Integration input will not be displayed, however, you’ll be able to add arbitrary Form Fields not tied to the Integration. You will be able to add arbitrary Form Fields regardless if the webhook for this event has been defined or not.
The event identifier is cta_get_fields
.
Webhook Request¶
Body Parameters | Type | Description |
---|---|---|
event | String | The event identifier, cta_get_fields |
ip_address | String | The IP address of the user triggering the event |
occurred_at | String | The date and time the event occurred in ISO 8601 format |
user_id | Integer | The unique identifier of the user triggering the event |
account_id | Integer | The unique identifier of the account |
cta_id | Integer | The unique identifier of the CTA |
hub_id | Integer | The unique identifier of the Hub to which the CTA belongs to |
Sample request:
POST /ICl8ohgw5f5XDCRDSsz HTTP/1.1
Host: putsreq.com
Content-Type: application/json
Accept: application/json
{
"event": "cta_get_fields",
"ip_address": "10.5.5.6",
"occurred_at": "2016-05-31T10:56:22-04:00",
"user_id": 8227,
"account_id": 8227,
"cta_id": 10192,
"hub_id": 4003
}
Webhook Response¶
The response’s JSON must be an object with key “data” referencing an array of Form Fields, defined as it follows:
Body Parameters | Properties | Type | Description |
---|---|---|---|
display_name | String | The display name | |
html_name | String | The HTML name | |
required | Boolean | Whether the Form Field is required or not. Defaults to false | |
active | Boolean | Whether the Form Field is active (i.e.: displayed to the end-user) or not. Defaults to true | |
locked | Boolean | Whether the Form Field is locked (i.e.: not editable) or not. Defaults to false | |
control_type | String | The control type. One of ‘text’, ‘select’, ‘checkbox’ | |
values | Object | Applies only when control_type is ‘select’ | |
-> | label | String | The display name |
-> | value | String | The value of the option |
Sample response:
HTTP/1.1 201 CREATED
Content-Type: application/json
{
"data": [
{
"display_name": "First Name",
"html_name": "first_name",
"control_type": "text",
"required": true
},
{
"display_name": "Last Name",
"html_name": "last_name",
"control_type": "text"
},
{
"display_name": "Email",
"html_name": "email_address",
"control_type": "text",
"required": true
},
{
"display_name": "Favourite Ice Cream",
"html_name": "favourite_ice_cream",
"control_type": "select",
"values": [{
"label": "Dark Chocolate",
"value": "dark_chocolate"
}, {
"label": "Vanilla",
"value": "vanilla"
}]
},
{
"display_name": "Send me more updates!",
"html_name": "opt_in_flag",
"control_type": "checkbox"
}
]
}