On the Settings page under “Developers” there is a new option for “Webhooks” accessible by super admins, and anyone with access to Settings -> API.From here it will list any webhooks you’ve already created and you can add a new one using the add button, how handy!
When adding a webhook you’ll see this screen:
The current options explained:
-
Payload URL: Where should we send the data?
-
Which content types should we send events about?: What events should we send information about?
-
Enable this webhook?: Should this be turned on or off?
For reference, “Event Type” or “Content Type” is the same thing. Basically it just refers to actions that could happen in the system.Currently we will send webhook data when people are added into a people flow step, or when a form submission is submitted.
Example Payload Data
The Payload data will vary depending on what type of event is triggering the hook. Currently we have 2 Webhook types that can be triggered
- peopleflow:member:add - When a person is added into a people flow step.
- form:submission:create - When a form submission is created
form:submission:create
The Payload for Form Submissions will look like this:
{
"type": "form:submission:create",
"submission_id": "UUID",
"submission_data": [
{
... Submission Data ...,
"submission_status": "Char",
"person_id": "UUID"
},
... Repeat for each segment in the submission.
]
}
The “Submission Status” field will appear in each segment in the submission, and can be one of the following:
- p - Pending
- a - Approved
- d - Declined
{
"type": "form:submission:create",
"submission_id": "c44a0e60-1973-44c5-aacd-5d37d690c699",
"submission_data": [
{
"first_name": {
"label": "First Name",
"value": "Stewart"
},
"preferred_name": {
"label": "Preferred Name",
"value": "Stew"
},
"last_name": {
"label": "Last Name",
"value": "Polley"
},
"birthday": {
"label": "Date of Birth",
"value": false
},
"email": {
"label": "Email Address",
"value": "support@tithe.ly"
},
"phone_number": {
"label": "Phone Number",
"value": "0731071682"
},
"mobile_number": {
"label": "Mobile Number",
"value": "0731071682"
},
"formscustom_a4612c08-21f6-4514-a9a3-c9c813970975": {
"label": "Custom Form Field",
"value": "",
"forms_custom_id": "a4612c08-21f6-4514-a9a3-c9c813970975"
},
"ticket_type_id": "1f0fecb0-db3d-4869-9fda-eb4f3abafe14", # Only for Event Registration Forms
"ticket_id": 3, # Only for Event Registration Forms
"submission_status": "p"
}
]
}
The payload for someone being added into a People Flow is a lot more basic and looks like the following:
{
"type": "peopleflow:member:add",
"person_id": "UUID",
"step_id": "UUID",
"due_date": "ISO 8601 Compliant DateTime"
}
{
"type": "peopleflow:member:add",
"person_id": "df087e67-7e80-4993-b8a7-abc146689fe4",
"step_id": "df087e67-7e80-4993-b8a7-abc146689fe4",
"due_date": "2020-07-07T02:31:57Z"
}