The Send Data: Webhook Module is incredibly powerful. You can use this module to send (POST) data to other applications, like sending "A Bit About You" form data to Slack to share information about your new hire to the team! Not only can you share the data, but if you ask your new hires to upload a selfie - you could send this to slack too. 😎 Now that's true personalization at its finest.

Another example is sending the answers from a manager's IT Request to Jira or Service Now to help speed up that often-dreaded IT process.

Check out the bottom of the article to learn how to add Files to your webhooks.

Webhooks are an integration method to send out data to another application in use by your organization.

Let's take a quick look now. In this example, let's send the employees 'A Bit About You' section to Slack. 

Note: Before you begin the webhook process, you need to capture the data to update somewhere in that workflow prior to adding the Send Data: Webhook. Use a Form to capture the new data you want to send, and then save it. Now you'll be able to create your very own webhook!

Step 1: Start by clicking and dragging the Send Data module into the sequence you'd like to trigger this action. 

Step 2: Then, you'll be given three options:

  • Send Email

  • Send Webhook

  • Send Update-Value

Select the 'Send Webhook' option, and then click 'Start'.

Step 3: After you click Start, you'll see this screen below. This is where you can set up what data you want to send, and where that data is going. You may need assistance from your IT team for the technical details in the next steps.

First, you will have the option to drag data elements from the left side which will give you the ability to instantly generate a basic JSON payload for your webhook. Many systems might require a more complex payload and you will be able to customize it on the next step as well.

Step 4: Click Add Webhook to customize the following: Endpoint URL, Authentication, Headers, and Payload

You will need to enter the endpoint URL of the system that will be receiving the webhook, eg Slack or Jira. Next use the dropdown menu for Authentication (most commonly you will use Standard Authentication but Enboarder additionally supports OAuth for several popular systems). With standard authentication you may need to include an apikey in the Headers.

Some systems also require additional Header Keys/Values, and you can click the option "+ Add More" for as many Headers as needed.

Lastly, the Body section at the bottom is where you can generate and customize a JSON payload if required by the receiving system. The button which says "<T> Insert Text" allows you to include dynamic tokens within your JSON payload such as a new hire's first name. Enboarder will automatically populate these dynamic tokens for each time this webhook is sent within a workflow.


How to send Files through Webhooks

Introduction: We want to support file attachment in Send data web-hook module as well.

Technical requirements :

Ability to send an attachment in the below formats:

  • As a link with mime type and file name

  • As a base64 data with mime type, and name

  • As form data

UI Setup

Form setup :

There is no change in the form set up. You can attach file upload as before using the File upload module in your form:

Webhook setup:

Configure the endpoint URL of the destination system and any header request required by that API. To configure your file attachment, use the below as an example:

Configuring JSON payload

Here the tokens used are from the Enboarder Form:

{
"file": "{{enb_func_file_link(form / upload_documents / uploadfile)}}",
"name": "{{account_name}}",
"candidate name": "{{newhire_firstname}}"
}

Explanation of file function :

The two types of functions we are supporting now are:

  • Add Base 64 data (Default)

  • Add link

Add base 64:

Below, XXXXXXXX is a file attachment token added using the insert text button. This default mode and will work even function not used in payload.

{{enb_func_file_base64(XXXXXXXX)}}

This function adds File as base64 in the below format:

{
"name": "Local CSR",
"candidate name": "Sammpy",
"file": {
"name": "WeChat-messagesend.jpg",
"mimetype": "image/jpeg",
"body": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAARCAIzAosDASIAAhEBAxEB/8QAHQABAQADAQEBAQEAAAAAAAAAAAcFBggECQMCAf
/EAE8QAAAGAgECAgYHBgMGAgkDBQABAgMEBQYHEQgSEyEUGCJWl9UVFhcxV1iVIzI4QXe1CVFhGSQzQqbUN3ElNENTdoGFkbYmcrRSYnOSs//EABQBAQAAAAAAAAAAAAAAAAAAAAD/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwD6pgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/h11phs3XnUNoT96lKIiL/wCZj+wAAAAAAAAAAAAAAAAAAAAAAH896CWTZrLuMuSTz58AP6AAAAAAAAAAAAAAAAA"
}
}

Add link:

Below, XXXXXXXX is file attachment token added using the insert text button:

{{enb_func_file_link(XXXXXXXX)}}

This function adds the File as a link in the below format:

{
"name": "Local CSR",
"candidate name": "Sammpy",
"file": {
"name": "WeChat-messagesend.jpg",
"mimetype": "image/jpeg",
"path": "https://localhost:9000/filedownload/attach?key=e61fbe495aa974bd9bf918150a4b03612687a16c291c5ecafbd0a2bac9463e367c1df36d8c5bcbd88b69c9599b7e57b1d2e741680577687eb78942e3d078a05c865e1ae7f98e4a885d5461ea36eb62588a4aa28a2fd35478bc430be5547b6f2fa44060f5acda81c7595f2b7885231b92cb7a0fe99920d6b9977e09b9d32213ab6e2e80d235b29cb7acfe95580ad794e260fb9c4431d17b4a6c7f429b11c8e7ab0b24b012c77f64923820328223c00879391438e82a945cd616819b54371185a6ecc27ebd2b8074aa604f571a8b1e51426125e3382dba217ee99c7eecefa9de23dd2d5701cd09ec9aba7787a99f78461398a60398c5c39b1f2f529c1df8f13873a8a25f129457fc0cf22885dfb449a368"
}
}

Send attachment as Multipart form attachment

If you want to send data as multipart, then you need to select “Export JSON as form-data” format in the webhook for form data:

If you select this, we convert all form data and send it to the webhook configured. The file will be sent as multipart Data.

For example, If you want to add an attachment to Jira Issue using their API, you need to send info in the form data:

Mehtod - POST 
URL - {{Jira server URL }}/rest/api/3/issue/{issueIdOrKey}/attachments

Webhook Payload:
{
"file": "{{form / upload_documents / uploadfile}}",
}

That's it! All done.

Start a chat with us by clicking the ? button in the top right of any Enboarder page if you have any questions about this.

Did this answer your question?