Anything-to-SMS with IFTTT and Vonage
Tags: lowcode, nocode, ifttt, vonage
Published: 2024-02-22 11:23:01

I live in Tel Aviv, a beach city with 300 sunny days a year. The weather is so stable that I never check the weather. But whenever it does rain, it pours! And I end up drenched and cold. If only I somehow had a reminder to tell me it’s going to rain.

Have you heard of [IFTTT](https://ifttt.com)? IFTTT stands for "If This Then That." It's a web-based service that allows you to create simple conditional statements, called applets, to automate various tasks and actions across different web services and devices. And all with no code! The basic idea is to connect different apps and devices to create automated workflows based on triggers and actions.

No-code/low-code platforms are super-useful for a ton of different things. What's even better is when you combine them to solve problems!

So in this post, I’ll show you how I built an applet in IFTTT to help me know when it’s going to rain and take an umbrella with me. The applet will send me an SMS warning using Vonage’s no code/low code [AI Studio](https://studio.docs.ai.vonage.com/) platform. 

![IFTTT explore page with a wide choice of applets integrating various services](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/29mmdv9csd350gtoq5ba.png)

Prerequisites:

1. [Vonage Developer Account](https://ui.idp.vonage.com/ui/auth/registration)
2. IFTTT Account - [Sign up for a IFTTT free account](https://ifttt.com/join)
3. [Vonage Virtual Number](https://developer.vonage.com/en/numbers/guides/number-management#rent-a-virtual-number)

## Creating an IFTTT Applet

Navigate to the Create Applet page. Search for and select Weather Underground. You’ll then see a list of all the available Weather Underground Triggers.

![Choose a Weather Underground Trigger](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j4xt1u76yef4evq4kg7x.png)

You’ll want to select “Tomorrow’s forecast calls for”. The first half of our Applet is done! You should be redirected to a page that looks like this:

![Applet If This Than That Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oogi6hjhwtjkvj35el2s.png)

Now we need to somehow tell IFTTT to trigger an SMS. We’re going to do this with Vonage’s AI Studio.

## Creating an Outbound SMS Agent

Let’s create our AI Studio Agent now. Navigate to the [AI Studio Dashboard](https://studio.ai.vonage.com/agents). Follow the instructions found in the AI Studio documentation [here](https://studio.docs.ai.vonage.com/ai-studio/create-a-new-agent). There are three important options for our agent, select:

* **Type:** SMS
* **Template:** Start From Scratch
* **Event:** Outbound

Our agent will be extremely basic, sending a single SMS telling us that tomorrow will be rain. It will also send a link to the full weather forecast and provide the expected high and low temperatures.

For this we need to [create 3 parameters](https://studio.docs.ai.vonage.com/properties-1/parameters#create-a-parameter) in AI Studio which will hold those values we get from IFTTT. The parameters will be of `@sys.any` Entity type and called, `ForecastUrl`, `HighTempCelsius`, and `LowTempCelsius`. See below:


![AI Studio Dashboard Parameter Creation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8gro8z7i5ehzxvfnrdey.png)

Now we can add our single Send Message node and our alert message which uses our 3 parameters.

![AI Studio Send Message](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ixlhatcix5uonmdtp1bx.png)

The last step is to [publish our agent](https://studio.docs.ai.vonage.com/ai-studio/editor-mode-and-publish#how-to-publish-your-telephony-and-sms-agents).

## Connecting IFTTT with Webhooks

Now that our agent is setup all we need to do is finish our Applet in IFTTT and connect it to the agent. We will do this with the Webhook service. So in IFTTT continue and search for “Webhook”.

![Choose IFTTT Webhook Service](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/npmt93rjg3axgf5ylnrh.png)

Select “Make a web request” and continue until you see the following page:

![Make a web request](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sitn6kfy36iauphc7hdc.png)

For URL, you will need to paste one of the following. The endpoint depends on the region you selected for your agent.

For EU agents --> https://studio-api-eu.ai.vonage.com/messaging/conversation
For US agents --> https://studio-api-us.ai.vonage.com/messaging/conversation

Set *Method* to `POST`.

Set *Content Type* to `application/json`.

For *Additional Headers* you’ll need to add your `X-Vgai-Key`. You can find the `X-Vgai-Key` on the top right of your AI Studio dashboard. Click on the *user* icon, and then `Generate API Key`.

Example:
X-Vgai-Key: YOUR_X_VGAI_KEY

For “Body” we will add the following code:

```=JSON
{
  "to": "YOUR_PHONE_NUMBER",
  "agent_id": "YOUR_VONAGE_AGENT_ID",
  "channel": "sms",
  "session_parameters": [

    {
      "name": ForecastUrl,
      "value": {{ForecastUrl}}
    },

    {
      "name": "HighTempCelsius",
      "value": {{HighTempCelsius}}
    },

    {
      "name": "LowTempCelsius",
      "value": {{LowTempCelsius}}
    }
  ]
}
```

You’ll need to replace YOUR_PHONE_NUMBER with the phone to receive alerts. For example, “15551234567”. Similarly replace YOUR_VONAGE_AGENT_ID with your agent id, which can be found under Agent Details found in the side panel of your Agent in AI Studio.

Lastly, click “Create Action” and you’re done!

## Conclusion

Did you know about IFTTT before this article? What are you using it for? What other nocode or lowcode tools are you using? I’m really interested to hear any feedback you have for this article.

Join me on Vonage [Developer Community Slack](https://developer.vonage.com/en/community/slack) or [X](https://twitter.com/VonageDev), formerly known as Twitter and let me know what exciting things you are building!

## Additional Resources

[Low-Code and No-Code: What Option Is Best for You?](https://developer.vonage.com/en/blog/low-code-and-no-code-what-option-is-best-for-you)

[If You Can Point and Click Then You Can Make a Conversational AI](https://developer.vonage.com/en/blog/if-you-can-point-and-click-then-you-can-make-a-conversational-ai)

[Crash Course: Create Virtual Agents for WhatsApp with Vonage AI Studio](https://developer.vonage.com/en/blog/crash-course-create-virtual-agents-for-whatsapp-with-vonage-ai-studio)