Skip to content

Commit 65a7a34

Browse files
Enhanced Webhook Integration Documentation
1 parent 6ef8abd commit 65a7a34

File tree

1 file changed

+75
-82
lines changed

1 file changed

+75
-82
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: 'Webhooks'
3-
description: 'Learn how to setup webhooks with the Arduino Cloud to work with third party platforms such as IFTTT.'
2+
title: 'Webhooks Integration with Arduino Cloud'
3+
description: 'Learn how to set up webhooks with the Arduino Cloud to integrate with third-party platforms like IFTTT.'
44
tags:
55
- Webhooks
66
- Arduino Cloud
@@ -10,116 +10,104 @@ author: 'Liam Aljundi'
1010

1111
## Introduction
1212

13-
Webhooks allow you to send and receive automated messages to and from other services. For example, you can use webhooks to receive a notification when a property of your Thing changes. To do this, there are third party platforms that link the properties from your Arduino Cloud projects to the desired trigger action.
13+
Webhooks allow your devices on Arduino Cloud to automatically send and receive messages from other services. For instance, you can use webhooks to get notifications when a device’s status changes or send data from your Arduino projects to services like Google Sheets or IFTTT.
14+
15+
This guide will walk you through setting up webhooks in Arduino Cloud and connecting them to third-party platforms, specifically IFTTT, to automate tasks.
1416

1517
## Goals
1618

17-
- Learn how to set up webhooks in the Arduino Cloud.
18-
- Provide an overview of available platforms where webhooks may be used.
19-
- Demonstrate an example that uses a webhook to send data from the Arduino Cloud to Google Sheets, via the IFTTT platform.
19+
By the end of this guide, you will:
2020

21-
## Hardware & Software Requirements
21+
- Learn how to set up and configure webhooks in Arduino Cloud.
22+
- Understand the integration process with third-party platforms like IFTTT.
23+
- Set up an example where data from Arduino Cloud is sent to Google Sheets using IFTTT.
2224

23-
- The [Arduino Create Agent](https://github.com/arduino/arduino-create-agent)
24-
- An [Arduino account](http://create.arduino.cc/iot).
25+
## Hardware & Software Requirements
2526

26-
You will also need a Cloud compatible board:
27+
Before starting, ensure you have the following:
2728

28-
***Read more about compatible board [here](/arduino-cloud/guides/overview#compatible-boards)***
29+
- **Arduino Create Agent** installed on your system: [Download Here](https://github.com/arduino/arduino-create-agent)
30+
- **Arduino account**: [Sign Up Here](http://create.arduino.cc/iot)
31+
- A Cloud-compatible Arduino board.
2932

30-
## Webhook Setup
33+
You can read more about compatible boards [here](/arduino-cloud/guides/overview#compatible-boards).
3134

32-
A webhook can be set for any **Thing** on the Arduino Cloud, allowing us to send data from the Arduino Cloud to various third party platforms. For example, you can use webhooks to receive an email when any of you devices is disconnected, or send and save live sensor values collected from your device in a Google Spreadsheet.
35+
## Setting Up the Webhook
3336

34-
There are many available platforms that support the use of Webhooks, for this tutorial we will try the **IFTTT** platform. IFTTT allows you to integrate services with your DIY projects. With IFTTT you can create Applets that work with any device or app that can make or receive a web request.
37+
Webhooks in Arduino Cloud can be linked to **Things**—which are virtual representations of your devices. These webhooks enable real-time data sharing with third-party platforms. For example, you can receive notifications when a device gets disconnected, or send live sensor data to a Google Spreadsheet.
3538

36-
Let's try it out by creating an Applet that uses a webhook to receive String Values sent via the **Message Widget** on the Arduino Cloud, and save them into a Google Sheets.
39+
In this tutorial, we’ll use **IFTTT** (If This Then That), a platform that enables you to automate actions between different services. IFTTT lets you create **Applets** that trigger actions like updating a Google Sheet when a webhook receives data.
3740

3841
### IFTTT Configuration
3942

40-
The first step is to create an Applet on the IFTTT platform using the following steps:
41-
42-
![Creating an Applet](assets/creating-an-applet.gif)
43-
44-
**1.** Go to [IFTTT website](https://maker.ifttt.com) and sign in.
45-
46-
**2.** Click **Create** in the top right, then select **If This**.
47-
48-
**3.** In the search field, type **"Webhooks"** and select that service.
49-
50-
**4.** Select Receive a web request.
51-
52-
**5.** In the Event Name field, type "message", and click the Create trigger button.
53-
54-
**6.** Now, click on **Then That**, type **"Google Sheets"** and select that service.
55-
56-
**7.** Choose the **"Add row to spreadsheet"** option.
43+
Start by creating an Applet on IFTTT. Here’s how:
5744

58-
**8.** You can keep the default settings, scroll down and click on **"Create action"**.
45+
1. Go to the [IFTTT website](https://maker.ifttt.com) and log in.
46+
2. Click **Create** in the top-right corner, then select **If This**.
47+
3. In the search bar, type **Webhooks** and select the Webhooks service.
48+
4. Choose **Receive a web request**.
49+
5. In the **Event Name** field, type `message` and click **Create trigger**.
50+
6. Click on **Then That**, search for **Google Sheets**, and select the **"Add row to spreadsheet"** option.
51+
7. Keep the default settings and click **Create action**.
52+
8. Click **Continue**, optionally change the Applet title, and hit **Finish**.
5953

60-
Both the trigger and action have now been configured. Click **Continue**. Optionally, change the applet title, and click **Finish** to create the applet.
54+
Now, your trigger and action are set. The next step is to grab the Webhook URL you will use in Arduino Cloud.
6155

62-
The final step is finding the webhook link that you will need to set to your Thing on the Arduino Cloud. You can find the link under **Profile picture in the top right > My Services > Webhooks > Documentation.**
56+
To find the Webhook URL:
57+
1. Go to your IFTTT profile (click your profile picture in the top right).
58+
2. Click on **My Services** > **Webhooks** > **Documentation**.
6359

64-
![Finding the Webhook link](assets/finding-webhook-link.png)
60+
![Finding Webhook Link](assets/finding-webhook-link.png)
6561

66-
### Setting a Webhook to a Thing
62+
### Linking Webhook to an Arduino Cloud Thing
6763

68-
Linking a webhook to a Thing is a quite simple process, follow the steps below to set a webhook to your Thing:
64+
Now that your IFTTT Applet is ready, it’s time to link it to an Arduino Cloud **Thing**:
6965

70-
**1.** [Sign in to your Arduino account](https://create.arduino.cc/iot), and open the [Arduino Cloud](https://create.arduino.cc/iot).
71-
72-
**2.** Navigate to [**Things** -> **Create Thing**](https://app.arduino.cc/things).
73-
74-
**3.** Create your Variables. In our case, we will create a **"message"** Variable and set its type to **"Character String"**.
75-
76-
![Create Variable](./assets/webhooks-01.png)
77-
78-
**4.** Add your **Device**, and configure your **Network** from the right side menu.
79-
80-
**5.** In the same menu to the right, click "**Configure**" under the "**Data Forwarding (Webhook)**" menu.
66+
1. [Sign in to Arduino Cloud](https://create.arduino.cc/iot) and open the **Arduino Cloud** dashboard.
67+
2. Navigate to **Things** > **Create Thing** to start a new Thing.
68+
3. Create a **Variable** for your Thing. In this case, create a **message** variable with the type set to **Character String**.
69+
4. Select your **Device** and configure your **Network** in the menu on the right.
70+
5. Under **Data Forwarding (Webhook)**, click **Configure**.
71+
6. Enter the Webhook URL you got from IFTTT in the provided field.
8172

8273
![Set Webhook](./assets/webhooks-02.png)
8374

84-
**6.** Enter the webhook link provided from the platform you are using.
75+
7. Finally, navigate to the **Sketch** tab and upload the automatically generated code to your board. This will enable your device to send data via the webhook.
8576

86-
![Enter Webhook](./assets/webhooks-03.png)
87-
88-
**7.** Finally, navigate to the **Sketch** tab, and upload the automatically generated code to your board.
89-
90-
The Arduino Cloud will share **five sets of values** through the assigned webhook:
77+
When data is sent from Arduino Cloud, the following information will be shared through the webhook:
9178

9279
- `"event_id": "EVENT_UUID"`
9380
- `"webhook_id": "WEBHOOK_ID"`
9481
- `"device_id": "DEVICE_UUID"`
9582
- `"thing_id": "THING_UUID"`
96-
97-
The fifth value contains an array of objects, each representing a Variable in your Thing, as the following:
98-
99-
- `"values":`
100-
101-
```js
102-
[
103-
{
104-
"id": "VARIABLE_01_ID",
105-
"name": "NAME_OF_VARIABLE_01",
106-
"value": "VARIABLE_01_VALUE",
107-
"persist": true/false,
108-
"updated_at": "DATE",
109-
"created_by": "USERID"
110-
},1
111-
{
112-
"id": "VARIABLE_02_ID",
113-
"name": "NAME_OF_VARIABLE_02",
114-
"value": "VARIABLE_02_VALUE",
115-
"persist": true/false,
116-
"updated_at": "DATE",
117-
"created_by": "USERID"
118-
}
119-
]
120-
```
121-
122-
### Testing the Webhook
83+
- **Variable values**: Each variable in your Thing will be represented as an object with details such as the value and timestamp.
84+
85+
Example:
86+
87+
```js
88+
{
89+
"values": [
90+
{
91+
"id": "VARIABLE_01_ID",
92+
"name": "NAME_OF_VARIABLE_01",
93+
"value": "VARIABLE_01_VALUE",
94+
"persist": true/false,
95+
"updated_at": "DATE",
96+
"created_by": "USERID"
97+
},
98+
{
99+
"id": "VARIABLE_02_ID",
100+
"name": "NAME_OF_VARIABLE_02",
101+
"value": "VARIABLE_02_VALUE",
102+
"persist": true/false,
103+
"updated_at": "DATE",
104+
"created_by": "USERID"
105+
}
106+
]
107+
}
108+
```
109+
110+
## Testing the Webhook
123111

124112
To test the webhook, we need to create a *Messenger widget*. We can do that by:
125113

@@ -150,3 +138,8 @@ In addition to IFTTT, here are examples of platforms that you can use webhooks w
150138
- [**Google Cloud APIs**](https://cloud.google.com/apis/docs/overview): with Google APIs you can develop application programming interfaces (APIs) to communicate with Google services such as Search, Gmail, Translate or Google Maps apps or other applications like Arduino Cloud.
151139

152140
- [**Google Script**](https://developers.google.com/apps-script): allows you to interact with all your Google G-Suite files such as Google Sheets, Docs and more.
141+
142+
## Additional Tools for Webhook Testing
143+
144+
- **Beeceptor**: A powerful tool to intercept and test your webhooks.
145+
- **httpbin**: A simple HTTP request/response service that can be used to test webhooks.

0 commit comments

Comments
 (0)