Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Documentation for doForms Webhooks can be used to notify your system any time a record is created, updated, deleted, or a dispatch status is changed.

Adding a webhook takes two steps:

1. Add a webhook connection

  1. Open Manage > Integrations > Connections.

  2. Select Add on the action menu.

  3. Set Type to Webhook and fill out the URLs to notify when records are added, edited, deleted, or their status changes. You can also specify up to four HTTP headers to send with every request.

    Image Removed

  4. Click Add.

2. Assign the connection to a web service

  1. Open Manage > Integrations > Web services.

  2. Select Set Target on the action menu of an existing web service.

  3. Select your connection in the Connection field. You can also specify which record events should trigger a webhook notification.

    Image Removed

  4. Click Add.

Request to your system

Any time records are added, edited, deleted, or their dispatch status is changed using the form and project of a web service with a web hook target, the following web hook notification will be sent.

...

Body

...

Notes

...

POST

...

{
"key":"abc123”,
“customerKey”: “cde123”,
“submissionKey”:”def456”,
"webserviceId":"acme$$1234$$Published$$5678",
"event":"create",
“status”:”new”,
"createTime": "2019-08-20T16:55:20.130Z"
}

...

  • key is the key of the web hook notification. The same key value will be sent in any retries.

  • customerKey is the key of the customer account.

  • dispatchKey (not shown) is the key of the dispatch record. Included if a dispatch triggered the notification, or if a dispatch was used to create a new submission.

  • submissionKey is the key of the submission record. Included if a submission triggered the notification.

  • webserviceId is the identifier of the web service that triggered the notification.

  • event is one of “create”, “update”, “delete”, “status”:

    • create - The record was added.

    • update - The record was changed.

    • delete - The record was removed.

    • status - The status of the dispatch record changed.

  • status is “new” for the first request and “retry” for any retries.

  • dispatchStatus (not shown) is the new status of a dispatch record.

  • createTime is the UTC date/time when the notification was created.

Response from your system

Your system should respond to the webhook notification in one of the following ways:

...

Code

...

Body

...

Notes

...

2xx

...

{
“status”:”failed”,
“message”:”Error for the user”
}

...

  • status can be one of “received”, “completed”, “failed”.

  • message (optional) is any message for the end user. Maximum 1,000 characters.

  • The request will not be retried.

...

2xx

...

Empty

...

  • The status will be recorded as “received”.

  • The request will not be retried.

...

5xx

...

Ignored

...

  • The status will be recorded as “retry”.

  • The request will be retried up to 3 additional times using an exponential back off beginning with 2 minutes (2, 6 and 14 minutes after the initial request).

  • Read and connection timeouts are 3 seconds. A slower response will result in a retry.

  • If all retries fail, the status will be recorded as “rejected”.

...

Other

...

Ignored

...

  • The status will be recorded as “rejected”.

  • The request will not be retried.

Usage

Immediate response

If it is possible to process the record in under 3 seconds, respond with 200 OK and the final status of the process (“completed” or “failed”) in the response body.

Delayed response

If more than 3 seconds is required to process the record, respond with 200 OK and an empty body to the initial request. The status of the webhook notification will be set to “received”.

Then, when the record processing is complete, send the following request using the key value from the original notification request:

/notifications/{key}

...

Body

...

Notes

...

PUT

...

{
“status”:”completed”,
“message”:”One record updated.”
}

...

  • status can be one of “completed”, “failed”.

  • message (optional) is any message for the end user. Maximum 1,000 characters.

...

Response

...

{
"key": "abc123",
"submissionKey": "def456",
“webServiceId”:"acme$$1234$$Published$$5678",
"event": "create",
"status": "completed",
"message": "One record updated."
}

...

found here:

https://support.doforms.com/hc/en-us/articles/360061840433-Webhooks