Built-in apps

Webhooks

21min
with the webhooks app in make, you can create custom webhooks, custom mailhooks, and webhook responses custom webhook module to create a custom webhook, you can add the custom webhook module in a {{scenario singular lowercase}} each {{scenario singular lowercase}} must use its own webhook you can not use one webhook in multiple {{scenario plural lowercase}} adding a custom webhook to your {{scenario singular lowercase}} insert the custom webhook module from the webhooks app in the module's settings, click add set the webhook's name and other settings, then click save {{product name}} generates a url and starts listening for requests to this url send a request to this url to have {{product name}} automatically determine the data structure for this webhook see setting up webhook data structure below for more details you can access the webhook's details and change the webhook's settings in the webhooks section in the left menu setting up webhook data structure optionally, you can let {{product name}} know what data structure to expect in the webhook request payload {{product name}} can use data structures to validate the incoming data if you do not set up a data structure, {{product name}} will pass the incoming data to subsequent modules in your {{scenario singular lowercase}} without any validation to enable validating incoming data, set up the webhook's data structure in one of the following ways create a new data structure manually in the data structures section use an existing data structure you can also use the following methods to let {{product name}} know what data structure to expect note that these methods do not enable data validation the data structure set up in this way only helps with mapping the webhook data to subsequent modules in your {{scenario singular lowercase}} create a data structure immediately after creating the webhook by calling the webhook url with sample data in the request body re determine the data structure of an existing webhook going to the webhook module settings, clicking re determine data structure , and calling the webhook url with sample data in the request body if you call the webhook url to automatically determine or re determine the data structure, {{product name}} does not create a reusable data structure in the data structures section the data structure determined in this way is stored internally with the particular webhook in this case, {{product name}} does not validate incoming data supported incoming data formats {{product name}} supports the following formats of incoming data query string form data json if a webhook receives data in both the query string and either form data or json data at the same time, the system combines the data into a single bundle if the request contains duplicate data in different formats, the query string takes precedence and overwrites the data that was received in the other formats we recommend you do not duplicate data in query strings, form data, and json query string get https //hook make com/yourunique32characterslongstring?name=make\&amp;job=automate form data post https //hook make com/yourunique32characterslongstring content type application/x www form urlencoded name=integrobot\&job=automate multipart post https //hook make com/yourunique32characterslongstring content type multipart/form data; boundary= generatedboundary \ generatedboundary content disposition form data; name="file"; filename="file txt" content type text/plain content of file txt \ generatedboundary content disposition form data; name="name" make \ generatedboundary in order to receive files encoded with multipart/form data , it is necessary to configure a data structure with a collection type field that contains the nested fields name , mime and data the field name is a text type and contains the name of the uploaded file the mime is a text type and contains a file in the \[mime] format https //en wikipedia org/wiki/mime the field data is a buffer type and contains binary data for the file being transferred json post https //hook make com/yourunique32characterslongstring content type application/json {"name" "integrobot", "job" "automate"} to access the original json, open the webhook's settings and enable the json pass through option the maximum allowed webhook's payload size ( content length ) is 5 mb (5 242 880 bytes) regardless of the subscription tier webhook headers to access the webhook's headers, enable the get request headers option in the webhook's setup you can then extract a particular header value with the combination of map() & get() functions the example below shows a formula that extracts the value of the authorization header from the headers\[] array the formula is used in a filter that compares the extracted value with the given text to pass only webhooks if there is a match editing custom webhook settings to adjust a custom webhook's settings, click webhooks in the left menu and edit a webhook this is only applicable for make's custom webhooks module setting description ip restrictions a allow list of ip addresses delimited by comma only webhook requests that come from the specified ips will be processed use cidr notation to allow list a subnet leave empty if you want to allow requests from all ips data structure select an existing data structure or create a new data structure for the webhook {{product name}} will use the data structure to validate the incoming data requests that don't pass validation will be rejected with http status code 400 get request headers extracts headers data from the webhook request and makes the data available for mapping in the scenario get request http method extracts the http method from the request and makes the method available for mapping in the scenario json pass through passes json payloads to subsequent modules in the scenario as a text string, as opposed to breaking the payload down into mappable fields custom mailhook module custom mailhook is an instant trigger module that can be triggered by sending an email to the email address generated by this module the maximum size of an email, including its attachments, that you send to a mailhook is 25 mb example of use the custom mailhook module will monitor your incoming emails without the need to have a scheduled run of the {{scenario singular lowercase}} add the custom mailhook to your {{scenario singular lowercase}} (webhooks > custom mailhook) generate a mailhook email address, and copy the address to the clipboard save and run the {{scenario singular lowercase}} open your email account settings, and configure forwarding use the email address generated by the custom mailhook module in step 2 (above) as the forwarding address for gmail click the cogwheel in the top right corner, and then click see all settings open the forwarding and pop/imap tab click the add a forwarding address button enter the email address you have generated and copied in step 2 above, and click next after that, a popup window will appear click proceed a confirmation link has been sent to your mailhook run the custom mailhook module to see this code in the output under bundle > text if you use gmail for work or school, you don't need to verify the forwarding address enable the forwarding, and save changes add other desired modules to the {{scenario singular lowercase}} then save and activate the {{scenario singular lowercase}} now, every time a new email is received in your email account, the custom mailhook module in your {{product name}} {{scenario singular lowercase}} is triggered and receives the email message data the sender and various recipient addresses (to cc and bcc ) are resolved in the data structure of the incoming mail reply to can be found in the header section webhook response module the default response to a webhook call contains just a simple text, "accepted" the response is returned to the webhook's caller right away during the execution of the custom webhook module you can easily test it like this place the custom webhook module in your {{scenario singular lowercase}} add a new webhook in the module's configuration copy the webhook's url to your clipboard run the {{scenario singular lowercase}} the custom webhook module should be waiting for the webhook call (see on the right) open a new browser window, paste the copied url in the address bar and press enter the custom webhook module will be triggered and the browser will display the following page these are default responses when the {{scenario singular lowercase}} does not contain the webhook response module http status code body webhook accepted in the queue 200 accepted webhook queue full 400 queue is full if you wish to customize the webhook's response, employ the module webhook response the configuration of the module contains two fields status and body the status field should contain http response status codes https //en wikipedia org/wiki/list of http status codes like 2xx for success (e g 200 for ok), 3xx for redirection (e g 307 for temporary redirect), 4xx for client errors (e g 400 for bad request), etc the body field should contain anything that will be accepted by the webhook's call it can be a simple text, html, xml, json, etc it is advisable to set the content type header to the corresponding mime type https //en wikipedia org/wiki/media type text/plain for plain text, text/html for html, application/json for json, application/xml for xml, etc these are additional default responses when the {{product name}} does contain the webhook response module http status code body {{scenario singular}} encounters an error 500 {{scenario singular}} failed to complete the timeout for sending a response is 180 seconds if the response is not available within that period, {{product name}} returns a '200 accepted' status html response example configure the webhook response module as follows status 2xx success http status code, https //en wikipedia org/wiki/list of http status codes#2xx success e g 200 body html code, e g \<!doctype html> \<html lang="en"> \<head> \<meta charset="utf 8"> \<title>thank you!\</title> \</head> \<body>thank you, {{1 name}}, for your request! \</body> \</html> custom headers key content type value text/html it will produce an html response that will be displayed like this in a web browser redirect example configure the webhook response module as follows status 3xx redirection http status code https //en wikipedia org/wiki/url redirection#http status codes 3xx , e g 303 custom headers key location value the url you would like to redirect to troubleshooting webhooks missing items in the mapping panel if some items are missing in the mapping panel in the setup of the modules following the webhooks > custom webhook module, click the webhooks > custom webhook module to open its setup and click re determine data structure then follow the steps described in the section webhooks docid 1yhunj8jvzyxip9cf3ps1