Webhooks

In most cases, Cognito Forms handles everything you need to manage your forms and entries. On the rare occasion when you might need a bit more control, we offer webhooks. Webhooks allow Cognito Forms to communicate with a third-party system (or internally developed application) in order to post new entries as they are submitted. All entry data is included – there is no limit to the number of fields that you can send.

JSON

JSON, or JavaScript Object Notation, is a common data interchange format that is very popular on the web. It allows different systems (or applications) to communicate data in a fast and efficient manner. The below example illustrates a JSON payload describing a user:

{  
    "id":"12345",  
    "email":"test@test.com",  
    "name":"Test User",  
    "date_created":"2015-01-20T16:42.000Z"  
}

Webhooks

Webhooks are a set of callbacks created within an application which enable that application to send data to a third-party based upon an event. So, for example, you may have a system that you want to be notified whenever a new entry is submitted to your form.

Enabling webhooks in Cognito Forms

Organizations on the Pro, Team, and Enterprise plans have the ability to transfer uploaded files via JSON.

Post JSON data to a website.

In your form’s Submission Settings, check the box next to Post JSON data to a website?

  • Submit Entry Endpoint: This is the destination URL for the webhook. New entries (i.e. an entry that changes status from Incomplete to Submitted) will be posted as JSON to this endpoint.

  • Update Entry Endpoint: This is the destination URL for the webhook. Updated entries (i.e. an entry that is updated when the status is not Incomplete) will be posted as JSON to this endpoint.

File Uploads / Generated Documents

File links sent through JSON are only valid for a short period of time (about 30 minutes or less), so make sure that you have a method of capturing and downloading files before they expire.

Examples

The following examples illustrate configuring and consuming data from Cognito Forms. They are not necessarily meant to be used in Production, but more as guidance.

Viewing a Post from Cognito Forms

In this example, we’re going to illustrate how one may view data as it is sent from Cognito Forms. In order to do this, we’re going to use a third-party service which allows developers to intercept posts to endpoints.

  1. Navigate to https://webhook.site
  2. Select and copy the automatically generated unique URL (or create a new URL).
  3. Find Post JSON data to a website under Submission Settings in the form builder and paste the URL into the Submit Entry Endpoint option. Save your form.
  4. View your form and submit an entry.
  5. Refresh the page at https://webhook.site You should see the raw form data:

Raw data in Webhook Tester.

Sending generated documents from Cognito Forms

Create JSON webhooks to push generated documents into custom systems. When communicating data, entry documents will be listed as according to their template ID (located in the top right hand corner of the Manage Dialog Templates dialog). For example, Template ID:1 becomes Document1.

{  
  "id":"12345",  
  "email":"test@test.com",  
  "name":"Test User",  
  "date_created":"2015-01-20T16:42.000Z"  
  "Document1": "http://cognitoforms.com/d/32k4bb324bhj2l4jkbkjbgcode=rnfrj34WGlqkvHrN68Vt7C4"
  "Document2": "http://cognitoforms.com/d/45jgherhhhrfe333nnkbkjbgcode=HYzrT8wASVGLNkfrle34"
}