This how-to guide demonstrates how to configure an application to consume payloads using webhooks, using SendGrid to send an email when the payload is complete. For this configuration, you'll need a Postback module that listens for the Google Forms webhook.
Configure the Postback Module
Begin by creating a Postback module that runs when it receives the webhook request. When finished, it sends an email with the contents of the Google Form. To use a webhook, you need to set up an API module.
These instructions assume you have a workspace open, saved, and with a title.
To create an API module in your application:
At the top right of your Application page, click + Create New.
Select Module. The Create Module modal displays.
In the Module Name* field, enter
postbackConsumePayloadModule.From the Module Type* drop-down, select API.
Click Create.
By default, the API module contains four Panel components to help with an API setup: panelInfo, panelRequest, panelResponse, and panelConfig.
Update the panelInfo Panel Component
Here you'll update the panelInfo Panel component.
Update the description HTML Element Component
The panelInfo Panel component contains an HTML Element component that describes its purpose. You can update this component to display any information you want when building or using the webhook.
In the
panelInfoPanel component, hover over thedescriptionHTML Element component.A 5-button toolbar displays above the component on hover-over.
Using the toolbar, click the
(Settings) button.In the Content field, enter
Postback module to recive webhooks from Google Forms and send Email for each response..Click the Save Component.
Update the method Hidden Component
In the
panelInfoPanel component, hover over themethodHidden component.A 5-button toolbar displays above the component on hover-over.
Using the toolbar, click the
(Settings) button.In the Default Value field, enter
POST.Click Save Component.
Update the panelRequest Panel Component
In the
panelRequestPanel component, hover over to therequestParameterHidden component.A 5-button toolbar displays above the component on hover-over.
Using the toolbar, click the
(Settings) button.In the Property ID and Label Text fields, enter
_request.Set Store Data in Database
(ON).Click Save & Close.
Configure the panelConfig Panel Component
Now, configure a Hidden component in the panelConfig Panel component.
Configure a Hidden Component
Drag and drop a Hidden component inside the
panelConfigPanel component.In the Property ID and Label Text fields, enter
answerText.In the Default Value field, enter
Default.Click Save Component.
Configure the Data Workflow Component
Next, configure a Data Workflow component that receives the request from your Google Form and outputs it into a Hidden component.
Drag and drop a Data Workflow component inside the
panelConfigPanel component, below theanswerTextHidden component.In the Property ID and Canvas Label Text fields, enter
dwfGetAnswer.
Configure the Input Operator
Drag and drop an Input operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Setting
Value
Category
Input
Component
_request
Required
Yes
Source
Default
Configure the Get Operator
Drag and drop a Get operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Setting
Value
Category
Get
Label
Path
body.body
Connect the output port (right) of the Input operator to the input port (left) of the Get operator.
Configure the Output Operator
Drag and drop an Output operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Setting
Value
Category
Output
Component
answerText
Action
value
Connect the output port (right) of the Get operator to the input port (left) of the Output operator.

Click Save Component.
Update the pluginCreateSubmission Plug-In Component
This Plug-In component takes the text retrieved from your Google Form and sends an email using SendGrid.
In the
panelConfigPanel component, hover over thepluginCreateSubmissionPlug-In component.A 5-button toolbar displays above the component on hover-over.
Using the toolbar, click the
(Settings) button.In the Property ID and Canvas Label Text fields, enter
pluginSendEmail.From the Service Type drop-down, select External.
From the External Service drop-down, select SendGrid.
In the Data Source URL field, enter
mail/send.From the Request Type drop-down, select Post.
In the Inputs table, enter the following:
Property ID
Mapping
Required
'no-reply@unqork.io'
from.email
(checked)'<enter your email address>'
personalizations[0].to[0].email
(checked)'A new response has been received!'
subject
(checked)'text/html'
content[0].type
(checked)answerText
content[0].value
(checked)
Drag and drop the
pluginCreateSubmissionPlug-In component component below theanswerTextHidden component.Click Save Component.
Update the initCreateSubmission Initializer Component
Next, update the Initializer component to trigger the pluginSendEmail Plug-In and dwfGetAnswer Data Workflow components.
In the
panelConfigPanel component, hover over theinitCreateSubmissionInitializer component.A 5-button toolbar displays above the component on hover-over.
Using the toolbar, click the
(Settings) button.In the Property ID and Canvas Label Text fields, enter
initSendEmail.In the Outputs table, enter the following:
Property ID
Type
Value
dwfGetAnswer
trigger
GO
pluginSendEmail
trigger
GO

Drag and drop the
initCreateSubmissionInitializer component above thepluginSendEmailPlug-In component.Click Save Component.
Save the module.
Enable Execute via Proxy
Now you'll access the Module Settings in your new module. The point of these setting changes is to enable the Execute via Proxy endpoint for the webhook, and setting the Anonymous role's permissions to Write. Once enabled, you can receive requests from your webhook service.
In the Module Builder, click the
(ellipsis) button.Select Module Settings.
To the left of the modal, click Module Settings.
Set Act as Super-user When Server Side Executing to
(ON).This step is for demonstration purposes only.
To the left of the modal, click User Permissions.
Set Allow Access to Anonymous Users to
(ON).From the Anonymous role's Permission drop-down, select Write.

Click Save & Close.
Save your module.
Here’s how the completed Postback module looks in the Module Builder:

Copy the Unqork Environment URL and Module ID
To set up the Google Form, copy the environment domain and the module ID from the address bar and save them for use in the next steps.

Configure the Google Form
Now, create and configure the Google Form.
Create the Google Form
Open a Google Form.
At the top left of the page, enter
Unqork Webhook Test.Replace Untitled Form with
Test Question.From the question type drop-down, select Paragraph.
Configure the Google Form Apps Script
At the top right, click the
(More). Select Apps Script.
At the top left, in the Project Title Field, rename the project to
Unqork Webhook Test.Copy the following code and paste it into the Script Editor:
function onFormSubmit(e) { var url = "https://{environment}x.unqork.io/fbu/uapi/modules/{moduleId}/api/{path}"; var form = FormApp.openById('{form Id}'); var formResponses = form.getResponses(); var formResponse = formResponses[formResponses.length - 1]; var itemResponses = formResponse.getItemResponses(); var answerText = itemResponses[0].getResponse(); var data = { "body": answerText } var options = { "method": "post", "headers": { "Content-Type": "application/json" }, "payload": JSON.stringify(data) }; var response = UrlFetchApp.fetch(url, options); }In the
var urlline, replace the following items with the environment domain and module ID you copied in the Copy the Unqork Environment and Module ID section of this article:After pasting the values, ensure the curly braces (
{}) are removed.Setting
Value
{environment}
Enter your environment name.
{moduleId}
Enter your module ID.
{path}
Enter a path.
This can be anything you want. This should be descriptive based on what the webhook accomplishes.
In the
var formline, replace the following:Setting
Value
{form ID}
Enter your form ID. The form ID is the string of characters in the Google Form URL between the
dandedit.
Click Save Project to Drive.
Click the Deploy drop-down.
Select New Deployment.
Click the
(gear) icon.Select Web App.
In the Description field, enter
Unqork webhook test.Click Deploy. If a pop-up displays asking you to authorize access, click Authorize Access, then click Done.
Configure the Google Form Apps Script Triggers
From the menu to the left, select Triggers (clock icon).
Click + Add Trigger. A pop-up modal displays.
Set the following settings:
Setting
Value
Choose which function to run
onFormSubmit
Choose which deployment should run
Head
Select event source
From form
Select event type
On form submit
Click Save.
This how-to guide demonstrates how to configure an application to consume payloads using webhooks, using SendGrid to send an email when the payload is complete. For this configuration, you'll need a Postback module that listens for the Google Forms webhook.
Configure the Postback Module
Begin by creating a Postback module that runs when it receives the webhook request. When finished, it sends an email with the contents of the Google Form. To use a webhook, you need to set up an API module.
These instructions assume you have a workspace open, saved, and with a title.
To create an API module in your application:
At the top right of your Application page, click + Create New.
Select Module. The Create Module modal displays.
In the Module Name* field, enter
postbackConsumePayloadModule.From the Module Type* drop-down, select API.
Click Create.
By default, the API module contains four Panel components to help with an API setup: panelInfo, panelRequest, panelResponse, and panelConfig.
Update the panelInfo Panel Component
Here you'll update the panelInfo Panel component.
Update the description HTML Element Component
The panelInfo Panel component contains an HTML Element component that describes its purpose. You can update this component to display any information you want when building or using the webhook.
In the
panelInfoPanel component, hover over thedescriptionHTML Element component.A 5-button toolbar displays above the component on hover-over.
Using the toolbar, click the
(Settings) button.In the Content field, enter
Postback module to recive webhooks from Google Forms and send Email for each response..Click the Save & Close.
Update the method Hidden Component
In the
panelInfoPanel component, hover over themethodHidden component.A 5-button toolbar displays above the component on hover-over.
Using the toolbar, click the
(Settings) button.In the Default Value field, enter
POST.Click Save & Close.
Update the panelRequest Panel Component
In the
panelRequestPanel component, hover over to therequestParameterHidden component.A 5-button toolbar displays above the component on hover-over.
Using the toolbar, click the
(Settings) button.In the Property ID and Label Text fields, enter
_request.Set Store Data in Database
(ON).Click Save & Close.
Configure the panelConfig Panel Component
Now, configure a Hidden component in the panelConfig Panel component.
Configure a Hidden Component
Drag and drop a Hidden component inside the
panelConfigPanel component.In the Property ID and Label Text fields, enter
answerText.In the Default Value field, enter
Default.Click Save Component.
Configure the Data Workflow Component
Next, configure a Data Workflow component that receives the request from your Google Form and outputs it into a Hidden component.
Drag and drop a Data Workflow component inside the
panelConfigPanel component, below theanswerTextHidden component.In the Property ID and Canvas Label Text fields, enter
dwfGetAnswer.
Configure the Input Operator
Drag and drop an Input operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Setting
Value
Category
Input
Component
_request
Required
Yes
Source
Default
Configure the Get Operator
Drag and drop a Get operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Setting
Value
Category
Get
Label
Path
body.body
Connect the output port (right) of the Input operator to the input port (left) of the Get operator.
Configure the Output Operator
Drag and drop an Output operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Setting
Value
Category
Output
Component
answerText
Action
value
Connect the output port (right) of the Get operator to the input port (left) of the Output operator.

Click Save.
Update the pluginCreateSubmission Plug-In Component
This Plug-In component takes the text retrieved from your Google Form and sends an email using SendGrid.
In the
panelConfigPanel component, hover over thepluginCreateSubmissionPlug-In component.A 5-button toolbar displays above the component on hover-over.
Using the toolbar, click the
(Settings) button.In the Property ID and Canvas Label Text fields, enter
pluginSendEmail.From the Service Type drop-down, select External.
From the External Service drop-down, select SendGrid.
In the Data Source URL field, enter
mail/send.From the Request Type drop-down, select Post.
In the Inputs table, enter the following:
Property ID
Mapping
Required
'no-reply@unqork.io'
from.email
(checked)'<enter your email address>'
personalizations[0].to[0].email
(checked)'A new response has been received!'
subject
(checked)'text/html'
content[0].type
(checked)answerText
content[0].value
(checked)
Drag and drop the
pluginCreateSubmissionPlug-In component below theanswerTextHidden component.Click Save.
Update the initCreateSubmission Initializer Component
Next, update the Initializer component to trigger the pluginSendEmail Plug-In and dwfGetAnswer Data Workflow components.
In the
panelConfigPanel component, hover over theinitCreateSubmissionInitializer component.A 5-button toolbar displays above the component on hover-over.
Using the toolbar, click the
(Settings) button.In the Property ID and Canvas Label Text fields, enter
initSendEmail.In the Outputs table, enter the following:
Property ID
Type
Value
dwfGetAnswer
trigger
GO
pluginSendEmail
trigger
GO

Click Save & Close.
Save the module.
Enable Execute via Proxy
Now you'll access the Module Settings in your new module. The point of these setting changes is to enable the Execute via Proxy endpoint for the webhook, and setting the Anonymous role's permissions to Write. Once enabled, you can receive requests from your webhook service.
In the Module Builder click the
(ellipsis) button.Select Module Settings.
To the left of the modal, click Module Settings.
Set Act as Super-user When Server Side Executing to
(ON).This step is for demonstration purposes only.
To the left of the modal, click User Permissions.
Set Allow Access to Anonymous Users to
(ON).From the Anonymous role's Permission drop-down, select Write.

Click Save.
Save your module.
Here’s how the completed Postback module looks in the Module Builder:

Copy the Unqork Environment and Module ID
To set up the Google Form, copy the environment domain and the module ID from the address bar and save them for use in the next steps.

Configure the Google Form
Now, create and configure the Google Form.
Create the Google Form
Open a Google Form.
At the top left of the page, enter
Unqork Webhook Test.Replace Untitled Form with
Test Question.From the question type drop-down, select Paragraph.
Configure the Google Form Apps Script
At the top right, click the
(More). Select Apps Script.
At the top left, in the Project Title Field, rename the project to
Unqork Webhook Test.Copy the following code and paste it into the Script Editor:
function onFormSubmit(e) { var url = "https://{environment}x.unqork.io/fbu/uapi/modules/{moduleId}/api/{path}"; var form = FormApp.openById('{form Id}'); var formResponses = form.getResponses(); var formResponse = formResponses[formResponses.length - 1]; var itemResponses = formResponse.getItemResponses(); var answerText = itemResponses[0].getResponse(); var data = { "body": answerText } var options = { "method": "post", "headers": { "Content-Type": "application/json" }, "payload": JSON.stringify(data) }; var response = UrlFetchApp.fetch(url, options); }In the
var urlline, replace the following items with the environment domain and module ID you copied in the Copy the Unqork Environment and Module ID section of this article:After pasting the values, ensure the curly braces (
{}) are removed.Setting
Value
{environment}
Enter your environment name.
{moduleId}
Enter your module ID.
{path}
Enter a path.
This can be anything you want. This should be descriptive based on what the webhook accomplishes.
In the
var formline, replace the following:Setting
Value
{form ID}
Enter your form ID. The form ID is the string of characters in the Google Form URL between the
dandedit.
Click Save Project to Drive.
Click the Deploy drop-down.
Select New Deployment.
Click the
(gear) icon.Select Web App.
In the Description field, enter
Unqork webhook test.Click Deploy. If a pop-up displays asking you to authorize access, click Authorize Access, then click Done.
Configure the Google Form Apps Script Triggers
From the menu to the left, select Triggers (clock icon).
Click + Add Trigger. A pop-up modal displays.
Set the following settings:
Setting
Value
Choose which function to run
onFormSubmit
Choose which deployment should run
Head
Select event source
From form
Select event type
On form submit
Click Save.