Webhooks for Workflows

Enable webhooks to send response data directly to your other systems.

Robert Sterling avatar
Written by Robert Sterling
Updated over a week ago

Integrate and automate your tech stack with Webhooks for Workflows. When enabled, response data can be sent directly from Workflows into your other platforms.

This is a managed feature, if you would like Webhooks for Worklfows enabled at your site, please contact your Sine representative or get in touch using the chat button in the bottom right corner.

Once enabled, webhooks are managed on a per-workflow basis.

Setting up a webhook

To get started, navigate to the workflow that you want to trigger the webhook. Then select Edit and scroll to the bottom of the Settings tab, where you will find the Webhooks section.

To activate the webhook, select Edit. This will bring up the setup modal. Here you will enter the following:

URL
The URL should point to a HTTP/REST endpoint configured to accept POST requests. The format of the data sent to this endpoint is outlined below. Please note, the URL field is currently limited to 2000 characters.

API Key

This API Key can be used to provide an identifier that Sine will pass through in the x-sine-auth header on requests. Use this key to verify that requests are coming from Sine. If no API key is required by the third-party application, enter any placeholder information.

Trigger Webhook on

Select when the webhook will trigger using the checkboxes. A webhook can be triggered when a response is submitted, approved, rejected or closed.

Once completed, select Save to activate the webhook.

Request specification

The following applies to any configured webhook endpoints:

  • Request will always be a POST.

  • Request will be application/JSON.

  • Responses must be application/JSON.

  • Responses must be a 200.

  • Sine is a cloud-based service running on AWS. Integration endpoints must be open to the internet and use the x-sine-auth header for authentication.

Data format

Data supplied by the webhook can be loosely grouped into two categories, metadata and form answers.

Metadata

This includes information other than workflow questions and answers and broadly includes:

  • User details

  • Workflow information - e.g. Workflow Name, Start Date, End Date, Expiry Date

  • Site information

  • Auto approval flag

Form questions and answers

The form answers are provided within the “forms” section of the data object. Currently, the following question types are included in webhook form answers.

  • Text input

  • Datepicker

  • Multiple choice

  • Yes/no

  • File upload (Existence of upload only)

  • Signature (Existence of signature only)

Example data

The following snippet is an example of all of the data that is currently included for webhooks.

{
"data": {
"responseId": "628ecf732060a400065fbd90",
"teamId": "4615ee2b-c6bd-4945-b969-9f5e0c7bd3be",
"workflowId": "5d2d2a5387d25b0007f055fb",
"workflowName": "Quick Workflow #2",
"state": "pending",
"startDate": "2022-06-07T06:13:16.977Z",
"endDate": "2022-07-05T06:13:16.976Z",
"expiryDate": "2022-07-05T06:13:16.976Z",
"sites": [
{
"id": "0de17205-1a7a-4790-9ff4-573bedc202ba",
"name": "Main Office",
"address": "100 Main Road, Adelaide SA, Australia"
},
{
"id": "9cb38fe4-f0ea-4296-8fc2-291c201bce8d",
"name": "Warehouse",
"address": "92 Main Road, Adelaide SA, Australia"
}
],
"userDetails": {
"firstName": "Test",
"lastName": "User",
"email": "[email protected]",
"company": "sine",
"mobile": "+61422333444"
},
"isAutoApproved": false,
"forms": [
{
"type": "response",
"answers": [
{
"_id": "626f7177aae33471a74a2be6",
"type": "datepicker",
"name": "A Date Question",
"value": "2022-05-28"
},
{
"_id": "628ecf35624fa98693be72ac",
"type": "expandable-input",
"name": "A Text Question",
"value": "text answer"
},
{
"_id": "628ecf3c624fa98693be72ad",
"type": "yesno",
"name": "A Yes/No question",
"value": "yes"
},
{
"_id": "628ecf48624fa98693be72ae",
"type": "multiple-choice",
"name": "A Multiple Choice Question",
"value": ["Option 1", "Option 2"]
},
{
"_id": "629eec097546a2f5d2954723",
"type": "document-upload",
"name": "A Document Question",
"hasDocument": true
},
{
"_id": "629eec1d7546a2f5d2954724",
"type": "signature",
"name": "A Signature Question",
"hasSignature": true
}
]
}
]
},
"meta": {
"action": {
"type": "accept",
"userDetails": {
"email": "[email protected]",
"firstName": "Blah",
"lastName": "Smith",
"message": "Please ask for Linda at reception.",
"date": "2022-10-06T02:06:12.178Z"
}
}
},
}

Did this answer your question?