How to Set up Webhooks

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
You should never see d when it’s coming from a form submission being created, but it may appear in future payload types.If the form is for an event registration, it will also have two fields for “ticket_type_id” being a UUID for a particular type type, and “ticket_id” being the ID of the ticket that the submission is tied to.An example payload with Event Registration data attached would be the following
{
"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"
}
]
}
peopleflow:member:add

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"
}
An example with data would be the following:
{
"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"
}
 
If you have any questions about this process, please reach out to our Support team at Support@tithe.ly :)

 

Was this article helpful?
0 out of 0 found this helpful