<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Julia Biro</title>
    <description>The latest articles on Forem by Julia Biro (@iza_biro).</description>
    <link>https://forem.com/iza_biro</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F114403%2F3f4475a9-83e1-48f0-8af6-25a9b7ac3f75.jpg</url>
      <title>Forem: Julia Biro</title>
      <link>https://forem.com/iza_biro</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/iza_biro"/>
    <language>en</language>
    <item>
      <title>Introducing the Vonage Voice API on Zapier</title>
      <dc:creator>Julia Biro</dc:creator>
      <pubDate>Thu, 21 Jan 2021 17:01:56 +0000</pubDate>
      <link>https://forem.com/vonagedev/introducing-the-vonage-voice-api-on-zapier-3dhi</link>
      <guid>https://forem.com/vonagedev/introducing-the-vonage-voice-api-on-zapier-3dhi</guid>
      <description>&lt;p&gt;Some of you might already be familiar with our &lt;a href="https://zapier.com/apps/vonage-sms-api/integrations" rel="noopener noreferrer"&gt;SMS API integration&lt;/a&gt; in Zapier. It allows you to trigger a Zap when receiving an SMS, or send an SMS message as an action—for example, a reminder or notification of sorts.&lt;/p&gt;

&lt;p&gt;In this article, we're exploring the &lt;a href="https://zapier.com/apps/vonage-voice-api/integrations" rel="noopener noreferrer"&gt;Voice API integrations&lt;/a&gt;, the various events it offers, and we'll learn how to add more versatile ways of communication to your workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Vonage Voice API
&lt;/h2&gt;

&lt;p&gt;The Vonage Voice API allows you to make and receive phone calls. It also comes with some nifty features like reading out a text-to-speech message, streaming an audio file into a call, forwarding, or placing a call leg into a conference. &lt;/p&gt;

&lt;h2&gt;
  
  
  Zapier 101
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://zapier.com/app/dashboard" rel="noopener noreferrer"&gt;Zapier&lt;/a&gt; is an online automation tool that connects your favourite apps. It empowers users to build their workflows with just a few clicks, connecting two or more apps to automate repetitive tasks.&lt;br&gt;
Find an overview of the &lt;a href="https://zapier.com/help/create/basics/learn-key-concepts-in-zapier" rel="noopener noreferrer"&gt;key concepts&lt;/a&gt; and &lt;a href="https://zapier.com/learn/getting-started-guide/" rel="noopener noreferrer"&gt;getting started guides&lt;/a&gt; in the &lt;a href="https://zapier.com/learn/" rel="noopener noreferrer"&gt;Zapier Learning Center&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;Zap&lt;/strong&gt; is a workflow created in Zapier. Each Zap consists of a &lt;strong&gt;trigger&lt;/strong&gt; and one or more &lt;strong&gt;actions&lt;/strong&gt;. Once turned on, it will run the action steps every time the trigger event occurs.&lt;/p&gt;

&lt;p&gt;The Vonage Voice API integration has eight events: four triggers and four actions. The triggers will set your workflow off when someone rings your Vonage number, while the actions will initiate an outbound call.&lt;/p&gt;

&lt;p&gt;An &lt;strong&gt;app&lt;/strong&gt; is a web service or application, such as Airtable, Google Docs, or Vonage. There are &lt;a href="https://zapier.com/apps" rel="noopener noreferrer"&gt;over 2,000 apps&lt;/a&gt; you can connect to Zapier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vonage Voice API Triggers
&lt;/h2&gt;

&lt;p&gt;A trigger is an event that starts a Zap. Once you've set up and turned on your Zap, Zapier will monitor for that specific event. &lt;/p&gt;

&lt;p&gt;Based on the type of monitoring, there are two types of triggers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;polling&lt;/strong&gt;: the majority of triggers are polling triggers. Zapier will check for new data from your trigger every 1 to 15 minutes, depending on your pricing plan.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;instant&lt;/strong&gt;: your trigger app will send Zapier an instant notification whenever there's new data.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All Vonage Voice triggers are instant triggers and will start your workflow when an inbound call reaches one of your virtual numbers. &lt;br&gt;
These triggers will start your Zap and determine what happens to the incoming call before we move on to adding an action.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flearn.vonage.com%2Fcontent%2Fblog%2Fintroducing-the-vonage-voice-api-on-zapier%2Fvonage-voice-triggers-zapier.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flearn.vonage.com%2Fcontent%2Fblog%2Fintroducing-the-vonage-voice-api-on-zapier%2Fvonage-voice-triggers-zapier.png" alt="Screenshot featuring the Vonage Voice API triggers in Zapier" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://zapier.com/webintent/create-zap?create=true&amp;amp;entry-point-location=explore&amp;amp;template__0__action=inbound_tts_call&amp;amp;template__0__selected_api=VonageVoiceCLIAPI%401.0.3&amp;amp;template__0__type_of=read&amp;amp;utm_source=zapier&amp;amp;utm_medium=product&amp;amp;utm_campaign=zapier-gbl-zcr-display-team_explore_zt_integration_triggers" rel="noopener noreferrer"&gt;New TTS Call&lt;/a&gt;&lt;/strong&gt; will read out a text-to-speech message to the caller.&lt;br&gt;
As an example, you could use this trigger to greet the caller and let them know you'll get back to them during working hours, then add an action node to save their phone number into a spreadsheet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://zapier.com/webintent/create-zap?create=true&amp;amp;entry-point-location=explore&amp;amp;template__0__action=inbound_stream_call&amp;amp;template__0__selected_api=VonageVoiceCLIAPI%401.0.3&amp;amp;template__0__type_of=read&amp;amp;utm_source=zapier&amp;amp;utm_medium=product&amp;amp;utm_campaign=zapier-gbl-zcr-display-team_explore_zt_integration_triggers" rel="noopener noreferrer"&gt;New Stream Call&lt;/a&gt;&lt;/strong&gt; works similarly, except it plays an audio file into the call instead of the text-to-speech message. Add a personal touch to the previous example and record a voice message to be played back to the caller.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://zapier.com/webintent/create-zap?create=true&amp;amp;entry-point-location=explore&amp;amp;template__0__action=connect_call&amp;amp;template__0__selected_api=VonageVoiceCLIAPI%401.0.3&amp;amp;template__0__type_of=read&amp;amp;utm_source=zapier&amp;amp;utm_medium=product&amp;amp;utm_campaign=zapier-gbl-zcr-display-team_explore_zt_integration_triggers" rel="noopener noreferrer"&gt;New Forwarded Call&lt;/a&gt;&lt;/strong&gt; will forward the incoming call to a predefined phone number of your choice.&lt;br&gt;
For example, you might choose to forward calls to your cell phone only during working hours.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://zapier.com/webintent/create-zap?create=true&amp;amp;entry-point-location=explore&amp;amp;template__0__action=conf_call&amp;amp;template__0__selected_api=VonageVoiceCLIAPI%401.0.3&amp;amp;template__0__type_of=read&amp;amp;utm_source=zapier&amp;amp;utm_medium=product&amp;amp;utm_campaign=zapier-gbl-zcr-display-team_explore_zt_integration_triggers" rel="noopener noreferrer"&gt;New Conference Call&lt;/a&gt;&lt;/strong&gt; will place all callers into the same conference call. &lt;br&gt;
You could use this trigger to set up a dial-in meeting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vonage Voice API Actions
&lt;/h2&gt;

&lt;p&gt;All Vonage Voice API Actions create an outbound call. &lt;br&gt;
While you wouldn't necessarily connect them after a Vonage Voice API trigger, they work quite well with a series of instant triggers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flearn.vonage.com%2Fcontent%2Fblog%2Fintroducing-the-vonage-voice-api-on-zapier%2Fvonage-voice-actions-zapier.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flearn.vonage.com%2Fcontent%2Fblog%2Fintroducing-the-vonage-voice-api-on-zapier%2Fvonage-voice-actions-zapier.png" alt="Screenshot featuring the Vonage Voice API actions in Zapier" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create Text to Speech Call&lt;/strong&gt; will read a text-to-speech message to the recipient, which could be a good fit if you're looking to escalate your notifications. While one might easily dismiss an SMS message, a ringing handset commands immediate attention.&lt;br&gt;
For example, connect it to a scheduler trigger to be reminded when to take your meds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create Stream Call&lt;/strong&gt; conveys the same level of urgency, but gives your message a personal touch. Instead of the text-to-speech message, an audio file gets played into the outbound call. &lt;br&gt;
An elderly relative might find comfort in a familiar voice, reminding them of their medication, while they might be less appreciative of your friendly neighbourhood robot.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create Two-Way Call&lt;/strong&gt; will take two phone numbers of your choice as input, then ring both of them and place them in the same call.&lt;/p&gt;

&lt;p&gt;If you're looking to create a call with more participants, use the &lt;strong&gt;Create Conference Call&lt;/strong&gt; action. It creates an outbound call to a number of your choice, then places that call leg into a conference call. Add an action for each call recipient and make sure you're joining them to the same conference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Next?
&lt;/h2&gt;

&lt;p&gt;Start building today and let us know how it goes!&lt;/p&gt;

&lt;p&gt;If you have any questions, advice or ideas you'd like to share with the community, please feel free to jump on our &lt;a href="https://developer.nexmo.com/community/slack" rel="noopener noreferrer"&gt;Community Slack workspace&lt;/a&gt;. I'd love to hear back from you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Further Reading
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;See the &lt;a href="https://zapier.com/apps/vonage-voice-api/integrations" rel="noopener noreferrer"&gt;Vonage Voice API Integrations&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://zapier.com/help/doc/how-to-get-started-with-vonage-voice-api-on-zapier" rel="noopener noreferrer"&gt;How to Get Started with Vonage Voice API on Zapier&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://zapier.com/help/doc/common-problems-with-vonage-voice-api-on-zapier" rel="noopener noreferrer"&gt;Vonage Voice API on Zapier FAQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/api/voice?theme=dark" rel="noopener noreferrer"&gt;Voice API Reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>zapier</category>
      <category>beginners</category>
      <category>showdev</category>
      <category>news</category>
    </item>
    <item>
      <title>Using Variables and Chaining Requests in Postman</title>
      <dc:creator>Julia Biro</dc:creator>
      <pubDate>Mon, 19 Oct 2020 13:29:31 +0000</pubDate>
      <link>https://forem.com/iza_biro/using-variables-and-chaining-requests-in-postman-42p5</link>
      <guid>https://forem.com/iza_biro/using-variables-and-chaining-requests-in-postman-42p5</guid>
      <description>&lt;p&gt;At Vonage, we use OpenAPI to describe all our APIs, and we also make those specifications &lt;a href="https://developer.nexmo.com/concepts/guides/openapi"&gt;publicly available&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
One of our favorite things to do with an OpenAPI file we haven’t seen before is to import it into &lt;a href="https://www.postman.com/"&gt;Postman&lt;/a&gt;. Therefore, we’ve decided to pay it forward and create a &lt;a href="https://developer.nexmo.com/tools/postman"&gt;Postman Collection&lt;/a&gt; for our APIs so that evaluating and exploring them is quicker and easier than ever.&lt;/p&gt;

&lt;p&gt;In this article, we highlight how you can make exploring your APIs in Postman even more approachable. We’ll be using &lt;a href="https://developer.nexmo.com/tools/postman"&gt;The Vonage APIs Postman Collection&lt;/a&gt; as an example, so make sure to go through the prerequisites list if you want to follow along.&lt;/p&gt;
&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="//dashboard.nexmo.com/"&gt;Vonage(Nexmo) Account&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dashboard.nexmo.com/buy-numbers"&gt;Vonage Number&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://identity.getpostman.com/signup"&gt;Postman Account&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Variables are Your Friends
&lt;/h2&gt;

&lt;p&gt;When you first import the &lt;a href="https://developer.nexmo.com/tools/postman"&gt;Vonage APIs Collection&lt;/a&gt; into Postman, you’ll see a &lt;strong&gt;Vonage APIs&lt;/strong&gt; folder appear under &lt;em&gt;Collections&lt;/em&gt; on the left-hand side of your screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bL4Ml1Tx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.nexmo.com/wp-content/uploads/2020/10/vonage-collection-postman.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bL4Ml1Tx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.nexmo.com/wp-content/uploads/2020/10/vonage-collection-postman.png" alt="Image of Vonage APIs Collection folder in Postman"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You might also notice the &lt;em&gt;“36 requests”&lt;/em&gt; under the collection name. Depending on the auth type, that is more or less 36 times someone would have to add &lt;code&gt;api_key&lt;/code&gt; and &lt;code&gt;api_secret&lt;/code&gt; as request parameters.&lt;/p&gt;

&lt;p&gt;Fortunately, Postman supports environment, global and collection-level variables, which will all make the experience a lot more smooth and less painful. Instead of performing repeated tasks, such as filling in the same parameter values for every request, these variables enable us to pull those values in dynamically.&lt;/p&gt;

&lt;p&gt;Our collection comes with a &lt;em&gt;Vonage Environment&lt;/em&gt; where you can provide your key and secret, and then all requests will use those values moving forward.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zM2k-QuX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.nexmo.com/wp-content/uploads/2020/10/vonage-environment-in-postman.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zM2k-QuX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.nexmo.com/wp-content/uploads/2020/10/vonage-environment-in-postman.png" alt="Image of Vonage Environment in Postman"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This way, making a simple request like checking your account balance with the &lt;em&gt;Account API&lt;/em&gt; becomes a one-click job.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AG4LD2Y---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.nexmo.com/wp-content/uploads/2020/10/get-account-balance.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AG4LD2Y---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.nexmo.com/wp-content/uploads/2020/10/get-account-balance.png" alt="Image of Get Account Balance request with the Vonage Account API"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some other requests may need additional parameters. For example, to &lt;em&gt;Send an SMS&lt;/em&gt;, you’d need to fill in &lt;code&gt;to&lt;/code&gt;, &lt;code&gt;from&lt;/code&gt; and &lt;code&gt;text&lt;/code&gt; in the request body, but &lt;code&gt;api_key&lt;/code&gt; and &lt;code&gt;api_secret&lt;/code&gt; would still be auto-populated.&lt;br&gt;&lt;br&gt;
You may also choose to add any of these parameters as variables, like the &lt;code&gt;to&lt;/code&gt; number has been saved as a collection variable in the request featured below.&lt;br&gt;&lt;br&gt;
You can achieve this by either editing your collection or environment directly, or by selecting the hardcoded value you’d like to replace with a variable, and clicking &lt;strong&gt;Set as variable&lt;/strong&gt; &amp;gt; &lt;strong&gt;Set as a new variable&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--um7kWfnt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.nexmo.com/wp-content/uploads/2020/10/set-as-new-variable-dupl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--um7kWfnt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.nexmo.com/wp-content/uploads/2020/10/set-as-new-variable-dupl.png" alt="Image of turning the phone number from the to field into a variable by selecting it and pressing the Set as variable button"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Chaining Requests
&lt;/h2&gt;

&lt;p&gt;Variables in Postman are great, but they aren’t a universal tool for fixing every cumbersome thing.&lt;br&gt;&lt;br&gt;
For example, when using one of the Vonage APIs that authenticates using JWTs, you’ll need to generate that JWT before making your request. To generate the JWT, you’ll need an application ID and a private key, both of which you’ll get once you create a Vonage Application. That amounts to three separate requests one would have to make, which can confuse someone exploring the API for the first time.&lt;/p&gt;

&lt;p&gt;Fortunately, there’s a workaround for multi-step prerequisites as well: chaining requests.&lt;br&gt;&lt;br&gt;
Postman offers two scripting areas, &lt;strong&gt;Pre-Request Script&lt;/strong&gt; and &lt;strong&gt;Tests&lt;/strong&gt; , where you can write any JavaScript code you’d like-yes, including making another HTTP request as well.&lt;/p&gt;
&lt;h3&gt;
  
  
  The Pre-Request Script
&lt;/h3&gt;

&lt;p&gt;The Vonage Voice API authenticates using JSON Web Tokens (JWTs), so to send a &lt;strong&gt;Create an outbound call&lt;/strong&gt; request, we’d first need to:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a Vonage Application using the Applications API
&lt;/li&gt;
&lt;li&gt;Grab the &lt;code&gt;application_id&lt;/code&gt; and &lt;code&gt;private_key&lt;/code&gt; values from the response object and use them to generate a JWT.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Check if we already have a JSON Web Token, continue if not&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;JWT&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;btoa&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;btoa&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;base64keyandsecret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;btoa&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;api_key&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;api_secret&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// (1) Create a Voice Application by making a request to the Vonage Applications API&lt;/span&gt;
    &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sendRequest&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.nexmo.com/v2/applications&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;`Authorization:Basic &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;base64keyandsecret&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type: application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Demo Postman Application&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;capabilities&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;voice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;webhooks&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;answer_url&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;address&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://example.com/webhooks/answer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http_method&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                        &lt;span class="p"&gt;},&lt;/span&gt;
                        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;event_url&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;address&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://example.com/webhooks/event&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http_method&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                        &lt;span class="p"&gt;}&lt;/span&gt;
                    &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="c1"&gt;// (2) Generate JWT using the application ID as a claim and sign it with the private key&lt;/span&gt;
        &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sendRequest&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://jwtapi-dev.netlify.app/.netlify/functions/generate&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type: application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
                &lt;span class="na"&gt;algorithm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;RS256&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;private_key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;private_key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;claims&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="na"&gt;application_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="na"&gt;exp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;JWT&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;signed_jwt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Tests: Why Not Post-Request Script?
&lt;/h3&gt;

&lt;p&gt;Postman allows you to add tests to individual requests, folders and collections. While these tests are immensely useful in ensuring that your API is behaving as expected and for debugging purposes, here’s a kicker: Tests are JavaScript scripts that &lt;em&gt;get executed after&lt;/em&gt; a request has been made.&lt;br&gt;&lt;br&gt;
This means that the way we used the &lt;em&gt;Pre-Request Script&lt;/em&gt;, we could make the most of the &lt;em&gt;Test&lt;/em&gt; area too.&lt;/p&gt;

&lt;p&gt;In our voice call example, on successful completion, I am saving the &lt;code&gt;voice_call_uuid&lt;/code&gt; as a collection variable using the &lt;code&gt;pm.collectionVariables.set()&lt;/code&gt; function. This variable will come in handy should I decide to make other requests involving the Voice API. Alternatively, on failure, I am clearing the &lt;code&gt;JWT&lt;/code&gt; value using the &lt;code&gt;pm.environment.unset("JWT")&lt;/code&gt; expression so that I can send my request again and generate a new JWT.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;201&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;collectionVariables&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;voice_call_uuid&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;unset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;JWT&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read more about defining variables in scripts in the &lt;a href="https://learning.postman.com/docs/sending-requests/variables/#defining-variables-in-scripts"&gt;Postman docs&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Request Body
&lt;/h3&gt;

&lt;p&gt;Finally, let’s put this all together to make a text-to-speech voice call.&lt;br&gt;&lt;br&gt;
You may use the snippet below and provide the &lt;code&gt;to&lt;/code&gt; and &lt;code&gt;from&lt;/code&gt; as either variables or hardcoded values. Keep in mind that &lt;code&gt;to&lt;/code&gt; is the destination number you’re about to call, and &lt;code&gt;from&lt;/code&gt; is one of your Vonage numbers. Get one in &lt;a href="https://dashboard.nexmo.com/buy-numbers"&gt;your dashboard&lt;/a&gt; if you haven’t already.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;NCCO&lt;/em&gt; is our Call Control Object, which lists all actions to be taken once the call is answered. Check out the &lt;a href="https://developer.nexmo.com/voice/voice-api/ncco-reference"&gt;NCCO Reference&lt;/a&gt; and see what other actions you could include in your call flow.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"to"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"number"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="err"&gt;to&lt;/span&gt;&lt;span class="p"&gt;}},&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"phone"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"from"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"number"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="err"&gt;from&lt;/span&gt;&lt;span class="p"&gt;}},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"phone"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ncco"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"talk"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"This is a text to speech call from Vonage"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This request is now good to go, so push that &lt;strong&gt;Send&lt;/strong&gt; button. Congratulations! And you know what the best part of all this is? If you save your changes and &lt;em&gt;Share Collection&lt;/em&gt;, the next person will only have to fill in the missing variable values and press the &lt;em&gt;Send&lt;/em&gt; button.&lt;/p&gt;

&lt;p&gt;How would you use these handy Postman features? Got any tips and tricks? Let us know; we’re looking forward to seeing what you come up with!&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Next?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/iza_biro/announcing-the-vonage-apis-postman-collection-4e70-temp-slug-1229535"&gt;Announcing the Vonage APIs Postman Collection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://explore.postman.com/vonage"&gt;Vonage APIs Postman Collection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learning.postman.com/docs/sending-requests/variables/"&gt;Using Variables guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/api/account?theme=dark"&gt;Account API Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/api/sms?theme=dark"&gt;SMS API Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/ncco-reference"&gt;Voice API NCCO Reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The post &lt;a href="https://www.nexmo.com/blog/2020/10/19/variables-and-chaining-requests-in-postman"&gt;Using Variables and Chaining Requests in Postman&lt;/a&gt; appeared first on &lt;a href="https://www.nexmo.com"&gt;Vonage Developer Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>postman</category>
      <category>javascript</category>
      <category>openapi</category>
    </item>
    <item>
      <title>Announcing the Vonage APIs Postman Collection</title>
      <dc:creator>Julia Biro</dc:creator>
      <pubDate>Wed, 16 Sep 2020 10:53:56 +0000</pubDate>
      <link>https://forem.com/vonagedev/announcing-the-vonage-apis-postman-collection-4855</link>
      <guid>https://forem.com/vonagedev/announcing-the-vonage-apis-postman-collection-4855</guid>
      <description>&lt;p&gt;At Vonage, we publish OpenAPI specifications for all our APIs. These specs enable our developer community to explore, evaluate, and integrate the Vonage APIs efficiently.&lt;/p&gt;

&lt;p&gt;As &lt;a href="https://twitter.com/lornajane" rel="noopener noreferrer"&gt;Lorna&lt;/a&gt; mentioned in her article on &lt;a href="https://dev.to/nexmodev/evaluate-apis-quickly-and-easily-with-openapi-1g3c-temp-slug-175183"&gt;evaluating APIs using OpenAPI&lt;/a&gt;, downloading an &lt;a href="https://developer.nexmo.com/concepts/guides/openapi" rel="noopener noreferrer"&gt;OpenAPI Spec&lt;/a&gt; and exploring it in &lt;a href="https://www.postman.com/" rel="noopener noreferrer"&gt;Postman&lt;/a&gt; is a great way to familiarize yourself with new APIs.&lt;/p&gt;

&lt;p&gt;I couldn’t agree more! If you’re not already familiar with &lt;a href="https://www.postman.com/" rel="noopener noreferrer"&gt;Postman&lt;/a&gt;, it’s a friendly graphical interface to a powerful cross-platform HTTP client that I encourage you to try.&lt;/p&gt;

&lt;p&gt;We’re excited to announce that exploring the Vonage APIs has just gotten even quicker and easier! We’ve added a “Run in Postman” button to the &lt;a href="https://developer.nexmo.com/tools/postman" rel="noopener noreferrer"&gt;Postman page on our developer portal&lt;/a&gt;, so now you’re only a couple of clicks away from making your first request.&lt;/p&gt;

&lt;p&gt;It is also discoverable on the &lt;a href="https://explore.postman.com/network/search?q=vonage" rel="noopener noreferrer"&gt;main Postman network&lt;/a&gt; if you’d rather browse it there.&lt;/p&gt;

&lt;p&gt;Once you click on the &lt;strong&gt;Run in Postman&lt;/strong&gt; button, you’ll be taken to your Postman instance of choice, and all of the Vonage API Calls will be waiting for you, nicely organized into a collection.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F09%2Fvonage-apis-postman-collection.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F09%2Fvonage-apis-postman-collection.png" alt="Vonage APIs Postman collection imported view" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A great thing about using a Postman Collection is that we can prepare the requests for you, so there’s minimal work involved in making the API calls.&lt;/p&gt;

&lt;p&gt;It also has some neat features, like the ability to configure environment variables. This collection comes with a &lt;strong&gt;Vonage Environment&lt;/strong&gt; that lists &lt;em&gt;API_KEY&lt;/em&gt;, &lt;em&gt;API_SECRET&lt;/em&gt;, and &lt;em&gt;JWT&lt;/em&gt;, which are the most commonly used parameters, but feel free to add others as you go. You can find the environments by clicking the cog icon in the top right-hand corner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F09%2Fpostman-environment-variables.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F09%2Fpostman-environment-variables.png" alt="Vonage environment variables in Postman Collection" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To add your credentials, update the current values of &lt;em&gt;API_KEY&lt;/em&gt; and &lt;em&gt;API_SECRET&lt;/em&gt; with the API key and secret found in your &lt;a href="//dashboard.nexmo.com/"&gt;Vonage dashboard&lt;/a&gt; (no need to set up JWT for now).&lt;/p&gt;

&lt;h2&gt;
  
  
  Using the Vonage APIs Postman Collection
&lt;/h2&gt;

&lt;p&gt;Next, let’s have a closer look at using the Vonage APIs Postman Collection to explore the &lt;a href="https://developer.nexmo.com/numbers/overview" rel="noopener noreferrer"&gt;&lt;em&gt;Numbers API&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Expand the collection folder and find the &lt;em&gt;Numbers&lt;/em&gt; folder inside it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F09%2Fnumbers-in-postman-collection.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F09%2Fnumbers-in-postman-collection.png" alt="Numbers requests in Vonage APIs Postman collection" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Vonage’s Numbers API allows you to manage your virtual number inventory programmatically. To find out more about the available operations, make sure to check out the &lt;a href="https://developer.nexmo.com/api/numbers?theme=dark" rel="noopener noreferrer"&gt;Numbers API Reference&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For this example, let’s try out the &lt;em&gt;List numbers you own&lt;/em&gt; entry.&lt;/p&gt;

&lt;p&gt;Your &lt;code&gt;api_key&lt;/code&gt; and &lt;code&gt;api_secret&lt;/code&gt; will be pulled in dynamically from the Vonage Environment, so double-check that you’ve set those values in the environment, then click send.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F09%2Fnumbers-api-postman-request-body.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F09%2Fnumbers-api-postman-request-body.png" alt="Numbers API List numbers you own response body" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Et voilà! You’ve successfully made your fist Vonage API request using our Postman collection!&lt;/p&gt;

&lt;p&gt;Give it a try, have fun, and let us know what you think!&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Next?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/tools/postman" rel="noopener noreferrer"&gt;Vonage APIs Postman Collection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/lornajane/openapi-makes-easier-integrations-5eoj"&gt;OpenAPI Makes Easier Integrations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmodev/evaluate-apis-quickly-and-easily-with-openapi-1g3c-temp-slug-175183"&gt;Evaluate APIs Quickly and Easily with OpenAPI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learning.postman.com/docs/getting-started/introduction/" rel="noopener noreferrer"&gt;Postman Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The post &lt;a href="https://www.nexmo.com/blog/2020/09/16/announcing-the-vonage-apis-postman-collection" rel="noopener noreferrer"&gt;Announcing the Vonage APIs Postman Collection&lt;/a&gt; appeared first on &lt;a href="https://www.nexmo.com" rel="noopener noreferrer"&gt;Vonage Developer Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>developer</category>
      <category>bestpractice</category>
      <category>openapi</category>
      <category>postman</category>
    </item>
    <item>
      <title>Build a ‘Clock in’ Service With the Shortcuts iOS App</title>
      <dc:creator>Julia Biro</dc:creator>
      <pubDate>Thu, 27 Aug 2020 13:27:54 +0000</pubDate>
      <link>https://forem.com/vonagedev/build-a-clock-in-service-with-the-shortcuts-ios-app-47f4</link>
      <guid>https://forem.com/vonagedev/build-a-clock-in-service-with-the-shortcuts-ios-app-47f4</guid>
      <description>&lt;p&gt;Years ago people didn’t have phones, &lt;em&gt;places&lt;/em&gt; did.&lt;/p&gt;

&lt;p&gt;When trying to get ahold of somebody, you’d ring different places. They’d say the person isn’t there, so you’d move on to calling the next place and the next, and then the next one. Until you’d have either reached the person or given up in the process.&lt;/p&gt;

&lt;p&gt;Mobile communications flipped that on its head, and now we phone people because everybody has a little device. We can call a friend and talk to them, no matter where they are. Which is excellent for the majority of the use cases we find ourselves in.&lt;/p&gt;

&lt;p&gt;However, sometimes we do want to phone a place rather than a person. And we don’t care who we speak to, as long as we get through to someone who’s &lt;em&gt;there&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Offices, shared houses, warehouses, equipment sites, etc. could benefit from that painful process from 20 years ago.&lt;/p&gt;

&lt;p&gt;In this tutorial, we’re going to use the &lt;a href="https://apps.apple.com/us/app/shortcuts/id915249334" rel="noopener noreferrer"&gt;Shortcuts&lt;/a&gt; iOS app on an iPhone to bring that back, this time without having to install landlines. You’ll be able to call &lt;em&gt;the&lt;/em&gt; phone number of the place, and that will automatically be re-routed to whoever is in at the time of the call.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://apps.apple.com/us/app/shortcuts/id915249334" rel="noopener noreferrer"&gt;Shortcuts&lt;/a&gt; app installed on an iPhone or an iPad running iOS 12 or later&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dashboard.nexmo.com/sign-up" rel="noopener noreferrer"&gt;Vonage Account&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Vonage API Account
&lt;/h2&gt;

&lt;p&gt;To complete this tutorial, you will need a &lt;a href="http://developer.nexmo.com/ed?c=blog_text&amp;amp;ct=2020-08-26-build-a-clock-in-service-with-the-shortcuts-ios-app" rel="noopener noreferrer"&gt;Vonage API account&lt;/a&gt;. If you don’t have one already, you can &lt;a href="http://developer.nexmo.com/ed?c=blog_text&amp;amp;ct=2020-08-26-build-a-clock-in-service-with-the-shortcuts-ios-app" rel="noopener noreferrer"&gt;sign up today&lt;/a&gt; and start building with free credit. Once you have an account, you can find your API Key and API Secret at the top of the &lt;a href="http://developer.nexmo.com/ed?c=blog_text&amp;amp;ct=2020-08-26-build-a-clock-in-service-with-the-shortcuts-ios-app" rel="noopener noreferrer"&gt;Vonage API Dashboard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://developer.nexmo.com/ed?c=blog_text&amp;amp;ct=2020-08-26-build-a-clock-in-service-with-the-shortcuts-ios-app" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F05%2FStartBuilding_Footer.png" alt="Start building with Vonage" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Shortcuts?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fshortcuts-appstore.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fshortcuts-appstore.png" alt="Image of Shortcuts logo and a few example screenshots from using the app" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Shortcuts app allows you to quickly automate repetitive tasks directly on your iPhone and iPad without the need to write code.&lt;/p&gt;

&lt;p&gt;You can find hundreds of examples in the Gallery or build your own with just a few taps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Actions
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fadd-new-shortcut-action.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fadd-new-shortcut-action.png" alt="Screenshot of the add new action button" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each Shortcut comprises a series of actions.&lt;/p&gt;

&lt;p&gt;An &lt;em&gt;action&lt;/em&gt; is the building block of a Shortcut, a single step that performs a particular function.&lt;/p&gt;

&lt;p&gt;Browse the over 300 built-in actions and use them with apps like Contacts, Calendar, Maps, Music, Photos, Camera, Reminders, Safari, Health, or any other app that supports Siri Shortcuts.&lt;/p&gt;

&lt;p&gt;Once your Shortcut is ready, you can launch it from the Today widget, from Search or by asking Siri. You can even add an app icon to your home screen for your favorite Shortcuts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build Your Shortcut
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Get a Virtual Number
&lt;/h3&gt;

&lt;p&gt;You’ll need a virtual number to list as a contact number. We will later forward calls from this number to a personal phone number.&lt;/p&gt;

&lt;p&gt;In case you already have a Vonage number you’d like to use, find it under &lt;em&gt;Numbers &amp;gt;&lt;/em&gt; &lt;a href="https://dashboard.nexmo.com/your-numbers" rel="noopener noreferrer"&gt;&lt;em&gt;Your Numbers&lt;/em&gt;&lt;/a&gt; in your &lt;a href="https://dashboard.nexmo.com/your-numbers" rel="noopener noreferrer"&gt;Vonage dashboard&lt;/a&gt;. Click on the pencil icon and make sure it is not already in use—settings will be overwritten by the next steps. If all voice config fields are blank, you’re good to continue with creating your Shortcut.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fnumber-config-dashboard.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fnumber-config-dashboard.png" alt="Vonage virtual number config fields in dashboard" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, go to &lt;em&gt;Numbers &amp;gt;&lt;/em&gt; &lt;a href="https://dashboard.nexmo.com/buy-numbers" rel="noopener noreferrer"&gt;&lt;em&gt;Buy Numbers&lt;/em&gt;&lt;/a&gt; and get a voice-enabled number. You can filter the search results by checking &lt;em&gt;VOICE&lt;/em&gt; in the &lt;em&gt;Feature&lt;/em&gt; drop-down. Pick one from the returned results, click &lt;em&gt;Buy&lt;/em&gt; next to it and make a note of it as you’ll need it in the next step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fbuy-number.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fbuy-number.png" alt="Buy Vonage virtual number" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Create a New Shortcut
&lt;/h3&gt;

&lt;p&gt;Next, move on to your mobile device.&lt;/p&gt;

&lt;p&gt;Once you have the &lt;a href="https://apps.apple.com/us/app/shortcuts/id915249334" rel="noopener noreferrer"&gt;Shortcuts&lt;/a&gt; app installed, please open it and click on the &lt;strong&gt;+ Create Shortcut&lt;/strong&gt; button to get started on a new Shortcut.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fcreate-new-shortcut.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fcreate-new-shortcut.png" alt="Create new shortcut" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Action 1: Ask for Input
&lt;/h3&gt;

&lt;p&gt;The first action is collecting the user’s phone number as text input.&lt;/p&gt;

&lt;p&gt;Click on the &lt;strong&gt;+ Add Action&lt;/strong&gt; button, then in the &lt;strong&gt;Scripting&lt;/strong&gt; category under &lt;strong&gt;Notification&lt;/strong&gt; select &lt;strong&gt;Ask for Input&lt;/strong&gt;. Tap on the &lt;code&gt;Question&lt;/code&gt; field and fill in the text you’d like to appear to the user when running this Shortcut. For example, “Set on-call number to:”. Next, tap on &lt;em&gt;Show More&lt;/em&gt; and make sure the &lt;code&gt;Input Type&lt;/code&gt; is &lt;code&gt;text&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fask-for-input.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fask-for-input.png" alt="Action 1 finished, ask for input screenshot" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click the &lt;strong&gt;+&lt;/strong&gt; sign to add a second action.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Action 2: Get Contents of URL
&lt;/h3&gt;

&lt;p&gt;Next, you’ll set up the call forwarding from the Vonage virtual number to the one collected in &lt;em&gt;Action 1&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;To achieve this, you’ll need to make an HTTP request to the &lt;a href="https://developer.nexmo.com/api/numbers?theme=dark" rel="noopener noreferrer"&gt;Numbers API&lt;/a&gt; and update the number that incoming calls should forward to.&lt;/p&gt;

&lt;p&gt;In Shortcuts, as a second action, select &lt;strong&gt;Get Contents of URL&lt;/strong&gt; from the &lt;strong&gt;Web Requests&lt;/strong&gt; section of the &lt;strong&gt;Web&lt;/strong&gt; category.&lt;/p&gt;

&lt;p&gt;Fill in the action so that it reads:&lt;br&gt;&lt;br&gt;
&lt;em&gt;Get contents of &lt;code&gt;https://rest.nexmo.com/number/update?api_key=YOUR-API-KEY&amp;amp;api_secret=YOUR-API-SECRET&lt;/code&gt;&lt;/em&gt;, replacing &lt;code&gt;YOUR-API-KEY&lt;/code&gt; and &lt;code&gt;YOUR-API-SECRET&lt;/code&gt; with your API key and secret found in your &lt;a href="https://dashboard.nexmo.com/" rel="noopener noreferrer"&gt;Vonage dashboard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Next, click on &lt;em&gt;Show More&lt;/em&gt;, select &lt;em&gt;POST&lt;/em&gt; as a &lt;em&gt;Method&lt;/em&gt; and &lt;em&gt;Form&lt;/em&gt; for &lt;em&gt;Request Body&lt;/em&gt;. You’ll have to add four text fields to the &lt;em&gt;Request Body&lt;/em&gt;, as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;country&lt;/td&gt;
&lt;td&gt;The two-character country code in ISO 3166-1 alpha-2 format. For example, GB for Great Britain.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;msisdn&lt;/td&gt;
&lt;td&gt;Your Vonage virtual number in E.164 format. For example, 447401234567.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;voiceCallbackType&lt;/td&gt;
&lt;td&gt;Type &lt;code&gt;tel&lt;/code&gt; to indicate that you’re forwarding calls to a telephone number.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;voiceCallbackValue&lt;/td&gt;
&lt;td&gt;Select &lt;code&gt;Provided Input&lt;/code&gt; from the suggested &lt;em&gt;Variables&lt;/em&gt; list. This will be the personal number captured in &lt;em&gt;Action 1&lt;/em&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fupdate-vonage-number.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Fupdate-vonage-number.png" alt="Image of Get contents of URL config fields in Shortcut" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’re all set to test your Shortcut! Click &lt;em&gt;Done&lt;/em&gt;, then the &lt;strong&gt;▶&lt;/strong&gt; button to test it out! Submit your personal number when prompted, then ring your virtual number to see the call forwarding in action.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Action 3: Append to File
&lt;/h3&gt;

&lt;p&gt;As the final step, let’s create a log of all submitted numbers to keep track of all people that had been on-call.&lt;/p&gt;

&lt;p&gt;Click the &lt;strong&gt;+&lt;/strong&gt; sign to add a third action, then under &lt;strong&gt;Documents&lt;/strong&gt; select &lt;strong&gt;Append to File&lt;/strong&gt; in the &lt;strong&gt;File Storage&lt;/strong&gt; section.&lt;/p&gt;

&lt;p&gt;After the &lt;strong&gt;Append&lt;/strong&gt; keyword, select &lt;strong&gt;Provided Input&lt;/strong&gt; followed by a filler text like “clocked in on”, then select &lt;strong&gt;Current Date&lt;/strong&gt; with your preferred time and date formats. Choose between &lt;em&gt;iCloud Drive&lt;/em&gt; and &lt;em&gt;Dropbox&lt;/em&gt; as a &lt;em&gt;Service&lt;/em&gt;, then fill in the &lt;em&gt;File Path&lt;/em&gt; field and make sure that the &lt;em&gt;Make New Line&lt;/em&gt; option is enabled.&lt;/p&gt;

&lt;p&gt;Finally, click &lt;strong&gt;Done&lt;/strong&gt; and run your Shortcut. Add it to your Home Screen or keep on building it! Let us know how it goes!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Ffinal-run-shortcuts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F08%2Ffinal-run-shortcuts.png" alt="image montage of finished Shortcut, updated number and logs" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://www.nexmo.com/blog/2020/08/27/build-a-clock-in-service-with-the-shortcuts-ios-app" rel="noopener noreferrer"&gt;Build a ‘Clock in’ Service With the Shortcuts iOS App&lt;/a&gt; appeared first on &lt;a href="https://www.nexmo.com" rel="noopener noreferrer"&gt;Vonage Developer Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ios</category>
      <category>siri</category>
      <category>shortcuts</category>
      <category>lowcode</category>
    </item>
    <item>
      <title>Get a “Beautiful Morning Weather” alert with Zapier and Vonage</title>
      <dc:creator>Julia Biro</dc:creator>
      <pubDate>Mon, 13 Jul 2020 13:31:34 +0000</pubDate>
      <link>https://forem.com/vonagedev/get-a-beautiful-morning-weather-alert-with-zapier-and-vonage-75d</link>
      <guid>https://forem.com/vonagedev/get-a-beautiful-morning-weather-alert-with-zapier-and-vonage-75d</guid>
      <description>&lt;p&gt;During the past couple of months, most people’s lives and routines took a turn for the unexpected, and mine was no exception.&lt;/p&gt;

&lt;p&gt;The rhythm I’d gotten into suddenly wasn’t there anymore, and I’ve found myself in desperate need of bringing some structure back into my day-to-day.&lt;/p&gt;

&lt;p&gt;My first action item was to reconquer my mornings and start the day on the right foot. I’ve found taking early morning walks in the sunshine quite uplifting. Throw in an audio book and it gets even better. Afterward, I’d feel energized and having already crossed off two items of my to-do list—exercise and reading, I’d be confident to tackle my day.&lt;/p&gt;

&lt;p&gt;Unfortunately, I found rainy, windy and cold British weather powered morning walks more depressing than uplifting. I’d always wish I had slept in for an extra hour, or simply curled up on the sofa with my morning coffee and a good book.&lt;/p&gt;

&lt;p&gt;Waking up early just to be disappointed was leaving me disheartened. Not the start to the day I was looking for.&lt;/p&gt;

&lt;p&gt;If only there was an alarm clock that would only wake me up if the outdoors were welcoming, right? Right.&lt;/p&gt;

&lt;p&gt;In this tutorial, we’ll build a Zapier workflow (Zap) that pulls real-time weather data at a scheduled time, then based on our preferred parameters, gives us a wake-up call only if the requirements are being met.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we get started, you’ll need a couple of things:&lt;br&gt;&lt;br&gt;
– a &lt;a href="https://zapier.com/sign-up/" rel="noopener noreferrer"&gt;Zapier account&lt;/a&gt;&lt;br&gt;&lt;br&gt;
– a &lt;a href="https://dashboard.nexmo.com/sign-up" rel="noopener noreferrer"&gt;Vonage account&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Vonage API Account
&lt;/h2&gt;

&lt;p&gt;To complete this tutorial, you will need a &lt;a href="http://developer.nexmo.com/ed?c=blog_text&amp;amp;ct=2020-07-13-zapier-weather-voice-notifications-dr" rel="noopener noreferrer"&gt;Vonage API account&lt;/a&gt;. If you don’t have one already, you can &lt;a href="http://developer.nexmo.com/ed?c=blog_text&amp;amp;ct=2020-07-13-zapier-weather-voice-notifications-dr" rel="noopener noreferrer"&gt;sign up today&lt;/a&gt; and start building with free credit. Once you have an account, you can find your API Key and API Secret at the top of the &lt;a href="http://developer.nexmo.com/ed?c=blog_text&amp;amp;ct=2020-07-13-zapier-weather-voice-notifications-dr" rel="noopener noreferrer"&gt;Vonage API Dashboard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://developer.nexmo.com/ed?c=blog_text&amp;amp;ct=2020-07-13-zapier-weather-voice-notifications-dr" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F05%2FStartBuilding_Footer.png" alt="Start building with Vonage" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A Word about Zapier
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fzapier-dashboard.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fzapier-dashboard.png" alt="Zapier Dashboard" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Zapier?
&lt;/h3&gt;

&lt;p&gt;Zapier is a low-code tool that allows you to connect your favorite apps and services. It enables you to automate repetitive tasks without coding or relying on developers to build the integrations between two or more different services.&lt;/p&gt;

&lt;p&gt;To find out more about Zapier, visit their &lt;a href="https://zapier.com/learn/getting-started-guide/what-is-zapier/" rel="noopener noreferrer"&gt;Getting Started with Zapier&lt;/a&gt; guide.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common Terms: Learn to Speak Zapier
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fzapier-weather-notifications.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fzapier-weather-notifications.png" alt="Zapier workflow for weather notifications using Zapier's built-in Apps and the Vonage APIs" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Zap
&lt;/h4&gt;

&lt;p&gt;A Zap is an automated workflow that performs repetitive tasks for you. It is the finished product that you’re building, and it consists of at least two parts: a trigger (every day at 6:30am) and one or more actions (get weather data, then make a call).&lt;/p&gt;

&lt;h4&gt;
  
  
  Trigger
&lt;/h4&gt;

&lt;p&gt;Each Zap starts with one trigger.&lt;br&gt;&lt;br&gt;
A trigger is &lt;em&gt;the&lt;/em&gt; event that sets off the Zap. Once you finish and activate a Zap, Zapier will monitor the app for that event. (Your Zap will only be triggered at 6:30am every morning)&lt;/p&gt;

&lt;h4&gt;
  
  
  Action
&lt;/h4&gt;

&lt;p&gt;An action is an event that happens when your Zap is triggered. In our case, retrieving the weather data is an action. So is filtering the weather data, and making a phone call&lt;/p&gt;

&lt;h4&gt;
  
  
  Task
&lt;/h4&gt;

&lt;p&gt;Each piece of data you run through your Zap counts as a task. That means, if your Zap sends out an SMS notification to 100 people, your Zap just performed 100 tasks. It’s worth having the number of tasks your Zaps run in mind, as this helps determine which Zapier plan is best suited for your needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build Your Zap
&lt;/h2&gt;

&lt;p&gt;For this Zap, we’ll be using a couple of &lt;a href="https://zapier.com/apps/categories/zapier-tools" rel="noopener noreferrer"&gt;built-in Zapier apps&lt;/a&gt;:&lt;br&gt;&lt;br&gt;
– &lt;a href="https://zapier.com/apps/schedule" rel="noopener noreferrer"&gt;Schedule by Zapier&lt;/a&gt; as our trigger.&lt;br&gt;&lt;br&gt;
– &lt;a href="https://zapier.com/apps/weather" rel="noopener noreferrer"&gt;Weather by Zapier&lt;/a&gt; as the first action to get weather data.&lt;br&gt;&lt;br&gt;
– &lt;a href="https://zapier.com/apps/filter" rel="noopener noreferrer"&gt;Filter by Zapier&lt;/a&gt; as the second action to define the conditions under which we want the Zap to execute the following steps.&lt;/p&gt;

&lt;p&gt;Then we’ll have a look at two of the Vonage integrations:&lt;br&gt;&lt;br&gt;
– &lt;a href="https://zapier.com/apps/vonage-voice-api/integrations" rel="noopener noreferrer"&gt;Vonage Voice API&lt;/a&gt; to make the wake-up call.&lt;br&gt;&lt;br&gt;
– &lt;a href="https://zapier.com/apps/vonage-voice-api/integrations" rel="noopener noreferrer"&gt;Vonage SMS API&lt;/a&gt; to deliver weather data to your handset via SMS.&lt;/p&gt;

&lt;p&gt;To get started, click the &lt;strong&gt;Make a ZAP&lt;/strong&gt; button on the top left corner of your &lt;a href="https://zapier.com/app/dashboard" rel="noopener noreferrer"&gt;Zapier dashboard&lt;/a&gt; page.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Trigger: Schedule by Zapier
&lt;/h3&gt;

&lt;p&gt;First, select &lt;a href="https://zapier.com/apps/schedule" rel="noopener noreferrer"&gt;Schedule by Zapier&lt;/a&gt; from the list of available built-in apps.&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fselect-schedule-zapier.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fselect-schedule-zapier.png" alt="Select Schedule by Zapier from the list of built-in apps" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This app offers three trigger events, based on how frequently you’d like your Zap to be run. In this case, select &lt;strong&gt;Every Day&lt;/strong&gt; for a daily reminder.&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fschedule-trigger-event.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fschedule-trigger-event.png" alt="Events drop-down menu for Schedule by Zapier" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, you’ll be prompted to customize the time of the day you’d like your Zap to be triggered.&lt;br&gt;&lt;br&gt;
Specify whether you prefer it to run on weekends or not, by selecting &lt;em&gt;yes&lt;/em&gt; or &lt;em&gt;no&lt;/em&gt; from the drop-down menu.&lt;/p&gt;

&lt;p&gt;As for the &lt;em&gt;Time of Day&lt;/em&gt;, either select a value from the drop-down menu or click &lt;strong&gt;Custom&lt;/strong&gt; and type the desired value. For example, &lt;code&gt;6:32am&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fschedule-customize-day.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fschedule-customize-day.png" alt="Set frequency for Schedule by Zapier" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, Zapier will try to find test data for this event and you’ll be presented with a set of test data. Have a look at these fields and make a note if you find any of the parameters interesting, you’ll be able to pull them in dynamically in later steps!&lt;/p&gt;

&lt;p&gt;Click &lt;em&gt;Continue&lt;/em&gt; to move on to the next step.&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fschedule-test-data.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fschedule-test-data.png" alt="Test data for Schedule by Zapier" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Action 1: Get Weather Data with Weather by Zapier
&lt;/h3&gt;

&lt;p&gt;The first action is getting weather data, and we’ll be using &lt;a href="https://zapier.com/apps/weather" rel="noopener noreferrer"&gt;Weather by Zapier&lt;/a&gt; powered by &lt;a href="https://darksky.net/" rel="noopener noreferrer"&gt;Dark Sky&lt;/a&gt; to accomplish that. Head over to the &lt;a href="https://darksky.net/dev/docs" rel="noopener noreferrer"&gt;Dark Sky docs&lt;/a&gt; to find out more about all the data that is being returned by their API.&lt;/p&gt;

&lt;p&gt;To configure this action, first select &lt;strong&gt;Get Current Weather&lt;/strong&gt; as an &lt;em&gt;Action Event&lt;/em&gt;.&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fget-current-weather.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fget-current-weather.png" alt="Get current weather with Weather by Zapier" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the &lt;em&gt;Customize Current Weather&lt;/em&gt; section you’ll have to fill in the coordinates of your location as &lt;em&gt;Latitude&lt;/em&gt; and &lt;em&gt;Longitude&lt;/em&gt; as well as whether you prefer the temperature data to be sent in Celsius or Fahrenheit.&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.latlong.net/" rel="noopener noreferrer"&gt;LatLong.net&lt;/a&gt; is a handy website that returns latitude and longitude for any location of your choice.&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fcustomize-current-weather.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fcustomize-current-weather.png" alt="Customize fields for Weather by Zapier" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, press &lt;em&gt;Test &amp;amp; Continue&lt;/em&gt;.&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fweather-test-buttons.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fweather-test-buttons.png" alt="Press Test&amp;amp;Continue" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fget-weather-test-data.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fget-weather-test-data.png" alt="Test data for Weather by Zapier" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have a look at the test data and think about what parameters you could use to set your wake-up conditions. Would you like to be woken up only if the temperature is over a certain level? Maybe you have an issue with rain but love snowfall. Can’t stand the wind blowing in your face and it pouring down at the same time? Me neither!&lt;br&gt;&lt;br&gt;
Shop around and see what matters to you the most. When you’re ready, click the &lt;strong&gt;+&lt;/strong&gt; sign to get started on the next action.&lt;/p&gt;

&lt;h3&gt;
  
  
  Action 2: Set Conditions with Filter by Zapier
&lt;/h3&gt;

&lt;p&gt;At this point, we have all the data required to make an informed decision about going out for a walk or curling up on the couch.&lt;br&gt;&lt;br&gt;
Next, let’s describe the case when you’d be up for a walk. What would the weather be like?&lt;/p&gt;

&lt;p&gt;We’ll use &lt;a href="https://zapier.com/apps/filter" rel="noopener noreferrer"&gt;Filter by Zapier&lt;/a&gt; to set up our weather requirements. The Zap will only continue to run if these conditions are being met.&lt;/p&gt;

&lt;p&gt;In this example, I picked &lt;code&gt;Precip Probability&lt;/code&gt; (the chance it will rain) being less than &lt;code&gt;0.1&lt;/code&gt; (10%), and &lt;code&gt;Apparent Temperature&lt;/code&gt; (the temperature outside) greater than &lt;code&gt;0&lt;/code&gt; (0 degrees celsius).&lt;/p&gt;

&lt;p&gt;Go ahead and have a play with it, create a couple of &lt;em&gt;Only continue if…&lt;/em&gt; rules. To add a new condition, click either the &lt;strong&gt;+ AND&lt;/strong&gt; or the &lt;strong&gt;+ OR&lt;/strong&gt; button, depending on whether you’d like both (or all) conditions met for the Zap to continue running, or you’d be happy to wake up in case any of your conditions evaluate as true.&lt;/p&gt;

&lt;p&gt;If at any point you’re unsure of the type of the weather properties or their format, check out the &lt;a href="https://darksky.net/dev/docs" rel="noopener noreferrer"&gt;Dark Sky docs&lt;/a&gt; where each of the parameters is described in detail.&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Ffilter-rules-zapier.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Ffilter-rules-zapier.png" alt="Adding rules to Filter by Zapier" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you’re happy with your filter conditions, click the &lt;strong&gt;+&lt;/strong&gt; button to move on to the next action.&lt;/p&gt;

&lt;h3&gt;
  
  
  Action 3: Create Call with Vonage Voice
&lt;/h3&gt;

&lt;p&gt;Start by searching for and selecting &lt;strong&gt;Vonage Voice API&lt;/strong&gt; as the app for the third action.&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fpick-vonage-voice.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fpick-vonage-voice.png" alt="Select Vonage Voice" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, select an &lt;em&gt;Action Event&lt;/em&gt; to determine how the call progresses.&lt;/p&gt;

&lt;p&gt;For this example, we’ll choose &lt;strong&gt;Create Text to Speech Call&lt;/strong&gt; to have a templated message read out to us once the call comes through.&lt;/p&gt;

&lt;p&gt;Alternatively, you could go with &lt;strong&gt;Create Stream Call&lt;/strong&gt; to have your favorite tunes streamed into your wake-up call, &lt;strong&gt;Create Two Way Call&lt;/strong&gt; to have the Zap call both you and a second person, placing the two of you into the same conversation.&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fpick-tts-vonage.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fpick-tts-vonage.png" alt="Action events for Vonage Voice. Pick text-to-speech" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some of Vonage’s APIs, including the Voice API, use Vonage Applications to hold security and config information needed to connect to Vonage endpoints.&lt;/p&gt;

&lt;p&gt;When prompted to provide your credentials, fill in your API key and secret found in your &lt;a href="https://dashboard.nexmo.com/" rel="noopener noreferrer"&gt;dashboard&lt;/a&gt;, then pick a name for your Vonage Application. Zapier will create this application for you, and you’ll be able to find it in your Vonage account under &lt;a href="https://dashboard.nexmo.com/applications" rel="noopener noreferrer"&gt;&lt;em&gt;Your applications&lt;/em&gt;&lt;/a&gt; going forward.&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fvonage-credentials-zapier.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fvonage-credentials-zapier.png" alt="Vonage credentials pop-up in Zapier" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, you’ll have to set a couple of parameters for the text-to-speech call.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select one of your virtual numbers from the &lt;code&gt;Number You Want To Use For Caller ID&lt;/code&gt; drop-down. This number will appear on the screen of your handset when the call goes through.
&lt;/li&gt;
&lt;li&gt;Key in the &lt;code&gt;Number You Want To Call&lt;/code&gt; in E.164 format. For example 447401234567.
&lt;/li&gt;
&lt;li&gt;Notice that the &lt;code&gt;Content Of The Message To Read&lt;/code&gt; field allows templating. This means that you can mix plain text with dynamic properties from previous steps. Remember all the weather data that came through? Yes, any of that. Take a moment and build the message that you’d like to wake up to. Have a look at the image below for some inspiration.
&lt;/li&gt;
&lt;li&gt;Choose a &lt;code&gt;Voice&lt;/code&gt; name from the drop-down menu to give your message some personality. I’ll go for &lt;code&gt;Nicole, en-AU, female&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When you’re ready, click &lt;em&gt;Continue&lt;/em&gt; and test your Zap.&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fcustomize-tts-vonage-all.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fcustomize-tts-vonage-all.png" alt="Customize Vonage text-to-speech fields in Zapier action" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations! Your Zap is ready to go, turn it on and rest assured that you won’t miss a beautiful morning walk again!&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fvonage-test-zapier.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fvonage-test-zapier.png" alt="Create Vonage text to speech call final test in Zapier" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Extra Credit
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Action 4: Send Weather Data with Vonage SMS
&lt;/h3&gt;

&lt;p&gt;I try not to be any fussier about my mornings than necessary; clothes on, coffee in hand, go, but sometimes it might be helpful to know whether that inviting morning sunshine comes with 5°C or 25°C attached.&lt;/p&gt;

&lt;p&gt;We already have all the weather data from Zapier’s built-in app, so it only takes one extra step to pick the entries we’re interested in and have them delivered via SMS to our handset.&lt;/p&gt;

&lt;p&gt;Click on the &lt;strong&gt;+&lt;/strong&gt; button to add another action and search for &lt;strong&gt;Vonage SMS API&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Next, select &lt;strong&gt;Send SMS&lt;/strong&gt; as the &lt;em&gt;Action Event&lt;/em&gt; and continue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fsend-sms-vonage-zapier.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fsend-sms-vonage-zapier.png" alt="Vonage SMS API integration in Zapier. Select Send SMS from action event drop-down" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Provide tour &lt;em&gt;API KEY&lt;/em&gt; and &lt;em&gt;API SECRET&lt;/em&gt; in the pop-up window to authenticate with the SMS API. Find these credentials in your &lt;a href="https://dashboard.nexmo.com/" rel="noopener noreferrer"&gt;Vonage API dashboard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fvonage-sms-auth-zapier.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fvonage-sms-auth-zapier.png" alt="Vonage SMS credentials in Zapier" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, you’ll have to fill in a couple of details:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;From&lt;/code&gt;: the number or text shown on a handset when it displays your message. You can set it to a custom alphanumeric value like “Weather Zap” if this feature is &lt;a href="https://help.nexmo.com/hc/en-us/articles/115011781468" rel="noopener noreferrer"&gt;supported in your country&lt;/a&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;To&lt;/code&gt;: the number you are sending the SMS to in E.164 format. For example 447401234567.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Text&lt;/code&gt;: the content of your SMS message. Feel free to use templating just like in the text-to-speech call action. For example, I was interested in a weather summary and the apparent temperature—see image below.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fcustomize-send-sms.png" alt="Vonage Send SMS fields" width="800" height="400"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When you’re done, test your Zap and turn it on!&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fsend-sms-test-data.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F07%2Fsend-sms-test-data.png" alt="Zapier test data for sending SMS messages vith Vonage SMS" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s Next?
&lt;/h2&gt;

&lt;p&gt;Fancy trying another tutorial?&lt;br&gt;&lt;br&gt;
– &lt;a href="https://dev.to/lornajane/text-when-you-get-home-safely-with-zapier-18oo-temp-slug-4689376"&gt;Text When You Get Home Safely with Zapier&lt;/a&gt;&lt;br&gt;&lt;br&gt;
– &lt;a href="https://dev.to/nahrinjalal/how-to-send-sms-confirmations-for-new-stripe-charges-with-zapier-2k31-temp-slug-8000822"&gt;Send SMS Confirmations for New Stripe Charges with Zapier&lt;/a&gt;&lt;br&gt;&lt;br&gt;
– &lt;a href="https://dev.to/nahrinjalal/how-to-send-sms-reminders-of-google-calendar-events-with-zapier-49f3"&gt;Send SMS Reminders of Google Calendar Events with Zapier&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What will you build next? Let us know!&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://www.nexmo.com/blog/2020/07/13/zapier-weather-voice-notifications-dr" rel="noopener noreferrer"&gt;Get a “Beautiful Morning Weather” alert with Zapier and Vonage&lt;/a&gt; appeared first on &lt;a href="https://www.nexmo.com" rel="noopener noreferrer"&gt;Vonage Developer Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>zapier</category>
      <category>lowcode</category>
      <category>voice</category>
      <category>productivity</category>
    </item>
    <item>
      <title>I'm Julia, and We Deserve to Be Here</title>
      <dc:creator>Julia Biro</dc:creator>
      <pubDate>Mon, 09 Mar 2020 15:02:23 +0000</pubDate>
      <link>https://forem.com/iza_biro/i-m-julia-and-i-rarely-eat-breakfast-op9</link>
      <guid>https://forem.com/iza_biro/i-m-julia-and-i-rarely-eat-breakfast-op9</guid>
      <description>&lt;p&gt;I'm Julia, and I rarely eat breakfast.  &lt;/p&gt;

&lt;p&gt;I've heard it's the new health thing - never got the memo.&lt;/p&gt;

&lt;p&gt;It's 9:30, and I've got a knot in my stomach. It goes away for a while, then back again at 10:00. 10:30.  &lt;/p&gt;

&lt;p&gt;Geekbot wants to know what I accomplished yesterday - which is great, except when you feel like you have nothing to account for.&lt;/p&gt;

&lt;p&gt;This isn't a strange feeling though, we've been together for a while.  &lt;/p&gt;

&lt;p&gt;It comes around every time I'm asked what I do for a living. I'm a freelancer, a contractor, I have my own company, I work for an API company, I work in DevRel, I'm the one doing the avocado drawings. The two words you've probably never heard me utter is "designer" and "developer". If I ever have to state my work title, I make sure to put a well emphasized "junior" in front of it. People form expectations when they hear the specifics, and I'm not ready to be measured against them.&lt;/p&gt;

&lt;p&gt;Hand me a project or ask me to do something for you. I'll try, I'll have a look, or I'll give it a go. And I most sincerely mean it - I'll set it as my goal, I'll try to accomplish it, I'll give it everything I have and some. What I'll rarely do is make a promise. A promise is a commitment to an end result I'm not confident I can achieve.  &lt;/p&gt;

&lt;p&gt;Looking back at my time spent at uni, I most vividly remember the only thing I tried to forget.  &lt;/p&gt;

&lt;p&gt;I'd always been fascinated by computers and had gone for the computer science courses at school. Soon it was time for higher education and I found myself at a technical university, eagerly heading to what I thought would become the highlight of my year - my first ever hardware workshop.  &lt;/p&gt;

&lt;p&gt;I stepped into a lab full of dismantled computers and random electronics dating back to the 70s. I was in such awe of it all that I completely missed the first ten minutes of the presentation. The daydream didn't last much longer, as my professor's words cut through it: "Pretty faces like you don't belong here".  &lt;/p&gt;

&lt;p&gt;I brushed it off at the time and moved on.&lt;/p&gt;

&lt;p&gt;As the years went by, the pretty face has faded, I can't remember his name or face anymore, but it turns out, "you don't belong here" stuck with me. &lt;/p&gt;

&lt;h2&gt;
  
  
  I Deserve Credit for...
&lt;/h2&gt;

&lt;p&gt;However, I do deserve credit for realizing that no matter how down you feel, there's still plenty you can do to make a difference.  &lt;/p&gt;

&lt;p&gt;Regardless of where you are in your journey, it's always worth looking back as you keep on climbing. I promise there will be someone behind you. See if they need a hand!&lt;/p&gt;

&lt;h2&gt;
  
  
  In 2020 I Continue to Code
&lt;/h2&gt;

&lt;p&gt;Last year I started experimenting with low code, then gathering my thoughts and learnings into blog posts.  &lt;/p&gt;

&lt;p&gt;Enabling people who wouldn't open up a terminal or IDE to still build out their ideas, is extremely rewarding. It's like living in a series of first "Hello World!" moments while witnessing countless ideas come to life.&lt;/p&gt;

&lt;p&gt;In 2020 I continue to code so that more people can code too.&lt;/p&gt;

&lt;h2&gt;
  
  
  I Hope to See...
&lt;/h2&gt;

&lt;p&gt;It's truly amazing to be part of a supportive community that strives for inclusivity. I'm also incredibly proud of my colleagues for empowering the community to be the change we all need. It's heartwarming to read through the &lt;a href="https://dev.to/t/shecoded"&gt;#shecoded&lt;/a&gt; and &lt;a href="https://dev.to/t/shecodedally"&gt;#shecodedally&lt;/a&gt; posts, and I recommend you check them out too.  &lt;/p&gt;

&lt;p&gt;I hope to see this approach applied to different abilities and skill levels, and I hope to see the demystification of the tech industry.  &lt;/p&gt;

&lt;p&gt;It's 2020, it's time we got rid of the gatekeeping. &lt;/p&gt;

&lt;p&gt;Yes, code can be hard, complicated, frustrating, and nerve-wracking, but it can also be fun and rewarding. That's quite a handful of adjectives in there, no need to add scary to them.  &lt;/p&gt;

&lt;h2&gt;
  
  
  My Message for Others
&lt;/h2&gt;

&lt;p&gt;We are fortunate enough to work in an industry where there is space for literally everyone. Let's welcome others and help them discover the parts that keep us all here!&lt;/p&gt;

&lt;p&gt;Happy International Women's Day, everyone! 🎉  &lt;/p&gt;

</description>
      <category>wecoded</category>
    </item>
    <item>
      <title>Sending Group Notifications with Google Sheets and Node-RED</title>
      <dc:creator>Julia Biro</dc:creator>
      <pubDate>Fri, 06 Mar 2020 13:16:53 +0000</pubDate>
      <link>https://forem.com/vonagedev/sending-group-notifications-with-google-sheets-and-node-red-1lpd</link>
      <guid>https://forem.com/vonagedev/sending-group-notifications-with-google-sheets-and-node-red-1lpd</guid>
      <description>&lt;p&gt;Ever got a phone call at 7:59 AM telling you your kid’s school is closed? It was handy, as you were only a couple miles away – on your way home, after dropping them off.&lt;/p&gt;

&lt;p&gt;The announcement process in most schools is still manual nowadays, which works in most cases. When something unexpected happens though, like the school is snowed in, a handful of people scramble to call hundreds of parents. You might get the notification in time, or you could be part of the lucky bunch that ended up in the last batch at 7:59.&lt;/p&gt;

&lt;p&gt;In this tutorial we’re going to build a Node-RED flow that programmatically sends out notifications to a list of contacts, using Google Sheets and the Nexmo SMS API.&lt;/p&gt;

&lt;p&gt;Follow along and pitch it to the principal? Saves you being stuck in traffic on a snow day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before getting started, you’ll need a few things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;a href="https://nodered.org/docs/getting-started/installation" rel="noopener noreferrer"&gt;Node-RED&lt;/a&gt; installation, be it a hosted version or on your machine&lt;/li&gt;
&lt;li&gt;A &lt;a href="https://myaccount.google.com/" rel="noopener noreferrer"&gt;Google account&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;A Nexmo account — &lt;a href="https://dashboard.nexmo.com/sign-up" rel="noopener noreferrer"&gt;create one for free&lt;/a&gt; if you haven’t already&lt;/li&gt;
&lt;li&gt;A way to expose your server to the internet. This either means you’re running a hosted version of Node-RED or using a tunneling service like &lt;a href="https://flows.nodered.org/node/node-red-contrib-ngrok" rel="noopener noreferrer"&gt;ngrok&lt;/a&gt; – get up to speed with this &lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;Getting Started with Ngrok in Node-RED&lt;/a&gt; tutorial&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting Up Your Editor
&lt;/h2&gt;

&lt;p&gt;Once you open your Node-RED Editor, make sure you have the following packages installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://flows.nodered.org/node/node-red-contrib-google-sheets" rel="noopener noreferrer"&gt;node-red-contrib-google-sheets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://flows.nodered.org/node/node-red-contrib-nexmo" rel="noopener noreferrer"&gt;node-red-contrib-nexmo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To do this, click on the hamburger menu, select &lt;em&gt;Manage Palette&lt;/em&gt;. Check for already installed packages under &lt;em&gt;Nodes&lt;/em&gt;, and get new ones from the &lt;em&gt;Install&lt;/em&gt; tab.&lt;/p&gt;

&lt;p&gt;When you’re done, make sure to restart Node-RED and you’re good to go!&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring Your Google Account
&lt;/h2&gt;

&lt;p&gt;To interact with the &lt;em&gt;Google Sheets API&lt;/em&gt;, you’ll need to use a service account – an identity that an instance can use to run API requests on your behalf. It will be used to identify apps running on your instance to other Google Cloud services.&lt;/p&gt;

&lt;p&gt;In this case, your flow that reads a Google Sheet must first authenticate to the Google Sheets API.&lt;/p&gt;

&lt;p&gt;You’ll have to create a service account and grant it access to the Google Sheets API. Next, update your app to pass the service account credentials to the Google Sheets API. This way, your flow authenticates seamlessly to the API without embedding any secret keys or user credentials.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Create a New Service Account
&lt;/h3&gt;

&lt;p&gt;We’ll start by creating a new project on the &lt;a href="https://console.cloud.google.com/projectselector2/iam-admin/serviceaccounts?_ga=2.184919274.-272657095.1578084478&amp;amp;supportedpurview=project" rel="noopener noreferrer"&gt;Service Accounts Page&lt;/a&gt; of the Google Cloud Platform. Click on &lt;em&gt;CREATE&lt;/em&gt; to get started.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-service-accounts-create-project.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-service-accounts-create-project.png" alt="google service accounts create project" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, give your project a name, either select an organization or leave it blank, then press &lt;em&gt;CREATE&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-service-accounts-name-project.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-service-accounts-name-project.png" alt="google service accounts name project" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ll shortly see a notification pop up that your project has been created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-service-accounts-project-created.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-service-accounts-project-created.png" alt="google service accounts project created" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that you have a project, let’s add a service account to it!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-create-service-account.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-create-service-account.png" alt="google create service account" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-name-service-account.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-name-service-account.png" alt="google name service account" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, you’ll need to create a key that you’ll use to authenticate with the GSheet node in your flow. Click on &lt;em&gt;Create Key&lt;/em&gt;, then select &lt;em&gt;JSON&lt;/em&gt; as a key type. Save this file when prompted – keep it handy as you’ll need it soon, then hit &lt;em&gt;Done&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-service-accounts-create-key.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-service-accounts-create-key.png" alt="google service accounts create key" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Enable Google Sheets API for Your Project
&lt;/h3&gt;

&lt;p&gt;From the hamburger menu select &lt;em&gt;APIs and Services&lt;/em&gt; -&amp;gt; &lt;em&gt;Dashboard&lt;/em&gt;, then click the &lt;em&gt;ENABLE APIS AND SERVICES&lt;/em&gt; button. Look for the &lt;em&gt;Google Sheets API&lt;/em&gt; in the API Library, open it and click &lt;em&gt;Enable&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-sheets-enable-api-for-project.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-sheets-enable-api-for-project.gif" alt="google sheets enable api for project" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Sharing Google Sheets with Your Service Account
&lt;/h3&gt;

&lt;p&gt;Go to the &lt;em&gt;Service Accounts&lt;/em&gt; page and make a note of the email address associated with the service account you’ve just created. You’ll need to use this email address to share your spreadsheets with the Service Account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-service-accouns-email.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-service-accouns-email.png" alt="google service accouns email" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Sending Group Notifications with Google Sheets and Node-RED
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Create a Spreadsheet
&lt;/h3&gt;

&lt;p&gt;In case you don’t have a Google Sheet ready, go ahead and create one now.&lt;/p&gt;

&lt;p&gt;Google Sheets use a cell-matrix system, where each column can be identified with a letter (starting with A as the first column) and rows are numbered (1 being the first row). In case you’d like to select the second element of the first row, this would be &lt;strong&gt;B1&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You can also select ranges of cells by using the &lt;strong&gt;TOP_LEFTMOST_CELL:BOTTOM_RIGHTMOST_CELL&lt;/strong&gt; notation. For example, to select the second and third element of rows 1-5, use &lt;strong&gt;B1:C5&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;After creating a spreadsheet you’ll see a &lt;em&gt;Sheet1&lt;/em&gt; tab at the bottom of the screen, which is the worksheet you’re currently one. You can rename it or add more worksheets to your spreadsheet.&lt;/p&gt;

&lt;p&gt;For this tutorial, I’m using one worksheet with 4 columns: Name, Surname, Phone, and Email – you’ll need at least 2 rows of data to follow along.&lt;br&gt;&lt;br&gt;
Make sure you add a phone number you have access to, so that you can test your flow later on.&lt;/p&gt;

&lt;p&gt;Once your spreadsheet is ready, it’s time to share it with your Service Account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgsheets-share-google-sheet.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgsheets-share-google-sheet.png" alt="google sheets share google sheet" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Getting the Data from Your Google Sheet
&lt;/h3&gt;

&lt;p&gt;Start your flow by adding a &lt;strong&gt;GSheet&lt;/strong&gt; node to your workspace. Configure this node to pull in the data from your Google Sheet by filling out the following fields accordingly:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;PARAMETERS&lt;/th&gt;
&lt;th&gt;DESCRIPTION&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Creds&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Press the edit button to provide your Service Account key. Remember the JSON file you downloaded earlier? Copy and paste this JSON key in the text field.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Method&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Select &lt;em&gt;Get Cells&lt;/em&gt; from the drop-down menu. This will grab the data from the Google Sheet and pull it into your flow.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SpreadsheetID&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;You can figure out your spreadsheet ID from the URL of your Google Sheet. For example, if the URL is &lt;a href="https://docs.google.com/spreadsheets/d/1mmXhj40aeSooxmtku3ma4auLyrHhO8xCSQsklZ1_BU/edit#gid=0" rel="noopener noreferrer"&gt;https://docs.google.com/spreadsheets/d/1mmXhj40aeSooxmtku3ma4auLyrHhO8xCSQsklZ1_BU/edit#gid=0&lt;/a&gt;, the SpreadsheetID will be the string found in between &lt;code&gt;d/&lt;/code&gt; and &lt;code&gt;/edit&lt;/code&gt;: &lt;em&gt;1mmXhj40aeSooxmtku3ma4auLyrHhO8xCSQsklZ1_BU&lt;/em&gt;. Have a look at your spreadsheet URL and find your SpreadSheetID. Then paste this string in the &lt;strong&gt;SpreadSheetID&lt;/strong&gt; field.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cells&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Select the cells where your data is located on the spreadsheet. In the example below, this value will be: &lt;code&gt;Sheet1!A2:D30&lt;/code&gt;, as the data is found on the worksheet named “Sheet1”, in columns A-D on rows 2-30. Note that we’re not including the table headers.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Once you’re done editing the &lt;strong&gt;GSheet&lt;/strong&gt; node, press &lt;em&gt;Done&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-sheets-node-setup.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-sheets-node-setup.gif" alt="google sheets node setup" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, let’s have a look at the data we’re getting from the Google Sheets API.&lt;/p&gt;

&lt;p&gt;Add an &lt;strong&gt;inject&lt;/strong&gt; and a &lt;strong&gt;debug&lt;/strong&gt; node to your workspace and connect them to the &lt;strong&gt;GSheet&lt;/strong&gt; one. Hit &lt;em&gt;Deploy&lt;/em&gt;, click on the &lt;strong&gt;inject&lt;/strong&gt; node’s button, then have a look at your debug sidebar.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-sheet-node.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-sheet-node.png" alt="google sheets node" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ll notice that the response in &lt;strong&gt;msg.payload&lt;/strong&gt; is an array of arrays, each of these arrays having 4 elements – one line worth of data.&lt;/p&gt;
&lt;h4&gt;
  
  
  Split the msg.payload Array
&lt;/h4&gt;

&lt;p&gt;This data structure isn’t ideal for further processing, so let’s split the array of arrays into individual arrays.&lt;/p&gt;

&lt;p&gt;Fortunately, there is a default node already in your palette that will do the heavy lifting for you.&lt;/p&gt;

&lt;p&gt;Find the &lt;strong&gt;split&lt;/strong&gt; node under &lt;em&gt;sequence&lt;/em&gt; in your node palette o the left side of your screen. Add it to your workspace, connect it after the &lt;strong&gt;GSheet&lt;/strong&gt; node, follow with a &lt;strong&gt;debug&lt;/strong&gt; , then press &lt;em&gt;Deploy&lt;/em&gt; and run your flow again.&lt;/p&gt;

&lt;p&gt;Glance over to the debug sidebar and notice the response coming through as a sequence of individual arrays. This way we can process them one at a time, as they are coming in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgsheets-sms-split-node.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgsheets-sms-split-node.png" alt="google sheets sms split node" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Set Delay
&lt;/h4&gt;

&lt;p&gt;In most cases, you wouldn’t want to send out messages at this speed, be it via email, SMS or the channel of your choice.&lt;/p&gt;

&lt;p&gt;For example, the Nexmo SMS API has a &lt;a href="https://help.nexmo.com/hc/en-us/articles/203993598-What-is-the-Throughput-Limit-for-Outbound-SMS-" rel="noopener noreferrer"&gt;throughput limit&lt;/a&gt; for outbound SMS – all API keys are set with 30 API request per second throughput restriction by default. On top of this, there are also restrictions when sending from certain numbers, so you might be restricted to 1 SMS per second.&lt;/p&gt;

&lt;p&gt;To make sure you’re not reaching the throughput limits, it’s a good idea to set a delay on each array coming through &lt;strong&gt;msg.payload&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To do this, find the &lt;strong&gt;delay&lt;/strong&gt; node in the &lt;em&gt;function&lt;/em&gt; section of your node palette, and connect it after the &lt;strong&gt;split&lt;/strong&gt; node. Double-click on it to open up the node properties and set the delay to 1 second – this should cover most use cases, but feel free to adjust it as needed.&lt;/p&gt;
&lt;h3&gt;
  
  
  Preparing the Message
&lt;/h3&gt;

&lt;p&gt;At this point, we have all the information we need about the recipients, so let’s move on to the message!&lt;/p&gt;

&lt;p&gt;Although you could send the same message to all recipients, it’s always a good idea to make it a little more personal. Getting the bad news is frustrating enough, and a bad user experience won’t make it any better.&lt;/p&gt;

&lt;p&gt;Adding a bit of templating won’t only give your message a personal touch, it will also make it appear more professional.&lt;/p&gt;

&lt;p&gt;Add a &lt;strong&gt;template&lt;/strong&gt; node after &lt;strong&gt;delay&lt;/strong&gt;. Double-click on it, set &lt;em&gt;Property&lt;/em&gt; to &lt;strong&gt;msg.text&lt;/strong&gt; and get creative with your message in the text field!&lt;/p&gt;

&lt;p&gt;This text field supports &lt;a href="https://mustache.github.io/" rel="noopener noreferrer"&gt;Mustache templating&lt;/a&gt;, so you could start with greeting the recipient using their name: &lt;code&gt;{{payload.0}}&lt;/code&gt;. This expression references the first element of the &lt;strong&gt;msg.payload&lt;/strong&gt; array, the recipient’s first name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgsheets-sms-template-node.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgsheets-sms-template-node.png" alt="google sheets sms template node" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you’re done editing, press &lt;em&gt;Done&lt;/em&gt;, then &lt;em&gt;Deploy&lt;/em&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Sending SMS Notifications
&lt;/h3&gt;

&lt;p&gt;There are many channels available to deliver your notifications, but in bad weather conditions SMS might be your best bet, so we’ll start with this option.&lt;/p&gt;

&lt;p&gt;To send the SMS messages, we’ll use the Nexmo &lt;a href="https://developer.nexmo.com/api/sms" rel="noopener noreferrer"&gt;SMS API&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Scroll down to the &lt;em&gt;nexmo&lt;/em&gt; section of your node palette and add &lt;strong&gt;sendsms&lt;/strong&gt; to your workspace, connected after the &lt;strong&gt;template&lt;/strong&gt; node.&lt;/p&gt;

&lt;p&gt;Set up this node by double-clicking on it and filling in the parameters below. You’ll find &lt;em&gt;API KEY&lt;/em&gt; and &lt;em&gt;API SECRET&lt;/em&gt; by clicking on the edit button next to &lt;em&gt;Nexmo Credentials&lt;/em&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;KEY&lt;/th&gt;
&lt;th&gt;DESCRIPTION&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;API KEY&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Your Nexmo API key, shown in your &lt;a href="https://dashboard.nexmo.com/getting-started-guide" rel="noopener noreferrer"&gt;account overview&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;API SECRET&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Your Nexmo API secret, shown in your &lt;a href="https://dashboard.nexmo.com/getting-started-guide" rel="noopener noreferrer"&gt;account overview&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;TO&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The number you are sending the SMS to, &lt;code&gt;{{msg.payload.2}}&lt;/code&gt; in this case.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;FROM&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The number or text shown on a handset when it displays your message. You can also set a custom alphanumeric FROM value if this feature is &lt;a href="https://help.nexmo.com/hc/en-us/articles/115011781468" rel="noopener noreferrer"&gt;supported in your country&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;TEXT&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The content of your message. Use &lt;code&gt;{{msg.text}}&lt;/code&gt; to reference the templated message you’ve created earlier.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Make sure &lt;em&gt;Unicode&lt;/em&gt; is ticked to keep the formatting of your message, then press &lt;em&gt;Done&lt;/em&gt; and &lt;em&gt;Deploy&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgsheets-sendsms-node-setup.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgsheets-sendsms-node-setup.png" alt="google sheets send sms node setup" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run your flow again and see your templated messages appear in the debug sidebar.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgsheets-templated-sms-debug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgsheets-templated-sms-debug.png" alt="google sheets templated sms in debug" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Delivery Receipts
&lt;/h3&gt;

&lt;p&gt;When you make a successful request to the SMS API, it returns an array of message objects. Ideally, each of these has a status of 0, indicating that your message has successfully been scheduled for sending. These are the response objects that you’ve just seen in the debug area.&lt;/p&gt;

&lt;p&gt;While inspecting this output is quite helpful in determining what the Nexmo SMS API did, there is no guarantee that the message reached the recipient’s handset. Not exactly what you want to hear while sending out snow day alerts, is it?&lt;/p&gt;

&lt;p&gt;Once the message reaches its destination, the carrier returns a &lt;a href="https://developer.nexmo.com/messaging/sms/guides/delivery-receipts" rel="noopener noreferrer"&gt;&lt;strong&gt;Delivery Receipt&lt;/strong&gt;&lt;/a&gt; to Nexmo – so don’t panic! All you need to do is set up a webhook endpoint that Nexmo can forward these &lt;strong&gt;Delivery Receipts&lt;/strong&gt; to.&lt;/p&gt;

&lt;p&gt;Connect a &lt;strong&gt;http&lt;/strong&gt; input node to a &lt;strong&gt;http response&lt;/strong&gt; node, as well as to a &lt;strong&gt;debug&lt;/strong&gt; node, then fill in the &lt;em&gt;URL&lt;/em&gt; field with &lt;code&gt;/receipt&lt;/code&gt; in the &lt;strong&gt;http&lt;/strong&gt; input node.&lt;/p&gt;

&lt;p&gt;Next, you’ll have to let the Nexmo SMS API know where it should forward the delivery receipts. Go to your &lt;a href="https://dashboard.nexmo.com/settings" rel="noopener noreferrer"&gt;API settings&lt;/a&gt; in the &lt;strong&gt;Default SMS Setting&lt;/strong&gt; section.&lt;br&gt;&lt;br&gt;
Set the default webhook URL for delivery receipts to &lt;code&gt;YOUR_URL/receipt&lt;/code&gt;, then &lt;em&gt;Save changes&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fdefault-sms-settings-nexmo-dashboard.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fdefault-sms-settings-nexmo-dashboard.png" alt="default sms settings nexmo dashboard" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can rest assured that your snow day notifications have indeed reached everyone on your list! Don’t take my word for it though, head over to the debug sidebar and read through your delivery receipts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgsheets-sms-event-webhook.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgsheets-sms-event-webhook.png" alt="google sheets sms event webhook" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Where Next?
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Extra Credit: Write Your Delivery Receipts to the Google Sheet
&lt;/h3&gt;

&lt;p&gt;Although the debug sidebar gives you all the insight you’ll ever need, sometimes it’s easier to grasp the result if the data is presented in a more organized fashion.&lt;/p&gt;

&lt;p&gt;In this section, we’ll look into writing your delivery receipts back to the same spreadsheet, on a different worksheet(tab).&lt;/p&gt;
&lt;h4&gt;
  
  
  Pick Your Data
&lt;/h4&gt;

&lt;p&gt;The delivery receipts will contain the following properties of the &lt;strong&gt;msg.payload&lt;/strong&gt; object:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;PROPERTY&lt;/th&gt;
&lt;th&gt;DESCRIPTION&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;msisdn&lt;/td&gt;
&lt;td&gt;The number the message was sent to.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;to&lt;/td&gt;
&lt;td&gt;Your Nexmo number or the SenderID you’ve set when sending the SMS.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;network-code&lt;/td&gt;
&lt;td&gt;The Mobile Country Code Mobile Network Code (MCCMNC) of the carrier the destination phone number is registered with.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;messageId&lt;/td&gt;
&lt;td&gt;The Nexmo ID for this message.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;price&lt;/td&gt;
&lt;td&gt;The cost of this message.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;status&lt;/td&gt;
&lt;td&gt;Will be one of: &lt;em&gt;delivered&lt;/em&gt;, &lt;em&gt;expired&lt;/em&gt;, &lt;em&gt;failed&lt;/em&gt;, &lt;em&gt;rejected&lt;/em&gt;, &lt;em&gt;accepted&lt;/em&gt;, &lt;em&gt;buffered&lt;/em&gt; or &lt;em&gt;unknown&lt;/em&gt;, based on where the message is in the delivery process.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;scts&lt;/td&gt;
&lt;td&gt;When the delivery receipt was received from the carrier in &lt;em&gt;YYMMDDHHMM&lt;/em&gt; format. For example, 2001011400 is at 2020-01-01 14:00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;err-code&lt;/td&gt;
&lt;td&gt;The status of the request. Will be a non 0 value in case of an error. See the &lt;a href="https://developer.nexmo.com/messaging/sms/guides/delivery-receipts#dlr-error-codes" rel="noopener noreferrer"&gt;Delivery Receipt documentation&lt;/a&gt; for more details.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;api-key&lt;/td&gt;
&lt;td&gt;Your Nexmo API key.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;message-timestamp&lt;/td&gt;
&lt;td&gt;The time when Nexmo started to push this Delivery Receipt to your webhook endpoint.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Decide on which of these parameters matter to you, then using a &lt;strong&gt;change&lt;/strong&gt; node, set &lt;strong&gt;msg.payload&lt;/strong&gt; to an array of the respective properties.&lt;/p&gt;

&lt;p&gt;For example, I’m interested in the timestamp, recipient’s number, status, error code and message ID, so I’ll set &lt;strong&gt;msg.payload&lt;/strong&gt; to the following &lt;em&gt;expression&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[payload.`message-timestamp`, payload.msisdn, payload.status, payload.`err-code`, payload.messageId]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Connect this &lt;strong&gt;change&lt;/strong&gt; node into the &lt;strong&gt;/receipt&lt;/strong&gt; webhook, then follow with a &lt;strong&gt;GSheet&lt;/strong&gt; node.&lt;/p&gt;

&lt;h4&gt;
  
  
  Write Your Data to the Google Sheet
&lt;/h4&gt;

&lt;p&gt;Add another worksheet(tab) to your Google Sheet and make a note of its name – will be “Sheet2” by default.&lt;/p&gt;

&lt;p&gt;Next, head back over to your Node-RED editor and open up the &lt;strong&gt;GSheet&lt;/strong&gt; node properties. Select your credentials from the &lt;em&gt;creds&lt;/em&gt; drop-down, select &lt;strong&gt;Append Row&lt;/strong&gt; as a &lt;em&gt;Method&lt;/em&gt;, fill in your &lt;em&gt;SpreadsheetID&lt;/em&gt;, then specify the cell range where you’d like the data to be written. In my case this will be &lt;em&gt;Sheet2!A:E&lt;/em&gt;, as I’d like the data to be spread accross columns A-E on worksheet “Sheet2”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-sheets-append-row-setup.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-sheets-append-row-setup.png" alt="google sheets append row setup" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you’re ready, click &lt;em&gt;Done&lt;/em&gt; and &lt;em&gt;Deploy&lt;/em&gt;, then run your flow again.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs.w.org%2Fimages%2Fcore%2Femoji%2F11.2.0%2F72x72%2F1f389.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs.w.org%2Fimages%2Fcore%2Femoji%2F11.2.0%2F72x72%2F1f389.png" alt="🎉" width="72" height="72"&gt;&lt;/a&gt;Congratulations! Your Delivery Receipts have now been logged onto the second worksheet of your spreadsheet. Head over to your Google Sheet and check them out!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-sheets-delivery-receipts-logged.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fgoogle-sheets-delivery-receipts-logged.png" alt="google sheets delivery receipts logged" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Further Hack Ideas
&lt;/h3&gt;

&lt;p&gt;Tired of having to open up your Node-RED Editor to start your flow? Experiment with different ways to kick it off!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Try replacing the &lt;strong&gt;inject&lt;/strong&gt; node with an &lt;a href="https://dev.to/nexmo/how-to-receive-sms-messages-with-node-red-55ll"&gt;inbound SMS&lt;/a&gt; webhook. Send an SMS to your Nexmo number to achieve your task!&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/nexmo/how-to-receive-phone-calls-with-node-red-3ihc"&gt;Inbound calls&lt;/a&gt; would be another great option! You could even build on it and set up an &lt;a href="https://dev.to/nexmo/how-to-build-an-ivr-using-node-red-and-the-nexmo-apis-4mji"&gt;Interactive Voice Response Menu&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Set up a user interface using the &lt;a href="https://flows.nodered.org/node/node-red-dashboard" rel="noopener noreferrer"&gt;dashboard nodes&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/api/sms" rel="noopener noreferrer"&gt;SMS API Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;Getting Started with Ngrok in Node-RED&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Get a better understanding of &lt;a href="https://developer.nexmo.com/messaging/sms/guides/delivery-receipts" rel="noopener noreferrer"&gt;delivery receipts&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mustache.github.io/" rel="noopener noreferrer"&gt;Mustache templating&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://docs.jsonata.org/overview.html" rel="noopener noreferrer"&gt;JSONata Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://try.jsonata.org/" rel="noopener noreferrer"&gt;JSONata Exerciser&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Try Another Tutorial
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/how-to-build-an-ivr-using-node-red-and-the-nexmo-apis-4mji"&gt;How to Build an IVR using Node-RED and the Nexmo APIs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/build-your-own-voicemail-with-node-red-and-the-nexmo-voice-api-617"&gt;Build Your Own Voicemail With Node-RED and the Nexmo Voice API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.nexmo.com/blog/2019/10/17/forward-call-via-voice-proxy-node-red-dr" rel="noopener noreferrer"&gt;Forward a Call via a Voice Proxy with Node-RED&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/build-a-conference-call-with-node-red-5c45"&gt;Build a Conference Call with Node-RED&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/verify-phone-numbers-with-node-red-39b5"&gt;Verify Phone Numbers with Node-RED&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/how-to-stream-audio-into-a-call-with-node-red-1c1m"&gt;How to Stream Audio into a Call with Node-RED&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/how-to-make-text-to-speech-phone-calls-with-node-red-2nfj"&gt;How to Make Text-to-Speech Phone Calls with Node-RED&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/how-to-receive-phone-calls-with-node-red-3ihc"&gt;How to Receive Phone Calls with Node-RED&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/how-to-send-sms-messages-with-node-red-2l2o"&gt;How to Send SMS Messages with Node-RED&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/how-to-receive-sms-messages-with-node-red-55ll"&gt;How to Receive SMS Messages with Node-RED&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>googlesheets</category>
      <category>node</category>
      <category>nodered</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Build an IVR using Node-RED and the Nexmo APIs</title>
      <dc:creator>Julia Biro</dc:creator>
      <pubDate>Wed, 08 Jan 2020 10:01:04 +0000</pubDate>
      <link>https://forem.com/vonagedev/how-to-build-an-ivr-using-node-red-and-the-nexmo-apis-4mji</link>
      <guid>https://forem.com/vonagedev/how-to-build-an-ivr-using-node-red-and-the-nexmo-apis-4mji</guid>
      <description>&lt;p&gt;An IVR or Interactive Voice Response is a menu of options presented to a caller. They then navigate that menu using the numbers on their keypad to send DTMF (Dual Tone Multi-Frequency) signals.&lt;/p&gt;

&lt;p&gt;Each option on the IVR can direct the call to a different path, for example forwarding the call to a specific destination, playing a recorded piece of information or even triggering another service such as an SMS.&lt;/p&gt;

&lt;p&gt;IVRs are the fundamental navigation method of Voice Call applications. They can have multiple levels, where the selection of one option presents the user with more options, and this can go on to an infinite depth!&lt;/p&gt;

&lt;p&gt;For this tutorial we will just create a single level IVR with three possible paths:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Forward the call to a specific number&lt;/li&gt;
&lt;li&gt;Send caller to voicemail&lt;/li&gt;
&lt;li&gt;Send the caller an SMS&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Dependencies
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;Before getting started, you’ll need a few things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; and &lt;a href="https://nodered.org/docs/getting-started/installation" rel="noopener noreferrer"&gt;Node-RED&lt;/a&gt; installed if you’re developing locally&lt;/li&gt;
&lt;li&gt;A Nexmo account — &lt;a href="https://dashboard.nexmo.com/sign-up" rel="noopener noreferrer"&gt;create one for free&lt;/a&gt; if you haven’t already&lt;/li&gt;
&lt;li&gt;A way to expose your server to the internet. This either means you’re running a hosted version of Node-RED or using a tunneling service like &lt;a href="https://flows.nodered.org/node/node-red-contrib-ngrok" rel="noopener noreferrer"&gt;ngrok&lt;/a&gt; – get up to speed with this &lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;Getting Started with Ngrok in Node-RED&lt;/a&gt; tutorial&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting Your Credentials
&lt;/h3&gt;

&lt;p&gt;To use the Nexmo nodes in Node-RED you’ll have to provide your credentials, so it’s best to keep them handy. Go to your &lt;a href="https://dashboard.nexmo.com" rel="noopener noreferrer"&gt;dashboard&lt;/a&gt; to find your API key and secret and make a note of them.&lt;/p&gt;

&lt;p&gt;Next, you’ll need a &lt;em&gt;voice-enabled&lt;/em&gt; virtual number. Go to Numbers &amp;gt; &lt;a href="https://dashboard.nexmo.com/buy-numbers" rel="noopener noreferrer"&gt;Buy numbers&lt;/a&gt; to get one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F04%2Fbuy-number-nexmo-dashboard.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F04%2Fbuy-number-nexmo-dashboard.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up Your Node-RED Editor
&lt;/h3&gt;

&lt;p&gt;Access your Node-RED editor by pointing your browser at &lt;a href="http://localhost:1880" rel="noopener noreferrer"&gt;http://localhost:1880&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you have the editor open, you’ll need to install the &lt;a href="https://flows.nodered.org/node/node-red-contrib-nexmo" rel="noopener noreferrer"&gt;Nexmo nodes&lt;/a&gt;, the &lt;a href="https://flows.nodered.org/node/node-red-contrib-ngrok" rel="noopener noreferrer"&gt;Ngrok node&lt;/a&gt;(if not using a hosted version of Node-RED) and the default &lt;a href="https://flows.nodered.org/node/node-red-node-email" rel="noopener noreferrer"&gt;Email node&lt;/a&gt;. You can do so under the &lt;em&gt;Manage palette&lt;/em&gt; menu, by searching for the corresponding packages and clicking install:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nexmo: &lt;code&gt;node-red-contrib-nexmo&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Ngrok: &lt;code&gt;node-red-contrib-ngrok&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Email: &lt;code&gt;node-red-node-email&lt;/code&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After restarting Node-RED, you should see all of these nodes appear on the left side of your screen – in your node palette, among other default nodes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Expose Your Local Server to the Internet
&lt;/h2&gt;

&lt;p&gt;In case you’re not using a hosted version of Node-RED, the Nexmo Voice API will need another way to access your webhook endpoints, so let’s &lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;make your local server accessible over the public internet&lt;/a&gt;. If you’re running Node-RED on a public webserver instead of your local machine, you’re all set and ready to move on to the [&lt;em&gt;Create a Nexmo Voice Application&lt;/em&gt;] step.&lt;/p&gt;

&lt;p&gt;A convenient way to do this is by using a tunneling service like &lt;a href="https://ngrok.com" rel="noopener noreferrer"&gt;ngrok&lt;/a&gt;, and there is a &lt;a href="https://flows.nodered.org/node/node-red-contrib-ngrok" rel="noopener noreferrer"&gt;node&lt;/a&gt; for it that you’ve just added to your palette.&lt;/p&gt;

&lt;p&gt;It takes the strings &lt;strong&gt;on&lt;/strong&gt; and &lt;strong&gt;off&lt;/strong&gt; as input to start/stop the tunnel, and outputs the ngrok host address as the &lt;em&gt;msg.payload&lt;/em&gt;. Check out our tutorial on &lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;Getting Started with Ngrok in Node-RED&lt;/a&gt; to find out more.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Import&lt;/em&gt; from &lt;em&gt;Clipboard&lt;/em&gt; the snippet below, then open up the &lt;em&gt;&lt;code&gt;ngrok&lt;/code&gt;&lt;/em&gt; node properties and specify the port number (&lt;code&gt;1880&lt;/code&gt; for Node-RED) and the Region.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[{ "id": "faed0f7.1e524f", "type": "inject", "z": "5b8bbfc3.1a9f18", "name": "", "topic": "", "payload": "on", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 190, "y": 100, "wires": [ [ "8a01baeb.6756d"] ] }, { "id": "11051fa9.75bd1", "type": "inject", "z": "5b8bbfc3.1a9f18", "name": "", "topic": "", "payload": "off", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 190, "y": 160, "wires": [[ "8a01baeb.6756d"] ] }, { "id": "8a01baeb.6756d", "type": "ngrok", "z": "5b8bbfc3.1a9f18", "port": "1880", "creds": "5a9e2b8c.173a2c", "region": "ap", "subdomain": "", "name": "", "x": 400, "y": 140, "wires": [[ "93fd5675.743c1"] ] }, { "id": "93fd5675.743c1", "type": "debug", "z": "5b8bbfc3.1a9f18", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 620, "y": 140, "wires": [] }, { "id": "5a9e2b8c.173a2c", "type": "ngrokauth", "z": "" }]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hit &lt;strong&gt;Deploy&lt;/strong&gt; and click on the &lt;strong&gt;on&lt;/strong&gt; &lt;em&gt;&lt;code&gt;inject&lt;/code&gt;&lt;/em&gt; node’s button, then navigate to the URL displayed in the debug area (YOUR_URL for future reference) to find your Node-RED editor at a public address.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fngrok-nodered.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fngrok-nodered.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a Nexmo Voice Application
&lt;/h2&gt;

&lt;p&gt;The Nexmo Voice API uses Nexmo Applications to hold security and config information needed to connect to Nexmo endpoints.&lt;/p&gt;

&lt;p&gt;In the Nexmo Node-RED palette, several nodes have the capability to create these applications: &lt;em&gt;&lt;code&gt;getrecording&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;earmuff&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;mute&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;hangup&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;transfer&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;createcall&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;playaudio&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;playtts&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;playdtmf&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Drag any of these nodes into your workspace, then double-click on it to open up the node properties.&lt;/p&gt;

&lt;p&gt;Next to the &lt;code&gt;Nexmo Credentials&lt;/code&gt;, select “Add new nexmovoiceapp…” from the drop-down menu and click the edit button. Fill in the details below and click &lt;em&gt;Create New Application&lt;/em&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;KEY&lt;/th&gt;
&lt;th&gt;DESCRIPTION&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Choose a name for your Voice Application, for example, “Nexmo Voice Application”.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API Key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your Nexmo API key, shown in your &lt;a href="https://dashboard.nexmo.com/getting-started-guide" rel="noopener noreferrer"&gt;account overview&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API Secret&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your Nexmo API secret, shown in your &lt;a href="https://dashboard.nexmo.com/getting-started-guide" rel="noopener noreferrer"&gt;account overview&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Answer URL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;YOUR_URL/answer, you’ll be hosting a Nexmo Call Control Object (NCCO) here. – more about this later on.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Event URL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;YOUR_URL/event, you’ll need to reference this when setting up the event handler.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Node-RED will then create a new Nexmo Application on your account and fill in the App ID and Private Key fields. After this step, feel free to delete the Nexmo node you used, as a &lt;code&gt;nexmovoiceapp&lt;/code&gt; config node has been created, and that contains all the Nexmo credentials this flow needs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fcreate-voiceapp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fcreate-voiceapp.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up a Number to Call
&lt;/h2&gt;

&lt;p&gt;Next, you’ll have to link your virtual number to this application.&lt;/p&gt;

&lt;p&gt;Find the Voice Application you’ve just created in your Nexmo Dashboard by navigating to &lt;em&gt;Voice&lt;/em&gt; &amp;gt; &lt;em&gt;&lt;a href="https://dashboard.nexmo.com/voice/your-applications" rel="noopener noreferrer"&gt;Your Applications&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Click on the name of this application, then under the &lt;em&gt;Numbers&lt;/em&gt; tab click on the &lt;strong&gt;Link&lt;/strong&gt; button next to the virtual number you’ve rented earlier.&lt;/p&gt;

&lt;p&gt;In case the number you’d like to use is already linked to another app, click on &lt;strong&gt;Manage number&lt;/strong&gt; and configure it to forward incoming calls to your app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Flink-number.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Flink-number.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Bonus tip:&lt;/em&gt; Use a &lt;em&gt;&lt;code&gt;comment&lt;/code&gt;&lt;/em&gt; node to take note of the Nexmo number linked to your application, this way you always have it handy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Log Call Events
&lt;/h2&gt;

&lt;p&gt;While building flows, it’s quite useful to see your call events in the debug area and have a better understanding of what’s really going on, so let’s add an event webhook! This will also help debugging later on, if needed.&lt;/p&gt;

&lt;p&gt;Connect an &lt;em&gt;&lt;code&gt;http in&lt;/code&gt;&lt;/em&gt; node to an &lt;em&gt;&lt;code&gt;http response&lt;/code&gt;&lt;/em&gt; node, as well as to a &lt;em&gt;&lt;code&gt;debug&lt;/code&gt;&lt;/em&gt; node, so that you can view your call events in the debug sidebar.&lt;/p&gt;

&lt;p&gt;In the &lt;em&gt;&lt;code&gt;http in&lt;/code&gt;&lt;/em&gt; node, select &lt;code&gt;POST&lt;/code&gt; as a &lt;code&gt;Method&lt;/code&gt; and fill in the &lt;code&gt;URL&lt;/code&gt; field with &lt;code&gt;/event&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
The &lt;em&gt;&lt;code&gt;http response&lt;/code&gt;&lt;/em&gt; node should have &lt;code&gt;200&lt;/code&gt; set as &lt;code&gt;Status code&lt;/code&gt;, but don’t worry about it, this is the default value as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-event-webhook.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-event-webhook.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Handle Inbound Calls
&lt;/h2&gt;

&lt;p&gt;When you receive an inbound call to your virtual number, the Nexmo Voice API makes a &lt;code&gt;GET&lt;/code&gt; request to an endpoint you define, &lt;code&gt;YOUR_URL/answer&lt;/code&gt;, and expects a set of instructions on how to handle the call.&lt;/p&gt;

&lt;p&gt;First, let’s implement this endpoint.&lt;/p&gt;
&lt;h3&gt;
  
  
  Define the Webhook Endpoint for Inbound Calls
&lt;/h3&gt;

&lt;p&gt;Add a &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; and a &lt;em&gt;&lt;code&gt;return ncco&lt;/code&gt;&lt;/em&gt; node to your workspace, and wire them together to define a webhook endpoint.&lt;/p&gt;

&lt;p&gt;Next, open up the &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; node properties, select &lt;code&gt;GET&lt;/code&gt; as a &lt;code&gt;Method&lt;/code&gt; and type &lt;code&gt;/answer&lt;/code&gt; in the &lt;code&gt;URL&lt;/code&gt; field, then press &lt;em&gt;Deploy&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Finbound-webhook.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Finbound-webhook.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great! Now you have a webhook that returns an NCCO to Nexmo’s API. At this point it doesn’t contain any instructions, so let’s add some!&lt;/p&gt;
&lt;h3&gt;
  
  
  Build the Nexmo Call Control Object (NCCO)
&lt;/h3&gt;

&lt;p&gt;The instructions expected by the Nexmo API come in the form of a &lt;em&gt;Nexmo Call Control Object&lt;/em&gt;, also known as NCCO.&lt;br&gt;&lt;br&gt;
There are lots of different actions available, find the corresponding dark green nodes under the Nexmo palette in your Node-RED editor or check out the &lt;a href="https://developer.nexmo.com/api/voice/ncco" rel="noopener noreferrer"&gt;NCCO Reference&lt;/a&gt; to find out more about them.&lt;/p&gt;

&lt;p&gt;In this case, you’ll probably want to greet the caller and explain the different routes they could take, then listen for their input. To do this, you’ll need to add a &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node followed by an &lt;em&gt;&lt;code&gt;input&lt;/code&gt;&lt;/em&gt; node.&lt;/p&gt;

&lt;p&gt;Add them to your workspace, then connect them in between the &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;return ncco&lt;/code&gt;&lt;/em&gt; nodes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-answer-url.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-answer-url.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;Next, open up the &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node editor and set the &lt;code&gt;Text{}&lt;/code&gt; field to the message you’d like to be read out to the caller.&lt;/p&gt;

&lt;p&gt;In this tutorial we’ll be implementing 3 routes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;get connected to a human&lt;/li&gt;
&lt;li&gt;leave a voice message&lt;/li&gt;
&lt;li&gt;receive an SMS with an online booking link,
so let’s add the &lt;code&gt;Text{}&lt;/code&gt;accordingly. E.g. &lt;em&gt;“Hi! You’ve reached X, please press 1 to get connected, press 2 to leave a message, or press 3 to book online.”&lt;/em&gt; &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You could also further personalize the experience by selecting a &lt;a href="https://developer.nexmo.com/voice/voice-api/guides/text-to-speech#voice-names" rel="noopener noreferrer"&gt;&lt;code&gt;Voice Name&lt;/code&gt;&lt;/a&gt; or by making use of &lt;a href="https://developer.nexmo.com/voice/voice-api/guides/customizing-tts" rel="noopener noreferrer"&gt;SSML tags&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Make sure to also tick the &lt;em&gt;Barge In&lt;/em&gt; option, which allows the caller to send their input before the text has finished being read. It’s very useful in an IVR and prevents people from having to listen to a long list of options.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-talk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-talk.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;em&gt;&lt;code&gt;input&lt;/code&gt;&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;Next, we configure the &lt;em&gt;&lt;code&gt;input&lt;/code&gt;&lt;/em&gt; node.&lt;/p&gt;

&lt;p&gt;Once the user has entered the required number of digits, those will be sent as a new webhook, so we need to configure that path.&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;URL {}&lt;/code&gt; field enter the full address of your NodeRED instance followed by &lt;code&gt;/input1&lt;/code&gt; (&lt;em&gt;YOUR_URL/input1&lt;/em&gt;), then set the &lt;code&gt;Method&lt;/code&gt; to &lt;code&gt;GET&lt;/code&gt;. If we were to later create a second level to our IVR, we would need to send that input to a different address, e.g. &lt;code&gt;/input2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let’s take this opportunity to pass along the caller number by updating the &lt;code&gt;URL {}&lt;/code&gt; field to &lt;code&gt;YOUR_URL/input1?from={{msg.call.from}}&lt;/code&gt;. It might come in handy later on if we want to keep a record of these numbers.&lt;/p&gt;

&lt;p&gt;Leave &lt;code&gt;Submit on Hash&lt;/code&gt; unchecked for now – this would cause the input to be sent by the user pressing the &lt;em&gt;#&lt;/em&gt; key, e.g. for collecting something like an account number. Keep the default value of &lt;code&gt;Time Out&lt;/code&gt;, but set &lt;code&gt;Max Digits&lt;/code&gt; to &lt;code&gt;1&lt;/code&gt;. This ensures that the user can only press a single key before the input is sent, leaving us with a maximum of 9 options in our menu.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-answer-input.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-answer-input.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Handle the Input
&lt;/h2&gt;

&lt;p&gt;After the caller has submitted their input, we need to listen to it at the new webhook for the input event.&lt;br&gt;&lt;br&gt;
First, we’ll have to implement this endpoint to capture the input value, then based on this value, continue with the route chosen by the caller.&lt;/p&gt;

&lt;p&gt;To make a decision based on the input value, we’ll use a &lt;em&gt;&lt;code&gt;switch&lt;/code&gt;&lt;/em&gt; node, then for each of the options we’ll build the NCCO by wiring together action nodes, closed off by a &lt;strong&gt;&lt;code&gt;return NCCO&lt;/code&gt;&lt;/strong&gt; output node.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Start by adding a &lt;strong&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/strong&gt; node to your workspace. In its node properties, select &lt;code&gt;POST&lt;/code&gt; as a method and type &lt;code&gt;/input&lt;/code&gt; in the answer URL field.&lt;/p&gt;

&lt;p&gt;If you were to connect a &lt;strong&gt;&lt;code&gt;debug&lt;/code&gt;&lt;/strong&gt; node after it, after finishing and running the flow, you would see the parameters returned to the &lt;code&gt;/input&lt;/code&gt; URL:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;uuid&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The unique ID of the Call leg for the user initiating the input.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;conversation_uuid&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The unique ID for this conversation.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;timed_out&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Returns true if this input timed out based on the value of &lt;code&gt;Time Out&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dtmf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The numbers input by your caller, in order.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In our use case, we are trying to get the &lt;code&gt;dtmf&lt;/code&gt; value, as this is the route chosen by the caller.&lt;/p&gt;

&lt;p&gt;Having a closer look at the debug sidebar on completion, we can see that it’s going to be in the &lt;code&gt;dtmf&lt;/code&gt; property of the &lt;code&gt;call&lt;/code&gt; object nested inside the &lt;code&gt;msg&lt;/code&gt; object, so we can reference it as &lt;code&gt;{{msg.call.dtmf}}&lt;/code&gt; in the other nodes of this path.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;em&gt;&lt;code&gt;switch&lt;/code&gt;&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Next, we will separate the different routes based on the &lt;code&gt;{{msg.call.dtmf}}&lt;/code&gt; value as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;is empty&lt;/em&gt; -&amp;gt; read out the options again&lt;/li&gt;
&lt;li&gt;It’s not one of the options given (&lt;em&gt;contains 0, 4, 5, 6, 7, 8, 9&lt;/em&gt;) -&amp;gt; read out the options again&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;= 1&lt;/em&gt; -&amp;gt; connect caller&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;= 2&lt;/em&gt; -&amp;gt; send to voicemail&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;= 3&lt;/em&gt; -&amp;gt; send online booking link via SMS to the caller.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To do so, add a &lt;em&gt;&lt;code&gt;switch&lt;/code&gt;&lt;/em&gt; node to your canvas, in its node editor set &lt;code&gt;Property&lt;/code&gt; to &lt;code&gt;{{msg.call.dtmf}}&lt;/code&gt;, then define rules for the five cases mentioned above.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.nexmo.com/wp-content/uploads/2019/12/ivr-switch.png" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-switch.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Route 1 &amp;amp; 2: Invalid Input
&lt;/h3&gt;

&lt;p&gt;Connect the first two outputs of the &lt;em&gt;&lt;code&gt;switch&lt;/code&gt;&lt;/em&gt; node into the &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node’s input. This way if the caller gives an invalid input (not 1, 2 or 3), the initial TTS message will be repeated, listing the available options.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-switch-invalid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-switch-invalid.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Route 3: Connect Caller
&lt;/h3&gt;

&lt;p&gt;To forward the incoming call, we need to connect it to a new endpoint – in this case, a phone number. To do so, we need a &lt;code&gt;connect&lt;/code&gt; action. Optionally, we could also add a &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node to notify the caller that the connection is being made.&lt;/p&gt;

&lt;p&gt;Wire a &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node into the &lt;em&gt;&lt;code&gt;switch&lt;/code&gt;&lt;/em&gt; node’s third output, then follow with a &lt;em&gt;&lt;code&gt;connect&lt;/code&gt;&lt;/em&gt; and a &lt;em&gt;&lt;code&gt;return ncco&lt;/code&gt;&lt;/em&gt; node.&lt;/p&gt;

&lt;p&gt;First, let’s notify the caller that they are being connected. In the &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node properties, set &lt;code&gt;Text {}&lt;/code&gt; to something like &lt;em&gt;Please wait while we connect you.&lt;/em&gt; or the message of your choice. Feel free to customize this experience by selecting a &lt;a href="https://developer.nexmo.com/voice/voice-api/guides/text-to-speech#voice-names" rel="noopener noreferrer"&gt;&lt;code&gt;Voice Name&lt;/code&gt;&lt;/a&gt; or by using &lt;a href="https://developer.nexmo.com/voice/voice-api/guides/customizing-tts" rel="noopener noreferrer"&gt;SSML tags&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Next, open up the &lt;em&gt;&lt;code&gt;connect&lt;/code&gt;&lt;/em&gt; node editor, select &lt;code&gt;Phone&lt;/code&gt; as an &lt;code&gt;Endpoint&lt;/code&gt; and type in the number you’d like to call in the &lt;code&gt;Number {}&lt;/code&gt; field.&lt;/p&gt;

&lt;p&gt;Leave the &lt;code&gt;From {}&lt;/code&gt; field empty for the Caller ID to appear as unknown, or fill it in with one of your Nexmo virtual numbers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-switch-connect.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-switch-connect.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you’d like to have a sneak peek of the finished product, call your Nexmo number and try it out! Just make sure you don’t press &lt;em&gt;2&lt;/em&gt; or &lt;em&gt;3&lt;/em&gt;, as we haven’t implemented those routes yet.&lt;/p&gt;

&lt;p&gt;You might also want to check out our &lt;a href="https://www.nexmo.com/blog/2019/10/17/forward-call-via-voice-proxy-node-red-dr" rel="noopener noreferrer"&gt;Forward a Call via a Voice Proxy with Node-RED&lt;/a&gt; blog post for a more detailed explanation of this path.&lt;/p&gt;
&lt;h3&gt;
  
  
  Route 4: Send to Voicemail
&lt;/h3&gt;

&lt;p&gt;The next case we’re going to cover is when the caller presses &lt;em&gt;2&lt;/em&gt;, opting for leaving a voice message.&lt;br&gt;&lt;br&gt;
If you’d like to build the voicemail from scratch, head over to our &lt;a href="https://dev.to/nexmo/build-your-own-voicemail-with-node-red-and-the-nexmo-voice-api-617"&gt;Build Your Own Voicemail With Node-RED and the Nexmo Voice API&lt;/a&gt; tutorial for a step-by-step guide.&lt;/p&gt;

&lt;p&gt;Otherwise, import from Clipboard the following JSON file into your Node-RED Editor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[{ "id": "1a10292a.0468d7", "type": "talk", "z": "5b66a8fe.c283c", "text": "Please leave your message at the tone.", "voicename": "", "bargein": false, "loop": "", "level": "", "x": 150, "y": 140, "wires": [ [ "9f6c7f15.1e4d48"] ] }, { "id": "9f6c7f15.1e4d48", "type": "record", "z": "5b66a8fe.c283c", "format": "mp3", "channel": "", "endonsilence": "3", "endonkey": "", "timeout": "", "beepstart": true, "eventurl": "YOUR\_URL/record?from={{msg.call.from}}", "eventmethod": "post", "x": 360, "y": 140, "wires": [[ "f5ae270b.51ba6"] ] }, { "id": "3062ef0c.58d478", "type": "http in", "z": "5b66a8fe.c283c", "name": "", "url": "/record", "method": "post", "upload": false, "swaggerDoc": "", "x": 230, "y": 300, "wires": [[ "5b9e35c2.78611c", "a0e2a9ff.c666d8", "200966c.00b679a"] ] }, { "id": "200966c.00b679a", "type": "http response", "z": "5b66a8fe.c283c", "name": "", "statusCode": "", "headers": {}, "x": 510, "y": 300, "wires": [] }, { "id": "5b9e35c2.78611c", "type": "getrecording", "z": "5b66a8fe.c283c", "creds": "", "filename": "recordings/{{msg.req.query.from}}\_{{msg.payload.timestamp}}.mp3", "x": 460, "y": 360, "wires": [[ "1c3d166.591956a"] ] }, { "id": "a0e2a9ff.c666d8", "type": "debug", "z": "5b66a8fe.c283c", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "x": 470, "y": 240, "wires": [] }, { "id": "a4651c0b.926068", "type": "e-mail", "z": "5b66a8fe.c283c", "server": "smtp.gmail.com", "port": "465", "secure": true, "tls": true, "name": "", "dname": "", "x": 930, "y": 360, "wires": [] }, { "id": "1c3d166.591956a", "type": "change", "z": "5b66a8fe.c283c", "name": "", "rules": [{ "t": "set", "p": "topic", "pt": "msg", "to": "'Voicemail from ' &amp;amp; msg.req.query.from", "tot": "jsonata" }], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 720, "y": 360, "wires": [[ "a4651c0b.926068"] ] }, { "id": "5a0c6126.26ff9", "type": "return ncco", "z": "5b66a8fe.c283c", "name": "", "x": 770, "y": 140, "wires": [] }, { "id": "f5ae270b.51ba6", "type": "talk", "z": "5b66a8fe.c283c", "text": "Thank you, good bye!", "voicename": "", "bargein": false, "loop": "", "level": "", "x": 550, "y": 140, "wires": [[ "5a0c6126.26ff9"] ] }]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are a couple of things you’ll need to do for this to work.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;First, connect the &lt;em&gt;&lt;code&gt;switch&lt;/code&gt;&lt;/em&gt; node’s 4th output into the &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Next, in the &lt;em&gt;&lt;code&gt;record&lt;/code&gt;&lt;/em&gt; node properties replace &lt;em&gt;YOUR_URL&lt;/em&gt; with the address you’re hosting the Node-RED editor at (&lt;code&gt;YOUR_URL/record?from={{msg.call.from}}&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the &lt;em&gt;&lt;code&gt;Get Recording&lt;/code&gt;&lt;/em&gt; node under &lt;em&gt;Nexmo Credentials&lt;/em&gt; select your Voice Application from the drop-down menu.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the &lt;em&gt;&lt;code&gt;email&lt;/code&gt;&lt;/em&gt; node, set &lt;code&gt;To&lt;/code&gt; to the email address where you’d like to send the voice recordings, then provide your email client credentials in the &lt;code&gt;Userid&lt;/code&gt; and &lt;code&gt;Password&lt;/code&gt; fields.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Hit &lt;em&gt;Deploy&lt;/em&gt;, then your voicemail should be up and running. Give it a try!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-voicemail.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-voicemail.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Route 5: Link via SMS
&lt;/h3&gt;

&lt;p&gt;The last route we have to build is for the case when the caller presses &lt;em&gt;3&lt;/em&gt;, choosing to receive an online booking link via SMS.&lt;/p&gt;

&lt;p&gt;First, let’s &lt;em&gt;Import from Clipboard&lt;/em&gt; the snippet below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[{ "id": "a69bd1e4.39586", "type": "sendsms", "z": "5b66a8fe.c283c", "creds": "", "to": "{{msg.call.from}}", "fr": "", "text": "This is supposed to be your link :)", "unicode": false, "x": 550, "y": 660, "wires": [ [ "3fd04afe.60abf6"] ] }, { "id": "3fd04afe.60abf6", "type": "debug", "z": "5b66a8fe.c283c", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "x": 750, "y": 660, "wires": [] }, { "id": "2af4d230.bb1bbe", "type": "talk", "z": "5b66a8fe.c283c", "text": "Your message is on its way!", "voicename": "", "bargein": false, "loop": "", "level": "", "x": 350, "y": 600, "wires": [[ "a69bd1e4.39586", "6f1df801.8db2e8"] ] }, { "id": "6f1df801.8db2e8", "type": "return ncco", "z": "5b66a8fe.c283c", "name": "", "x": 610, "y": 600, "wires": [] }]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After adding it to your workspace, connect the &lt;em&gt;&lt;code&gt;switch&lt;/code&gt;&lt;/em&gt; node’s last output into the &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node’s input.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-sms-path.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-sms-path.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, let’s have a closer look at the individual nodes in this path.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;We use the &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node to give feedback to the caller that something is happening. Feel free to get creative with &lt;a href="(https://developer.nexmo.com/voice/voice-api/guides/text-to-speech#voice-names)"&gt;custom voice names&lt;/a&gt; or &lt;a href="(https://developer.nexmo.com/voice/voice-api/guides/customizing-tts)"&gt;SSML tags&lt;/a&gt;, but a simple &lt;em&gt;“Your message is on its way!”&lt;/em&gt; will suffice as well.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;em&gt;&lt;code&gt;return NCCO&lt;/code&gt;&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;It is followed by a &lt;em&gt;&lt;code&gt;return NCCO&lt;/code&gt;&lt;/em&gt; node to close off this path as well and send our “set of instructions” back to the Nexmo API. There’s no setup needed here.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;em&gt;&lt;code&gt;Send SMS&lt;/code&gt;&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;The &lt;em&gt;&lt;code&gt;Send SMS&lt;/code&gt;&lt;/em&gt; node does the heavy lifting of this path, as it is the one sending the SMS.&lt;br&gt;&lt;br&gt;
You can set up this node by double clicking on it and filling in the parameters below. You’ll find &lt;code&gt;API KEY&lt;/code&gt; and &lt;code&gt;API SECRET&lt;/code&gt; by clicking on the edit button next to &lt;code&gt;Nexmo Credentials&lt;/code&gt;, after selecting &lt;em&gt;Add new nexmobasic&lt;/em&gt; from the drop-down.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;KEY&lt;/th&gt;
&lt;th&gt;DESCRIPTION&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API KEY&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your Nexmo API key, shown in your &lt;a href="https://dashboard.nexmo.com/getting-started-guide" rel="noopener noreferrer"&gt;account overview&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API SECRET&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your Nexmo API secret, shown in your &lt;a href="https://dashboard.nexmo.com/getting-started-guide" rel="noopener noreferrer"&gt;account overview&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;TO&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The number you are sending the SMS to. In this case &lt;code&gt;{{msg.call.from}}&lt;/code&gt;, the caller.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FROM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The number or text shown on a handset when it displays your message. You can set a custom alphanumeric FROM to better represent your brand, if this feature is &lt;a href="https://help.nexmo.com/hc/en-us/articles/115011781468" rel="noopener noreferrer"&gt;supported in your country&lt;/a&gt;. Otherwise, add one of your Nexmo numbers.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;TEXT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The content of your message. Time to get creative 🙂&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-sms-node.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-sms-node.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;&lt;code&gt;debug&lt;/code&gt;&lt;/em&gt; node is completely optional, but it does come in handy when you want to see a bit more details in the debug sidebar.&lt;/p&gt;

&lt;p&gt;You might want to glance over at our &lt;a href="https://www.nexmo.com/blog/2019/04/17/send-sms-messages-node-red-dr" rel="noopener noreferrer"&gt;How to Send SMS Messages with Node-RED guide&lt;/a&gt; to find out more about using the SMS API.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It!
&lt;/h2&gt;

&lt;p&gt;Congratulations! You’ve just built yourself a fully functional Interactive Voice Response Menu! It’s finally time to try it out, so enjoy!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-final.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F12%2Fivr-final.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Next?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/ncco-reference#input" rel="noopener noreferrer"&gt;Input NCCO Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/ncco-reference#record" rel="noopener noreferrer"&gt;Record NCCO Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/overview" rel="noopener noreferrer"&gt;Voice API Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/guides/customizing-tts" rel="noopener noreferrer"&gt;Using SSML Tags&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/guides/text-to-speech#voice-names" rel="noopener noreferrer"&gt;Text-to-Speech Voice Names&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/api/sms" rel="noopener noreferrer"&gt;SMS API Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;Get Started with ngrok in Node-RED&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Try another tutorial!
&lt;/h3&gt;

</description>
      <category>nodered</category>
      <category>node</category>
      <category>voice</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Build Your Own Voicemail With Node-RED and the Nexmo Voice API</title>
      <dc:creator>Julia Biro</dc:creator>
      <pubDate>Thu, 14 Nov 2019 12:54:36 +0000</pubDate>
      <link>https://forem.com/vonagedev/build-your-own-voicemail-with-node-red-and-the-nexmo-voice-api-617</link>
      <guid>https://forem.com/vonagedev/build-your-own-voicemail-with-node-red-and-the-nexmo-voice-api-617</guid>
      <description>&lt;p&gt;I have been avoiding voicemail for most of my life. Most of the time for one simple reason—I could never quite get 100% of the message.&lt;/p&gt;

&lt;p&gt;I would have considered myself lucky if they’d slurred out a number I could have called back, the voicemail had been empty-ish or they had gotten past their first name. In most cases though it would go something like this:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“Hi Julia, this is Ted, I’m with didn’t_really_get_the_name . I’m sorry we haven’t been able to get back together on this – if you’re like me I’m sure you’re being pulled in many different directions and are real busy. Do me a favour, though, and when you get this message, just call me back and leave a message with what you’ve decided to do about my proposal. Either way, it will be nice for me to know. Thanks in advance for that, and I’ll be waiting for your call..”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Ted… Mosby? Crilly? Maybe, Cassidy? We’ll never know.&lt;/p&gt;

&lt;p&gt;Luckily, building your own voicemail in Node-RED is both faster and easier than deciphering those messages. Follow along to see how it works!&lt;/p&gt;

&lt;h2&gt;
  
  
  What You’re Going to Build
&lt;/h2&gt;

&lt;p&gt;This tutorial is part of the &lt;a href="https://www.nexmo.com/blog/tag/node-red" rel="noopener noreferrer"&gt;&lt;em&gt;“Getting Started with Nexmo and Node-RED”&lt;/em&gt;&lt;/a&gt; series.&lt;/p&gt;

&lt;p&gt;These articles show you how to get started with Nexmo APIs like SMS, Voice and Verify, so feel free to refer back to them as you go, or in case you’d like to add another functionality.&lt;/p&gt;

&lt;p&gt;In this tutorial we’ll be building a simple voicemail service that allows callers to reach your Nexmo number and leave a message.&lt;/p&gt;

&lt;p&gt;The recorded voice message will then be fetched from the Nexmo servers and sent to your email address.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dependencies
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;Before getting started, you’ll need a few things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; and &lt;a href="https://nodered.org/docs/getting-started/installation" rel="noopener noreferrer"&gt;Node-RED&lt;/a&gt; installed, if you’re developing locally&lt;/li&gt;
&lt;li&gt;A Nexmo account — &lt;a href="https://dashboard.nexmo.com/sign-up" rel="noopener noreferrer"&gt;create one for free&lt;/a&gt; if you haven’t already&lt;/li&gt;
&lt;li&gt;A way to expose your server to the internet. This either means you’re running a hosted version of Node-RED, or using a tunneling service like &lt;a href="https://flows.nodered.org/node/node-red-contrib-ngrok" rel="noopener noreferrer"&gt;ngrok&lt;/a&gt; – get up to speed with this &lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;Getting Started with Ngrok in Node-RED&lt;/a&gt; tutorial&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting Your Credentials
&lt;/h3&gt;

&lt;p&gt;To use the Nexmo nodes in Node-RED you’ll have to provide your credentials, so it’s best to keep them handy. Go to your &lt;a href="https://dashboard.nexmo.com" rel="noopener noreferrer"&gt;dashboard&lt;/a&gt; to find your API key and secret and make a note of them.&lt;/p&gt;

&lt;p&gt;Next, you’ll need a &lt;em&gt;Voice-enabled&lt;/em&gt; virtual number. Go to Numbers &amp;gt; &lt;a href="https://dashboard.nexmo.com/buy-numbers" rel="noopener noreferrer"&gt;Buy numbers&lt;/a&gt; to get one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F04%2Fbuy-number-nexmo-dashboard.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F04%2Fbuy-number-nexmo-dashboard.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up Your Node-RED Editor
&lt;/h3&gt;

&lt;p&gt;Access your Node-RED editor by pointing your browser at &lt;a href="http://localhost:1880" rel="noopener noreferrer"&gt;http://localhost:1880&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you have the editor open, you’ll need to install the &lt;a href="https://flows.nodered.org/node/node-red-contrib-nexmo" rel="noopener noreferrer"&gt;Nexmo nodes&lt;/a&gt;, the &lt;a href="https://flows.nodered.org/node/node-red-contrib-ngrok" rel="noopener noreferrer"&gt;Ngrok node&lt;/a&gt;(if not using a hosted version of Node-RED) and the default &lt;a href="https://flows.nodered.org/node/node-red-node-email" rel="noopener noreferrer"&gt;Email node&lt;/a&gt;. You can do so under the &lt;em&gt;Manage palette&lt;/em&gt; menu, by searching for the corresponding packages and clicking install:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nexmo: &lt;code&gt;node-red-contrib-nexmo&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Ngrok: &lt;code&gt;node-red-contrib-ngrok&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Email: &lt;code&gt;node-red-node-email&lt;/code&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After restarting Node-RED, you should see all of these nodes appear on the left side of your screen – in your node palette, among other default nodes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Expose Your Local Server to the Internet
&lt;/h2&gt;

&lt;p&gt;In case you’re not using a hosted version of Node-RED, the Nexmo Voice API will need another way to access your webhook endpoints, so let’s &lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;make your local server accessible over the public internet&lt;/a&gt;. If you’re running Node-RED on a public web server instead of your local machine, you’re all set and ready to move on to the [&lt;em&gt;Create a Nexmo Voice Application&lt;/em&gt;] step.&lt;/p&gt;

&lt;p&gt;A convenient way to do this is by using a tunneling service like &lt;a href="https://ngrok.com" rel="noopener noreferrer"&gt;ngrok&lt;/a&gt;, and there is a &lt;a href="https://flows.nodered.org/node/node-red-contrib-ngrok" rel="noopener noreferrer"&gt;node&lt;/a&gt; for it that you’ve just added to your palette.&lt;/p&gt;

&lt;p&gt;It takes the strings &lt;strong&gt;on&lt;/strong&gt; and &lt;strong&gt;off&lt;/strong&gt; as input to start/stop the tunnel, and outputs the ngrok host address as the &lt;em&gt;msg.payload&lt;/em&gt;. Check out our tutorial on &lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;Getting Started with Ngrok in Node-RED&lt;/a&gt; to find out more.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Import&lt;/em&gt; from &lt;em&gt;Clipboard&lt;/em&gt; the snippet below, or have a stab at building this path yourself.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[{ "id": "faed0f7.1e524f", "type": "inject", "z": "5b8bbfc3.1a9f18", "name": "", "topic": "", "payload": "on", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 190, "y": 100, "wires": [ [ "8a01baeb.6756d"] ] }, { "id": "11051fa9.75bd1", "type": "inject", "z": "5b8bbfc3.1a9f18", "name": "", "topic": "", "payload": "off", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 190, "y": 160, "wires": [[ "8a01baeb.6756d"] ] }, { "id": "8a01baeb.6756d", "type": "ngrok", "z": "5b8bbfc3.1a9f18", "port": "1880", "creds": "5a9e2b8c.173a2c", "region": "ap", "subdomain": "", "name": "", "x": 400, "y": 140, "wires": [[ "93fd5675.743c1"] ] }, { "id": "93fd5675.743c1", "type": "debug", "z": "5b8bbfc3.1a9f18", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 620, "y": 140, "wires": [] }, { "id": "5a9e2b8c.173a2c", "type": "ngrokauth", "z": "" }]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, your editor should look similar to this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fngrok-path.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fngrok-path.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As the last step before hitting &lt;strong&gt;Deploy&lt;/strong&gt; , open up the &lt;em&gt;&lt;code&gt;ngrok&lt;/code&gt;&lt;/em&gt; node properties and specify the port number (&lt;code&gt;1880&lt;/code&gt; for Node-RED) and the Region.&lt;/p&gt;

&lt;p&gt;You can also add your authtoken if you already have a ngrok account. Don’t worry if you don’t, just skip this step for now. The node will warn that it is not fully configured but this is not an issue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fngrok-properties.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fngrok-properties.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hit &lt;strong&gt;Deploy&lt;/strong&gt; and click on the &lt;strong&gt;on&lt;/strong&gt; &lt;em&gt;&lt;code&gt;inject&lt;/code&gt;&lt;/em&gt; node’s button, then navigate to the URL displayed in the debug area (YOUR_URL for future reference) to find your Node-RED editor at a public address.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fngrok-nodered.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fngrok-nodered.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a Nexmo Voice Application
&lt;/h2&gt;

&lt;p&gt;The Nexmo Voice API uses Nexmo Applications to hold security and config information needed to connect to Nexmo endpoints.&lt;/p&gt;

&lt;p&gt;In the Nexmo Node-RED palette, several nodes have the capability to create these applications: &lt;em&gt;&lt;code&gt;getrecording&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;earmuff&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;mute&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;hangup&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;transfer&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;createcall&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;playaudio&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;playtts&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;playdtmf&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Drag any of these nodes into your workspace, then double-click on it to open up the node properties.&lt;/p&gt;

&lt;p&gt;Next to the &lt;code&gt;Nexmo Credentials&lt;/code&gt;, select “Add new nexmovoiceapp…” from the drop-down menu and click the edit button. Fill in the details below and click &lt;em&gt;Create New Application&lt;/em&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;KEY&lt;/th&gt;
&lt;th&gt;DESCRIPTION&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Choose a name for your Voice Application, for example “Nexmo Voice Application”.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API Key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your Nexmo API key, shown in your &lt;a href="https://dashboard.nexmo.com/getting-started-guide" rel="noopener noreferrer"&gt;account overview&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API Secret&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your Nexmo API secret, shown in your &lt;a href="https://dashboard.nexmo.com/getting-started-guide" rel="noopener noreferrer"&gt;account overview&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Answer URL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;YOUR_URL/answer, you’ll be hosting a Nexmo Call Control Object (NCCO) here. – more about this later on.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Event URL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;YOUR_URL/event, you’ll need to reference this when setting up the event handler.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Node-RED will then create a new Nexmo Application on your account and fill in the App ID and Private Key fields. After this step, feel free to delete the Nexmo node you used, as a &lt;code&gt;nexmovoiceapp&lt;/code&gt; config node has been created, and that contains all the Nexmo credentials this flow needs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fcreate-voiceapp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fcreate-voiceapp.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Set Up a Number to Call
&lt;/h2&gt;

&lt;p&gt;Next, you’ll have to link your virtual number to this application.&lt;/p&gt;

&lt;p&gt;Find the Voice Application you’ve just created in your Nexmo Dashboard by navigating to &lt;em&gt;Voice&lt;/em&gt; &amp;gt; &lt;em&gt;&lt;a href="https://dashboard.nexmo.com/voice/your-applications" rel="noopener noreferrer"&gt;Your Applications&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Click on the name of this application, then under the &lt;em&gt;Numbers&lt;/em&gt; tab click on the &lt;strong&gt;Link&lt;/strong&gt; button next to the virtual number you’ve rented earlier.&lt;/p&gt;

&lt;p&gt;In case the number you’d like to use is already linked to another app, click on &lt;strong&gt;Manage number&lt;/strong&gt; and configure it to forward incoming calls to your app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Flink-number.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Flink-number.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Bonus tip:&lt;/em&gt; Use a &lt;em&gt;&lt;code&gt;comment&lt;/code&gt;&lt;/em&gt; node to take note of the Nexmo number linked to your application, this way you always have it handy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handle Inbound Calls
&lt;/h2&gt;

&lt;p&gt;When you receive an inbound call to your virtual number, the Nexmo Voice API makes a &lt;code&gt;GET&lt;/code&gt; request to an endpoint you define, &lt;code&gt;YOUR_URL/answer&lt;/code&gt;, and expects a set of instructions on how to handle the call.&lt;/p&gt;

&lt;p&gt;First, let’s implement this endpoint.&lt;/p&gt;

&lt;h3&gt;
  
  
  Define the Webhook Endpoint for Inbound Calls
&lt;/h3&gt;

&lt;p&gt;Add a &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; and a &lt;em&gt;&lt;code&gt;return ncco&lt;/code&gt;&lt;/em&gt; node to your workspace, and wire them together to define a webhook endpoint.&lt;br&gt;&lt;br&gt;
Next, open up the &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; node properties, select &lt;code&gt;GET&lt;/code&gt; as a &lt;code&gt;Method&lt;/code&gt; and type &lt;code&gt;/answer&lt;/code&gt; in the &lt;code&gt;URL&lt;/code&gt; field, then press &lt;em&gt;Deploy&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Finbound-webhook.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Finbound-webhook.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great! Now you have a webhook that returns an NCCO to Nexmo’s API. At this point it doesn’t contain any instructions, so let’s add some!&lt;/p&gt;

&lt;h3&gt;
  
  
  Build the Nexmo Call Control Object (NCCO)
&lt;/h3&gt;

&lt;p&gt;The instructions expected by the Nexmo API come in the form of a &lt;em&gt;Nexmo Call Control Object&lt;/em&gt;, also known as NCCO.&lt;/p&gt;

&lt;p&gt;There are lots of different actions available, find the corresponding nodes under the Nexmo palette in your Node-RED editor or check out the &lt;a href="https://developer.nexmo.com/api/voice/ncco" rel="noopener noreferrer"&gt;NCCO Reference&lt;/a&gt; to find out more about them.&lt;/p&gt;

&lt;p&gt;In this case, you’ll probably want to greet the caller then start recording the message. To do this, you’ll need to add a &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node followed by a &lt;em&gt;&lt;code&gt;record&lt;/code&gt;&lt;/em&gt; node.&lt;/p&gt;

&lt;p&gt;Add them to your workspace, then connect them in between the &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;return ncco&lt;/code&gt;&lt;/em&gt; nodes.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;Next, open up the &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node editor and set the &lt;code&gt;Text{}&lt;/code&gt; field to the message you’d like to be read out to the caller. Eg. “Hi! You’ve reached X, please leave a message.”&lt;/p&gt;

&lt;p&gt;If you’re feeling nostalgic about old school voicemails, you’re all set. On the other hand, you could also personalize the experience by selecting a &lt;a href="https://developer.nexmo.com/voice/voice-api/guides/text-to-speech#voice-names" rel="noopener noreferrer"&gt;&lt;code&gt;Voice Name&lt;/code&gt;&lt;/a&gt; or by making use of &lt;a href="https://developer.nexmo.com/voice/voice-api/guides/customizing-tts" rel="noopener noreferrer"&gt;SSML tags&lt;/a&gt;, so that it sounds more like a person and less like a robot.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;em&gt;&lt;code&gt;record&lt;/code&gt;&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;In the &lt;em&gt;&lt;code&gt;record&lt;/code&gt;&lt;/em&gt; node properties fill in the &lt;code&gt;URL {}&lt;/code&gt; field with &lt;code&gt;YOUR_URL/record&lt;/code&gt;. This is going to be the eventURL that Nexmo will return a set of parameters to, once the recording has completed.&lt;/p&gt;

&lt;p&gt;If you glance over at the &lt;a href="https://developer.nexmo.com/voice/voice-api/ncco-reference#record" rel="noopener noreferrer"&gt;NCCO Reference&lt;/a&gt; you’ll soon realize that the calling number is not one of them.&lt;/p&gt;

&lt;p&gt;Fortunately, we can grab the caller’s phone number from the answerURL and pass it as a query parameter.&lt;/p&gt;

&lt;p&gt;Update the &lt;code&gt;URL {}&lt;/code&gt; field to &lt;code&gt;YOUR_URL//record?from={{msg.call.from}}&lt;/code&gt;. This way we’ll be able to access the &lt;code&gt;from&lt;/code&gt; value through the record eventURL by referencing &lt;code&gt;msg.req.query.from&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Before moving on to the next step, make sure you’ve selected &lt;code&gt;POST&lt;/code&gt; as a &lt;code&gt;Method&lt;/code&gt;, &lt;code&gt;MP3&lt;/code&gt; as a &lt;code&gt;Format&lt;/code&gt; and that you’ve set a value for &lt;code&gt;End On Silence&lt;/code&gt; (eg. 3).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-record.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-record.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you’d like to see the generated NCCO, go to &lt;code&gt;YOUR_URL/answer&lt;/code&gt;. You’ll see a set of actions, or “instructions”, in JSON format that Nexmo will use to control the call flow.&lt;/p&gt;

&lt;p&gt;Ready to take it a step further? Dial your Nexmo number to see it in action!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-ncco.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-ncco.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Fetch Recording
&lt;/h2&gt;

&lt;p&gt;At this point, the caller is greeted by a TTS message followed by a beep tone and their message gets recorded. The next step is to fetch the recording from the Nexmo servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Record eventURL
&lt;/h3&gt;

&lt;p&gt;First, let’s define the record eventURL where we’re expecting the recording parameters to be sent upon completion.&lt;/p&gt;

&lt;p&gt;Add a &lt;em&gt;&lt;code&gt;http in&lt;/code&gt;&lt;/em&gt; node to your workspace, then connect a &lt;em&gt;&lt;code&gt;http response&lt;/code&gt;&lt;/em&gt; node, as well as to a &lt;em&gt;&lt;code&gt;debug&lt;/code&gt;&lt;/em&gt; node to it. This way you can start logging events in the debug area and gain a bit more insight into what is really going on.&lt;/p&gt;

&lt;p&gt;Open up the &lt;em&gt;&lt;code&gt;http in&lt;/code&gt;&lt;/em&gt; node properties, select &lt;code&gt;POST&lt;/code&gt; as a &lt;code&gt;Method&lt;/code&gt; and fill in the &lt;code&gt;URL&lt;/code&gt; field with &lt;code&gt;/record&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;&lt;code&gt;http response&lt;/code&gt;&lt;/em&gt; node should have &lt;code&gt;200&lt;/code&gt; set as &lt;code&gt;Status code&lt;/code&gt;, but don’t worry about it, this is the default value as well.&lt;/p&gt;

&lt;p&gt;Although the recording data is coming through as &lt;code&gt;msg.payload&lt;/code&gt;, we still have the &lt;code&gt;from&lt;/code&gt; value stored in &lt;code&gt;msg.req.query.from&lt;/code&gt;. Make sure you select &lt;code&gt;complete msg object&lt;/code&gt; in the &lt;em&gt;&lt;code&gt;debug&lt;/code&gt;&lt;/em&gt; node’s editor as &lt;code&gt;Output&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Get Recording
&lt;/h3&gt;

&lt;p&gt;To actually retrieve the recording, we’ll be using the &lt;em&gt;&lt;code&gt;getrecording&lt;/code&gt;&lt;/em&gt; Nexmo node.&lt;br&gt;&lt;br&gt;
Add one to your canvas, connect it to the &lt;code&gt;/record&lt;/code&gt; &lt;em&gt;&lt;code&gt;http in&lt;/code&gt;&lt;/em&gt; node and open up its node editor.&lt;/p&gt;

&lt;p&gt;You’ll see two fields:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;Nexmo Credentials&lt;/code&gt; – select the voice application you created earlier from the drop-down menu.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Filename {}&lt;/code&gt; – Notice the &lt;code&gt;{}&lt;/code&gt; sign in the label, which means that this field supports &lt;a href="https://mustache.github.io/" rel="noopener noreferrer"&gt;Mustache templating&lt;/a&gt; and the value can be set dynamically. This gives us the perfect opportunity to include the caller’s number and a timestamp in the filename, so let’s set it to &lt;code&gt;recordings/{{msg.req.query.from}}_{{msg.payload.timestamp}}.mp3&lt;/code&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-getrecording.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-getrecording.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note, this node does not write the audio to disk, the filename field is there to set the value of msg.filename. Next, there are a couple different routes you can take: upload the audio to your own server, follow with a &lt;em&gt;&lt;code&gt;file&lt;/code&gt;&lt;/em&gt; node and download it to your computer, or use an &lt;em&gt;&lt;code&gt;e-mail&lt;/code&gt;&lt;/em&gt; node and send it to yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Send Recording to an Email Address
&lt;/h2&gt;

&lt;p&gt;For this example we’ll use the default Node-RED &lt;em&gt;&lt;code&gt;e-mail&lt;/code&gt;&lt;/em&gt; node, which sends the &lt;code&gt;msg.payload&lt;/code&gt; as an email, with a subject of &lt;code&gt;msg.topic&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In our case, &lt;code&gt;msg.payload&lt;/code&gt; is a binary buffer (the recording) and it will be converted to an attachment. If you wish to add a body to your email set it as &lt;code&gt;msg.description&lt;/code&gt; using a &lt;em&gt;&lt;code&gt;change&lt;/code&gt;&lt;/em&gt; node in the flow before the &lt;em&gt;&lt;code&gt;e-mail&lt;/code&gt;&lt;/em&gt; node.&lt;/p&gt;

&lt;p&gt;The filename will be &lt;code&gt;msg.filename&lt;/code&gt;, which we’ve already specified.&lt;/p&gt;

&lt;p&gt;Connect a &lt;em&gt;&lt;code&gt;change&lt;/code&gt;&lt;/em&gt; node into &lt;em&gt;&lt;code&gt;getrecording&lt;/code&gt;&lt;/em&gt;, followed by an &lt;em&gt;&lt;code&gt;e-mail&lt;/code&gt;&lt;/em&gt; node. You’ll find both in your node palette, &lt;em&gt;&lt;code&gt;change&lt;/code&gt;&lt;/em&gt; under &lt;em&gt;function&lt;/em&gt; and &lt;em&gt;&lt;code&gt;e-mail&lt;/code&gt;&lt;/em&gt; under &lt;em&gt;social&lt;/em&gt;.&lt;br&gt;&lt;br&gt;
Next, let’s see how to configure them.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;&lt;code&gt;change&lt;/code&gt;&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Open up the &lt;em&gt;&lt;code&gt;change&lt;/code&gt;&lt;/em&gt; node properties and define two rules using the &lt;em&gt;set&lt;/em&gt; operation.&lt;/p&gt;

&lt;p&gt;First, let’s set &lt;code&gt;msg.topic&lt;/code&gt;, the subject of the email.&lt;/p&gt;

&lt;p&gt;In the upper field replace &lt;code&gt;payload&lt;/code&gt; with &lt;code&gt;topic&lt;/code&gt;, then select &lt;code&gt;expression&lt;/code&gt; type from the &lt;code&gt;to&lt;/code&gt; drop-down, which uses the &lt;a href="http://jsonata.org/" rel="noopener noreferrer"&gt;JSONata&lt;/a&gt; query and expression language. To include the caller’s number in the email subject, fill in this field with something like &lt;code&gt;'Voicemail from ' &amp;amp; msg.req.query.from&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Click on the &lt;strong&gt;add&lt;/strong&gt; button to define a second rule. This time we’ll be setting the value of &lt;code&gt;msg.description&lt;/code&gt;, the email body. You could use an expression again, or just go with a simple string like “Hey, you’ve got voicemail!”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-change.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-change.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Press &lt;strong&gt;Done&lt;/strong&gt; once you’re finished, and let’s move on to the &lt;em&gt;&lt;code&gt;e-mail&lt;/code&gt;&lt;/em&gt; node!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;&lt;code&gt;e-mail&lt;/code&gt;&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;In the &lt;em&gt;&lt;code&gt;e-mail&lt;/code&gt;&lt;/em&gt; node editor there are three fields you need to fill in: &lt;code&gt;To&lt;/code&gt; – the recipient email address, &lt;code&gt;Userid&lt;/code&gt; and &lt;code&gt;Password&lt;/code&gt; – your email login details.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-email.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-email.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you’re done, hit &lt;strong&gt;Done&lt;/strong&gt; and &lt;strong&gt;Deploy&lt;/strong&gt;. Your Voicemail is up and running!&lt;/p&gt;

&lt;h2&gt;
  
  
  Log Call Events
&lt;/h2&gt;

&lt;p&gt;One more thing before you go! It’s quite useful to see your call events in the debug area and have a better understanding of what’s really going on, so let’s add an event webhook!&lt;/p&gt;

&lt;p&gt;Connect an &lt;em&gt;&lt;code&gt;http in&lt;/code&gt;&lt;/em&gt; node to an &lt;em&gt;&lt;code&gt;http response&lt;/code&gt;&lt;/em&gt; node, as well as to a &lt;em&gt;&lt;code&gt;debug&lt;/code&gt;&lt;/em&gt; node, so that you can view your call events in the debug area.&lt;/p&gt;

&lt;p&gt;In the &lt;em&gt;&lt;code&gt;http in&lt;/code&gt;&lt;/em&gt; node, select &lt;code&gt;POST&lt;/code&gt; as a &lt;code&gt;Method&lt;/code&gt; and fill in the &lt;code&gt;URL&lt;/code&gt; field with &lt;code&gt;/event&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;&lt;code&gt;http response&lt;/code&gt;&lt;/em&gt; node should have &lt;code&gt;200&lt;/code&gt; set as &lt;code&gt;Status code&lt;/code&gt;, but don’t worry about it, this is the default value as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-flow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-flow.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now call your Nexmo number and follow your call events in the debug sidebar!&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it Out!
&lt;/h2&gt;

&lt;p&gt;Et voilà! You’ve built your own voicemail service and, hopefully, you’ll never have to put up with another pesky voicemail again. Call your Nexmo number and an email will be headed your way shortly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-email-in.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fvoicemail-email-in.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Next?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Further Reading
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/overview" rel="noopener noreferrer"&gt;Voice API Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/ncco-reference#record" rel="noopener noreferrer"&gt;Record NCCO Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/guides/text-to-speech#voice-names" rel="noopener noreferrer"&gt;TTS Voice Names&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/guides/customizing-tts" rel="noopener noreferrer"&gt;Using SSML Tags&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;Get Started with ngrok in Node-RED&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>nodered</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Forward a Call via a Voice Proxy with Node-RED</title>
      <dc:creator>Julia Biro</dc:creator>
      <pubDate>Thu, 17 Oct 2019 08:09:37 +0000</pubDate>
      <link>https://forem.com/vonagedev/forward-a-call-via-a-voice-proxy-with-node-red-45g6</link>
      <guid>https://forem.com/vonagedev/forward-a-call-via-a-voice-proxy-with-node-red-45g6</guid>
      <description>&lt;p&gt;In this tutorial we’ll be using the Nexmo Voice API to make private calls, by forwarding a call via a voice proxy, and as an additional bonus we’re also going to add a recording feature to it at the end.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Find out more of what can be done with Node-RED at Vonage Campus, our first customer and developer conference taking place in San Francisco on October 29-30. It’s free to attend, so &lt;a href="https://developer.nexmo.com/campus" rel="noopener noreferrer"&gt;register to join us now&lt;/a&gt;!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you’ve ever wondered how you can contact your ride share driver, Airbnb host or courier without knowing their number, or you’re simply interested in making private calls, follow along and find out how this is done!&lt;/p&gt;

&lt;h2&gt;
  
  
  Dependencies
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;Before getting started, you’ll need a few things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; and &lt;a href="https://nodered.org/docs/getting-started/installation" rel="noopener noreferrer"&gt;Node-RED&lt;/a&gt; installed, if you’re developing locally&lt;/li&gt;
&lt;li&gt;A Nexmo account — &lt;a href="https://dashboard.nexmo.com/sign-up" rel="noopener noreferrer"&gt;create one for free&lt;/a&gt; if you haven’t already&lt;/li&gt;
&lt;li&gt;A way to expose your server to the internet. This either means you’re running a hosted version of Node-RED, or using a tunneling service like &lt;a href="https://flows.nodered.org/node/node-red-contrib-ngrok" rel="noopener noreferrer"&gt;ngrok&lt;/a&gt; – get up to speed with this &lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;Getting Started with Ngrok in Node-RED&lt;/a&gt; tutorial&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting Your Credentials
&lt;/h3&gt;

&lt;p&gt;To use the Nexmo nodes in Node-RED you’ll have to provide your credentials, so it’s best to keep them handy. Go to your &lt;a href="https://dashboard.nexmo.com" rel="noopener noreferrer"&gt;dashboard&lt;/a&gt; to find your API key and secret and make a note of them.&lt;/p&gt;

&lt;p&gt;Next, you’ll need a &lt;em&gt;Voice-enabled&lt;/em&gt; virtual number. Go to Numbers &amp;gt; &lt;a href="https://dashboard.nexmo.com/buy-numbers" rel="noopener noreferrer"&gt;Buy numbers&lt;/a&gt; to get one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F04%2Fbuy-number-nexmo-dashboard.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F04%2Fbuy-number-nexmo-dashboard.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up Your Node-RED Editor
&lt;/h3&gt;

&lt;p&gt;Access your Node-RED editor by pointing your browser at &lt;a href="http://localhost:1880" rel="noopener noreferrer"&gt;http://localhost:1880&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you have the editor open, you’ll need to install the Nexmo nodes. You can do so under the &lt;em&gt;Manage palette&lt;/em&gt; menu, by searching for the &lt;code&gt;node-red-contrib-nexmo&lt;/code&gt; package and clicking install.&lt;/p&gt;

&lt;p&gt;Now you should see all of the Nexmo nodes appear on the left side of your screen – in your node palette, among other default nodes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Expose Your Local Server to the Internet
&lt;/h2&gt;

&lt;p&gt;In case you’re not using a hosted version of Node-RED, the Nexmo Voice API will need another way to access your webhook endpoints, so let’s &lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;make your local server accessible over the public internet&lt;/a&gt;. If you’re running Node-RED on a public web server instead of your local machine, you’re all set and ready to move on to the &lt;a href="https://dev.tolink_me"&gt;&lt;em&gt;Create a Nexmo Voice Application&lt;/em&gt;&lt;/a&gt; step.&lt;/p&gt;

&lt;p&gt;A convenient way to do this is by using a tunneling service like &lt;a href="https://ngrok.com" rel="noopener noreferrer"&gt;ngrok&lt;/a&gt;, and there is a &lt;a href="https://flows.nodered.org/node/node-red-contrib-ngrok" rel="noopener noreferrer"&gt;node&lt;/a&gt; for it that you can install directly from your editor.&lt;/p&gt;

&lt;p&gt;Feel free to also check out our tutorial on &lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;Getting Started with Ngrok in Node-RED&lt;/a&gt; to find out more.&lt;/p&gt;

&lt;p&gt;Once you’ve installed the ngrok node and restarted your editor, the &lt;strong&gt;&lt;code&gt;ngrok&lt;/code&gt;&lt;/strong&gt; node should appear in you node palette. It takes the strings &lt;strong&gt;on&lt;/strong&gt; or &lt;strong&gt;off&lt;/strong&gt; as input to start/stop the tunnel, and outputs the ngrok host address as the &lt;em&gt;msg.payload&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Import&lt;/em&gt; from &lt;em&gt;Clipboard&lt;/em&gt; the snippet below, or have a stab at building this path yourself.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[{ "id": "faed0f7.1e524f", "type": "inject", "z": "5b8bbfc3.1a9f18", "name": "", "topic": "", "payload": "on", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 190, "y": 100, "wires": [ [ "8a01baeb.6756d"] ] }, { "id": "11051fa9.75bd1", "type": "inject", "z": "5b8bbfc3.1a9f18", "name": "", "topic": "", "payload": "off", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 190, "y": 160, "wires": [[ "8a01baeb.6756d"] ] }, { "id": "8a01baeb.6756d", "type": "ngrok", "z": "5b8bbfc3.1a9f18", "port": "1880", "creds": "5a9e2b8c.173a2c", "region": "ap", "subdomain": "", "name": "", "x": 400, "y": 140, "wires": [[ "93fd5675.743c1"] ] }, { "id": "93fd5675.743c1", "type": "debug", "z": "5b8bbfc3.1a9f18", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 620, "y": 140, "wires": [] }, { "id": "5a9e2b8c.173a2c", "type": "ngrokauth", "z": "" } ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, your editor should look similar to this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fngrok-path.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fngrok-path.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As the last step before hitting &lt;strong&gt;Deploy&lt;/strong&gt; , open up the &lt;strong&gt;&lt;code&gt;ngrok&lt;/code&gt;&lt;/strong&gt; node properties and specify the port number (&lt;code&gt;1880&lt;/code&gt; for Node-RED) and the Region.&lt;/p&gt;

&lt;p&gt;You can also add your authtoken for your ngrok account if you have one. Don’t worry if you don’t, just skip this step for now. The node will warn that it is not fully configured but this is not an issue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fngrok-properties.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fngrok-properties.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hit &lt;strong&gt;Deploy&lt;/strong&gt; and click on the &lt;strong&gt;on&lt;/strong&gt;  &lt;strong&gt;&lt;code&gt;inject&lt;/code&gt;&lt;/strong&gt; node’s button, then navigate to the URL displayed in the debug area (YOUR_URL for future reference) to find your Node-RED editor at a public address.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fngrok-nodered-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fngrok-nodered-1.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a Nexmo Voice Application
&lt;/h2&gt;

&lt;p&gt;Some of Nexmo’s APIs, including the Voice API, use Nexmo Applications to hold security and config information needed to connect to Nexmo endpoints.&lt;/p&gt;

&lt;p&gt;In the Nexmo Node-RED palette, several nodes have the capability to create these applications: &lt;strong&gt;&lt;code&gt;getrecording&lt;/code&gt;&lt;/strong&gt; , &lt;strong&gt;&lt;code&gt;earmuff&lt;/code&gt;&lt;/strong&gt; , &lt;strong&gt;&lt;code&gt;mute&lt;/code&gt;&lt;/strong&gt; , &lt;strong&gt;&lt;code&gt;hangup&lt;/code&gt;&lt;/strong&gt; , &lt;strong&gt;&lt;code&gt;transfer&lt;/code&gt;&lt;/strong&gt; , &lt;strong&gt;&lt;code&gt;createcall&lt;/code&gt;&lt;/strong&gt; , &lt;strong&gt;&lt;code&gt;playaudio&lt;/code&gt;&lt;/strong&gt; , &lt;strong&gt;&lt;code&gt;playtts&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;playdtmf&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Drag any of these nodes into your workspace, then double-click on it to open up the node properties.&lt;/p&gt;

&lt;p&gt;Next to the &lt;code&gt;Nexmo Credentials&lt;/code&gt;, select “Add new nexmovoiceapp…” from the drop-down menu and click the edit button. Fill in the details below and click &lt;em&gt;Create New Application&lt;/em&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;KEY&lt;/th&gt;
&lt;th&gt;DESCRIPTION&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Choose a name for your Voice Application, for example “Nexmo Voice Application”.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API Key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your Nexmo API key, shown in your &lt;a href="https://dashboard.nexmo.com/getting-started-guide" rel="noopener noreferrer"&gt;account overview&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API Secret&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your Nexmo API secret, shown in your &lt;a href="https://dashboard.nexmo.com/getting-started-guide" rel="noopener noreferrer"&gt;account overview&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Answer URL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;YOUR_URL/answer, you’ll be hosting a Nexmo Call Control Object (NCCO) here. – more about this later on.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Event URL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;YOUR_URL/event, you’ll need to reference this when setting up the event handler.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Node-RED will then create a new Nexmo Application on your account and fill in the App ID and Private Key fields. After this step, feel free to delete the Nexmo node you used, as a &lt;code&gt;nexmovoiceapp&lt;/code&gt; config node has been created, and that contains all the Nexmo credentials this flow needs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fcreate-voiceapp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fcreate-voiceapp.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Set Up a Number to Call
&lt;/h2&gt;

&lt;p&gt;Next, you’ll have to link your virtual number to this application.&lt;/p&gt;

&lt;p&gt;Find the Voice Application you’ve just created in your Nexmo Dashboard by navigating to &lt;em&gt;Voice&lt;/em&gt; &amp;gt; &lt;em&gt;&lt;a href="https://dashboard.nexmo.com/voice/your-applications" rel="noopener noreferrer"&gt;Your Applications&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Click on the name of this application, then under the &lt;em&gt;Numbers&lt;/em&gt; tab click on the &lt;strong&gt;Link&lt;/strong&gt; button next to the virtual number you’ve rented earlier.&lt;/p&gt;

&lt;p&gt;In case the number you’d like to use is already linked to another app, click on &lt;strong&gt;Manage number&lt;/strong&gt; and configure it to forward incoming calls to your app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Flink-number.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Flink-number.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Bonus tip:&lt;/em&gt; Use a &lt;strong&gt;&lt;code&gt;comment&lt;/code&gt;&lt;/strong&gt; node to take note of the Nexmo number linked to your application, this way you always have it handy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handle Inbound Calls
&lt;/h2&gt;

&lt;p&gt;When you receive an inbound call, the Nexmo Voice API makes a &lt;code&gt;GET&lt;/code&gt; request to an endpoint you define, &lt;code&gt;YOUR_URL/answer&lt;/code&gt;, and expects a set of instructions on how to handle the call.&lt;/p&gt;

&lt;p&gt;These instructions come in the form of a &lt;em&gt;Nexmo Call Control Object&lt;/em&gt;, also known as NCCOs.&lt;br&gt;&lt;br&gt;
There are lots of different actions available, find the corresponding nodes under the Nexmo palette in your Node-RED editor or check out the &lt;a href="https://developer.nexmo.com/api/voice/ncco" rel="noopener noreferrer"&gt;NCCO Reference&lt;/a&gt; to find out more about them.&lt;/p&gt;

&lt;p&gt;For this tutorial we’ll be using the &lt;code&gt;connect&lt;/code&gt; action, so that when the inbound call is received, it gets connected to a new phone number we specify.&lt;/p&gt;

&lt;h3&gt;
  
  
  Define the Webhook Endpoint for Inbound Calls
&lt;/h3&gt;

&lt;p&gt;Add a &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; and a &lt;em&gt;&lt;code&gt;return ncco&lt;/code&gt;&lt;/em&gt; node to your workspace, and wire them together to define a webhook endpoint.&lt;/p&gt;

&lt;p&gt;Next, open up the &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; node properties, select &lt;code&gt;GET&lt;/code&gt; as a &lt;code&gt;Method&lt;/code&gt; and type &lt;code&gt;/answer&lt;/code&gt; in the &lt;code&gt;URL&lt;/code&gt; field, then press &lt;em&gt;Deploy&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Finbound-webhook.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Finbound-webhook.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great! Now you have a webhook that returns an NCCO to Nexmo’s API. At this point it doesn’t contain any actions, so let’s add one!&lt;/p&gt;

&lt;h3&gt;
  
  
  Build the Nexmo Call Control Object
&lt;/h3&gt;

&lt;p&gt;To forward the incoming call, we need to connect it to a new endpoint. To do so, we need a &lt;code&gt;connect&lt;/code&gt; action.&lt;/p&gt;

&lt;p&gt;Add a &lt;em&gt;&lt;code&gt;connect&lt;/code&gt;&lt;/em&gt; node in between the &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; and a &lt;em&gt;&lt;code&gt;return ncco&lt;/code&gt;&lt;/em&gt; nodes. This will add a connect action to the NCCO.&lt;/p&gt;

&lt;p&gt;Open up the &lt;em&gt;&lt;code&gt;connect&lt;/code&gt;&lt;/em&gt; node editor, select &lt;code&gt;Phone&lt;/code&gt; as an &lt;code&gt;Endpoint&lt;/code&gt;and type in the number you’d lilke to call in the &lt;code&gt;Number {}&lt;/code&gt; field.&lt;/p&gt;

&lt;p&gt;Leave the &lt;code&gt;From {}&lt;/code&gt; field empty for the Caller ID to appear as unknown, or fill it in with one of your Nexmo virtual numbers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-connect-node.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-connect-node.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To find out more about the other parameters and the &lt;code&gt;connect&lt;/code&gt; action, check out the &lt;a href="https://developer.nexmo.com/voice/voice-api/ncco-reference#connect" rel="noopener noreferrer"&gt;NCCO Reference&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Log Call Events
&lt;/h2&gt;

&lt;p&gt;Finally, connect an &lt;code&gt;http in&lt;/code&gt; node to an &lt;code&gt;http response&lt;/code&gt; node, as well as to a &lt;code&gt;debug&lt;/code&gt; node, so that you can view your call events in the debug area.&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;http&lt;/code&gt; input node, select &lt;code&gt;POST&lt;/code&gt; as a &lt;code&gt;Method&lt;/code&gt; and fill in the &lt;code&gt;URL&lt;/code&gt; field with &lt;code&gt;/event&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;http response&lt;/code&gt; node should have &lt;code&gt;200&lt;/code&gt; set as &lt;code&gt;Status code&lt;/code&gt;, but don’t worry about it, this is the default value as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-flow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-flow.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now call your Nexmo number and follow your call events in the debug sidebar!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-call-events_.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-call-events_.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add a Recording Feature
&lt;/h2&gt;

&lt;p&gt;When making business phone calls, it’s often helpful to have the option to also record them. So let’s have a look at how we can transform the flow above to give us a recording of the conversation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Update the NCCO
&lt;/h3&gt;

&lt;p&gt;First, we’ll need a &lt;code&gt;record&lt;/code&gt; action added to the Nexmo Call Control Object.&lt;/p&gt;

&lt;p&gt;Recording starts when the record action is executed in the NCCO and finishes when the synchronous condition in the action is met. That is, &lt;code&gt;End On Silence&lt;/code&gt;, &lt;code&gt;timeOut&lt;/code&gt; or &lt;code&gt;endOnKey&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you do not set a synchronous condition, the Voice API immediately executes the next NCCO without recording.&lt;/p&gt;

&lt;p&gt;In our use case, this means that we need to add a &lt;em&gt;&lt;code&gt;record&lt;/code&gt;&lt;/em&gt; node before the &lt;em&gt;&lt;code&gt;connect&lt;/code&gt;&lt;/em&gt; node, and no &lt;code&gt;End On Silence&lt;/code&gt;, &lt;code&gt;Time Out&lt;/code&gt; or &lt;code&gt;End On Key&lt;/code&gt; values should be set.&lt;/p&gt;

&lt;p&gt;Go ahead and add a &lt;em&gt;&lt;code&gt;record&lt;/code&gt;&lt;/em&gt; node to your flow, between the &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;connect&lt;/code&gt;&lt;/em&gt; nodes.&lt;/p&gt;

&lt;p&gt;Open up its properties, fill in the &lt;code&gt;URL {}&lt;/code&gt; field with something like &lt;code&gt;YOUR_URL/record&lt;/code&gt;, select &lt;code&gt;POST&lt;/code&gt; as a &lt;code&gt;Method&lt;/code&gt; and pick a &lt;code&gt;Format&lt;/code&gt; for the recording file – I’ll go with &lt;code&gt;MP3&lt;/code&gt;. You could also tick &lt;code&gt;Beep Start&lt;/code&gt; to have a clear indication of when exactly the recording starts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-record-node.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-record-node.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Add Handler for the Recording eventURL
&lt;/h3&gt;

&lt;p&gt;Next, we need to add a handler for the recording eventURL – &lt;code&gt;YOUR_URL/record&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
This way we receive the event on completion of recording, and then be able to download said recording to our machine.&lt;/p&gt;

&lt;p&gt;Add an &lt;code&gt;http in&lt;/code&gt; node and an &lt;code&gt;http response&lt;/code&gt; node to your workspace and wire them together. Consider also adding a &lt;code&gt;debug&lt;/code&gt; node to see what’s coming through the recording eventURL.&lt;br&gt;&lt;br&gt;
In the &lt;code&gt;http&lt;/code&gt; input node, select &lt;code&gt;POST&lt;/code&gt; as a &lt;code&gt;Method&lt;/code&gt; and fill in the &lt;code&gt;URL&lt;/code&gt; field with &lt;code&gt;/record&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;http response&lt;/code&gt; node should have &lt;code&gt;200&lt;/code&gt; set as &lt;code&gt;Status code&lt;/code&gt;, but this is the default value as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-record-event.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-record-event.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Download Recording
&lt;/h3&gt;

&lt;p&gt;Once the recording has completed, Nexmo sends us the recording URL in the recording event webhook . The last step is fetching the recording and downloading it.&lt;/p&gt;

&lt;p&gt;For this step we’ll need a &lt;em&gt;&lt;code&gt;getrecording&lt;/code&gt;&lt;/em&gt; node to fetch the recording audio from the supplied URL, and a &lt;em&gt;&lt;code&gt;file&lt;/code&gt;&lt;/em&gt; node to write it to a file on our machine.&lt;/p&gt;

&lt;p&gt;Add a &lt;em&gt;&lt;code&gt;getrecording&lt;/code&gt;&lt;/em&gt; node after the &lt;code&gt;/record&lt;/code&gt; &lt;em&gt;&lt;code&gt;http in&lt;/code&gt;&lt;/em&gt; node, then in its node properties select the voice application created earlier from the &lt;code&gt;Nexmo Credentials&lt;/code&gt; drop-down and provide an absolute path as &lt;code&gt;Filename {}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-getrecording.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-getrecording.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And finally, add a &lt;em&gt;&lt;code&gt;file&lt;/code&gt;&lt;/em&gt; node after &lt;em&gt;&lt;code&gt;getrecording&lt;/code&gt;&lt;/em&gt;. In its node editor, make sure the &lt;em&gt;Create directory if it doesn’t exist?&lt;/em&gt; option is ticked and select either &lt;em&gt;overwrite&lt;/em&gt; or &lt;em&gt;append to file&lt;/em&gt; from the &lt;code&gt;Action&lt;/code&gt; drop-down. Leave the &lt;code&gt;Filename&lt;/code&gt; field empty, as this value will be passed in from the &lt;em&gt;&lt;code&gt;getrecording&lt;/code&gt;&lt;/em&gt; node, in &lt;code&gt;{{msg.filename}}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-file-node.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-file-node.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s a wrap! Get a second device or have a friend call your Nexmo number, have a conversation and once you’re done, the recording file will be waiting for you, already domnloaded to your machine. Enjoy!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-recording-download_.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fforward-recording-download_.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Next?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Further Reading
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/overview" rel="noopener noreferrer"&gt;Voice API Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/ncco-reference#record" rel="noopener noreferrer"&gt;Record NCCO Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/ncco-reference#connect" rel="noopener noreferrer"&gt;Connect NCCO Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;Get Started with ngrok in Node-RED&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>nodered</category>
      <category>node</category>
      <category>proxy</category>
      <category>voice</category>
    </item>
    <item>
      <title>Build a Conference Call with Node-RED</title>
      <dc:creator>Julia Biro</dc:creator>
      <pubDate>Mon, 07 Oct 2019 21:52:57 +0000</pubDate>
      <link>https://forem.com/vonagedev/build-a-conference-call-with-node-red-5c45</link>
      <guid>https://forem.com/vonagedev/build-a-conference-call-with-node-red-5c45</guid>
      <description>&lt;p&gt;In &lt;a href="https://www.nexmo.com/blog/tag/node-red" rel="noopener noreferrer"&gt;previous tutorials&lt;/a&gt; you’ve had a chance to get your feet wet in the world of Nexmo APIs, making and receiving phone calls using the &lt;a href="https://developer.nexmo.com/voice/voice-api/overview" rel="noopener noreferrer"&gt;Voice API&lt;/a&gt;, and hopefully also customizing these experiences.&lt;/p&gt;

&lt;p&gt;In today’s tutorial, we’ll take it a step further and build a voice-based conferencing service.&lt;/p&gt;

&lt;p&gt;The user calls a predefined virtual number and inputs a meeting ID using the dial pad, then they get placed in the same conference call with everyone else who has provided the same ID.&lt;/p&gt;

&lt;p&gt;Steps:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Prerequisites
&lt;/li&gt;
&lt;li&gt;Expose Your Local Server to the Internet
&lt;/li&gt;
&lt;li&gt;Define the Webhook Endpoint for Inbound Calls
&lt;/li&gt;
&lt;li&gt;Define the Webhook Endpoint for the Input Event
&lt;/li&gt;
&lt;li&gt;Create a Nexmo Voice Application
&lt;/li&gt;
&lt;li&gt;Set Up a Number to Call
&lt;/li&gt;
&lt;li&gt;Handle Your Call Events
&lt;/li&gt;
&lt;li&gt;Try it out!&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before getting started, you’ll need a few things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; and &lt;a href="https://nodered.org/docs/getting-started/installation" rel="noopener noreferrer"&gt;Node-RED&lt;/a&gt; installed on your machine&lt;/li&gt;
&lt;li&gt;A Nexmo account—&lt;a href="https://dashboard.nexmo.com/sign-up" rel="noopener noreferrer"&gt;create one for free&lt;/a&gt; if you haven’t already&lt;/li&gt;
&lt;li&gt;A way to expose your server to the internet. This either means you’re running a hosted version of Node-RED, or in case you’re developing locally, using a tunneling service like &lt;a href="https://ngrok.com/download" rel="noopener noreferrer"&gt;ngrok&lt;/a&gt;—get up to speed with this &lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;Getting Started with Ngrok in Node-RED&lt;/a&gt; tutorial&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting Your Credentials
&lt;/h3&gt;

&lt;p&gt;To interact with the Voice API, you’ll need to make note of a couple of things. Once you’ve created a Nexmo account, go to the &lt;a href="https://dashboard.nexmo.com" rel="noopener noreferrer"&gt;dashboard&lt;/a&gt; to find your API key and secret.&lt;/p&gt;

&lt;p&gt;Next, you’ll need a &lt;em&gt;Voice-enabled&lt;/em&gt; virtual number. Go to Numbers &amp;gt; &lt;a href="https://dashboard.nexmo.com/buy-numbers" rel="noopener noreferrer"&gt;Buy numbers&lt;/a&gt; to get one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F04%2Fbuy-number-nexmo-dashboard.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F04%2Fbuy-number-nexmo-dashboard.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up Your Node-RED Editor
&lt;/h3&gt;

&lt;p&gt;First, you’ll need to &lt;a href="https://nodered.org/docs/getting-started/installation" rel="noopener noreferrer"&gt;install&lt;/a&gt; the runtime and editor. This could be done either on your local machine, on a Single Board Computer (eg. Raspberry Pi), or through several cloud-hosted options. This example will be using your local machine, so once you’ve installed Node-RED globally, type the command below in your terminal to get started.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ node-red
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can then access the Node-RED editor by pointing your browser at &lt;a href="http://localhost:1880" rel="noopener noreferrer"&gt;http://localhost:1880&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you have your editor open, you’ll need to install the Nexmo nodes. You can do so under the &lt;em&gt;Manage palette&lt;/em&gt; menu, by searching for the &lt;code&gt;node-red-contrib-nexmo&lt;/code&gt; package and clicking install.&lt;/p&gt;

&lt;p&gt;Now you should see all of the Nexmo nodes appear on the left side of your screen—in your node palette, among other default nodes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Expose Your Local Server to the Internet
&lt;/h2&gt;

&lt;p&gt;The Nexmo API will need access to this webhook to make calls against it, so let’s &lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;make the URL accessible over the public internet&lt;/a&gt;. If you’re running Node-RED on a public web server instead of your local machine, you’re all set and ready to move on to the &lt;a href="https://dev.tolink_me"&gt;&lt;em&gt;Create a Nexmo Voice Application&lt;/em&gt;&lt;/a&gt; step.&lt;/p&gt;

&lt;p&gt;Otherwise, a convenient way to do this is by using a tunneling service like &lt;a href="https://ngrok.com" rel="noopener noreferrer"&gt;ngrok&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First, you’ll need to install the ngrok node. To do so, open up &lt;em&gt;Manage palette&lt;/em&gt; from the hamburger menu in your Node-RED editor, search for the &lt;code&gt;node-red-contrib-ngrok&lt;/code&gt; package, and click install. After restarting your editor, the &lt;em&gt;&lt;code&gt;ngrok&lt;/code&gt;&lt;/em&gt; node should appear in the node palette.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fngrok-manage-palette.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fngrok-manage-palette.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;ngrok&lt;/code&gt; node takes the strings &lt;em&gt;on&lt;/em&gt; or &lt;em&gt;off&lt;/em&gt; as input to start/stop the tunnel, and outputs the ngrok host address as the &lt;code&gt;msg.payload&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The easiest way to set this up is to wire two &lt;code&gt;inject&lt;/code&gt; nodes as the &lt;code&gt;ngrok&lt;/code&gt; node’s input, one with the payload of the string &lt;em&gt;on&lt;/em&gt; and the other with &lt;em&gt;off&lt;/em&gt;. For easier use, you could also set the &lt;code&gt;Name&lt;/code&gt; of these nodes accordingly in the node properties, so that it’s clear what functionality they have. Next, to display the host address in the debug sidebar, connect a &lt;code&gt;debug&lt;/code&gt; node after &lt;code&gt;ngrok&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;As the last step before hitting &lt;em&gt;Deploy&lt;/em&gt;, open up the &lt;code&gt;ngrok&lt;/code&gt; node properties and specify the port number. In case of Node-RED, the default value is &lt;code&gt;1880&lt;/code&gt;. The default ngrok Region is US but you can also set it to Europe or Asia. You can also add your authtoken for your ngrok account if you have one. Don’t worry if you don’t, just skip this step for now. The node will warn that it is not fully configured but this is not an issue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fngrok-node-properties.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fngrok-node-properties.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And you’re all set! Once you hit &lt;strong&gt;Deploy&lt;/strong&gt; and click on the &lt;strong&gt;on&lt;/strong&gt; &lt;code&gt;inject&lt;/code&gt; node’s button, navigate to the URL displayed in the debug area (YOUR_URL for future reference) to find your Node-RED editor at a public address.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fngrok-nodered.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fngrok-nodered.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Define the Webhook Endpoint for Inbound Calls
&lt;/h2&gt;

&lt;p&gt;Nexmo calls are controlled using &lt;em&gt;Nexmo Call Control Objects&lt;/em&gt;, also known as NCCOs. An NCCO defines a list of actions to be followed when a call is handled. There are lots of different actions available; find the corresponding nodes under the Nexmo palette in your Node-RED editor or check out the &lt;a href="https://developer.nexmo.com/api/voice/ncco" rel="noopener noreferrer"&gt;NCCO Reference&lt;/a&gt; to find out more about them.&lt;/p&gt;

&lt;p&gt;When handling inbound calls, you need your NCCO hosted at an &lt;em&gt;Answer URL&lt;/em&gt;. In this case, we’ll be using a &lt;code&gt;talk&lt;/code&gt; action to ask tor the meeting ID, then an &lt;code&gt;input&lt;/code&gt; action to collect it.&lt;/p&gt;

&lt;p&gt;Add a &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; input node to your canvas, followed by a &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node, an &lt;em&gt;&lt;code&gt;input&lt;/code&gt;&lt;/em&gt; node and a &lt;em&gt;&lt;code&gt;return NCCO&lt;/code&gt;&lt;/em&gt; output node.&lt;/p&gt;

&lt;p&gt;Next, in the &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; node, select &lt;code&gt;GET&lt;/code&gt; as a &lt;code&gt;Method&lt;/code&gt; and type &lt;code&gt;/answer&lt;/code&gt; in the answer URL field.&lt;/p&gt;

&lt;p&gt;In the &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node properties set the &lt;code&gt;Text{}&lt;/code&gt; field to the message you’d like to be read out when the call is answered. E.g. “Please enter the meeting ID”. You can also select a &lt;code&gt;Voice Name&lt;/code&gt;, see the &lt;a href="https://developer.nexmo.com/voice/voice-api/guides/text-to-speech#voice-names" rel="noopener noreferrer"&gt;Text to Speech Guide&lt;/a&gt; for the full list of options.&lt;/p&gt;

&lt;p&gt;Finally open the &lt;em&gt;&lt;code&gt;input&lt;/code&gt;&lt;/em&gt; node editor, set &lt;code&gt;YOUR_URL/input&lt;/code&gt; as the &lt;code&gt;URL {}&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt; as a &lt;code&gt;Method&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;At this time you could also set a couple of other parameters to further customize the experience:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;Submit On Hash&lt;/code&gt;:&lt;/td&gt;
&lt;td&gt;Set to true so the caller’s activity is sent to your webhook endpoint at &lt;code&gt;YOUR_URL/input&lt;/code&gt; after they press &lt;code&gt;#&lt;/code&gt;. If &lt;code&gt;#&lt;/code&gt; is not pressed the result is submitted after &lt;code&gt;Time Out&lt;/code&gt; seconds. The default value is false.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;Time Out&lt;/code&gt;:&lt;/td&gt;
&lt;td&gt;The result of the caller’s activity is sent to the &lt;code&gt;YOUR_URL/input&lt;/code&gt; webhook endpoint &lt;code&gt;Time Out&lt;/code&gt; seconds after the last action. The default value is 3. Max is 10.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;Max Digits&lt;/code&gt;:&lt;/td&gt;
&lt;td&gt;The number of digits the user can press. The maximum value is 20, the default is 4 digits.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Find out more about these in the &lt;a href="https://developer.nexmo.com/voice/voice-api/ncco-reference#input" rel="noopener noreferrer"&gt;NCCO Reference&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fconference-answer-url.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fconference-answer-url.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Define the Webhook Endpoint for the Input Event
&lt;/h2&gt;

&lt;p&gt;You’ll also need a second endpoint to capture the DTMF input from the user, and based on the code they have submitted, place them into a &lt;em&gt;conversation&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Add another &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; input node to your canvas, followed by a &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node, a &lt;em&gt;&lt;code&gt;conversation&lt;/code&gt;&lt;/em&gt; node and a &lt;em&gt;&lt;code&gt;return NCCO&lt;/code&gt;&lt;/em&gt; output node.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;voice webhook&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;In the &lt;em&gt;&lt;code&gt;voice webhook&lt;/code&gt;&lt;/em&gt; node properties, select &lt;code&gt;POST&lt;/code&gt; as a method and type &lt;code&gt;/input&lt;/code&gt; in the answer URL field.&lt;/p&gt;

&lt;p&gt;If you were to connect a &lt;code&gt;debug&lt;/code&gt; node after it, after finishing and running the flow, you would see the parameters returned to the &lt;code&gt;/input&lt;/code&gt; URL:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;uuid&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The unique ID of the Call leg for the user initiating the input.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;conversation_uuid&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The unique ID for this conversation.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;timed_out&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Returns true if this input timed out based on the value of &lt;code&gt;Time Out&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dtmf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The numbers input by your caller, in order.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In our use case, we are trying to get the &lt;code&gt;dtmf&lt;/code&gt; value, as this is the meeting ID provided by the caller.&lt;/p&gt;

&lt;p&gt;Having a closer look at the debug sidebar on completions, we can see that it’s going to be in the &lt;code&gt;dtmf&lt;/code&gt; property of the &lt;code&gt;call&lt;/code&gt; object nested inside the &lt;code&gt;msg&lt;/code&gt; object, so we can reference it as &lt;code&gt;{{msg.call.dtmf}}&lt;/code&gt; in the other nodes of this path.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fdtmf-debug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fdtmf-debug.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;talk&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;Next, open up the &lt;em&gt;&lt;code&gt;talk&lt;/code&gt;&lt;/em&gt; node editor and set the &lt;code&gt;Text{}&lt;/code&gt; field to the message you’d like to be read out once the caller inputs the meeting ID.&lt;/p&gt;

&lt;p&gt;Note the &lt;code&gt;{}&lt;/code&gt; sign next to the &lt;code&gt;Text&lt;/code&gt; label, showing that this value can be set dynamically, using &lt;a href="https://mustache.github.io/" rel="noopener noreferrer"&gt;Mustache templating&lt;/a&gt;, so you could go with something like &lt;code&gt;Joining meeting {{msg.call.dtmf}}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Feel free to further personalize the experience by selecting a &lt;a href="https://developer.nexmo.com/voice/voice-api/guides/text-to-speech#voice-names" rel="noopener noreferrer"&gt;&lt;code&gt;Voice Name&lt;/code&gt;&lt;/a&gt; or by making use of &lt;a href="https://developer.nexmo.com/voice/voice-api/guides/customizing-tts" rel="noopener noreferrer"&gt;SSML tags&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;conversation&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;We’re using the &lt;em&gt;&lt;code&gt;conversation&lt;/code&gt;&lt;/em&gt; action to create a standard conference, so the only parameter we have to set is &lt;code&gt;Name {}&lt;/code&gt;. Using the conversation action with the same name reuses the same persisted Conversation, so it’s handy to name it after the meeting ID, referencing &lt;code&gt;{{msg.call.dtmf}}&lt;/code&gt; The first person to call the virtual number assigned to the conversation creates it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fconference-conversation-node.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fconference-conversation-node.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the future, you might want to take this a step further and create a moderated Conversation with selective audio controls. Check out the &lt;a href="https://developer.nexmo.com/voice/voice-api/ncco-reference#conversation" rel="noopener noreferrer"&gt;NCCO reference&lt;/a&gt; to find out more.&lt;/p&gt;

&lt;p&gt;Once you’re done with this path, it should look similar to this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fconference-input-url.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fconference-input-url.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a Nexmo Voice Application
&lt;/h2&gt;

&lt;p&gt;Some of Nexmo’s APIs, including the Voice API, use Nexmo Applications to hold security and config information needed to connect to Nexmo endpoints.&lt;/p&gt;

&lt;p&gt;In the Nexmo Node-RED palette, several nodes have the capability to create these applications: &lt;em&gt;&lt;code&gt;getrecording&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;earmuff&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;mute&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;hangup&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;transfer&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;createcall&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;playaudio&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;playtts&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;playdtmf&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Drag any of these nodes into your workspace, then double-click on it to open up the node properties.&lt;/p&gt;

&lt;p&gt;Next to the &lt;code&gt;Nexmo Credentials&lt;/code&gt;, select “Add new nexmovoiceapp…” from the drop-down menu and click the edit button. Fill in the details below and click &lt;code&gt;Create New Application&lt;/code&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;KEY&lt;/th&gt;
&lt;th&gt;DESCRIPTION&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Choose a name for your Voice Application, for example &lt;code&gt;Conference Call&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API Key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your Nexmo API key, shown in your &lt;a href="https://dashboard.nexmo.com/getting-started-guide" rel="noopener noreferrer"&gt;account overview&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API Secret&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your Nexmo API secret, shown in your &lt;a href="https://dashboard.nexmo.com/getting-started-guide" rel="noopener noreferrer"&gt;account overview&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Answer URL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;YOUR_URL/answer, you’ll be hosting a Nexmo Call Control Object (NCCO) here. – more about this later on.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Event URL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;YOUR_URL/event, you’ll need to reference this when setting up the event handler.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Node-RED will then create a new Nexmo Application on your account and fill in the App ID and Private Key fields for you to save. After this step, feel free to delete the Nexmo node you used, as a &lt;code&gt;nexmovoiceapp&lt;/code&gt; config node has been created, and that contains all the Nexmo credentials this flow needs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fconference-create-voiceapp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fconference-create-voiceapp.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Set Up a Number to Call
&lt;/h2&gt;

&lt;p&gt;Next, you’ll have to link your virtual number to this application.&lt;/p&gt;

&lt;p&gt;Find the Voice Application you’ve just created in your Nexmo Dashboard by navigating to &lt;em&gt;Voice&lt;/em&gt; &amp;gt; &lt;em&gt;&lt;a href="https://dashboard.nexmo.com/voice/your-applications" rel="noopener noreferrer"&gt;Your Applications&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Click on the name of this application, then under the &lt;em&gt;Numbers&lt;/em&gt; tab click on the &lt;strong&gt;Link&lt;/strong&gt; button next to the virtual number you’ve rented earlier.&lt;/p&gt;

&lt;p&gt;In case the number you’d like to use is already linked to another app, click on &lt;strong&gt;Manage number&lt;/strong&gt; and configure it to forward incoming calls to your app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fcongerence-link-number.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fcongerence-link-number.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Bonus tip:&lt;/em&gt; Use a &lt;em&gt;&lt;code&gt;comment&lt;/code&gt;&lt;/em&gt; node to take note of the Nexmo number linked to your application, this way you always have it handy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handle Your Call Events
&lt;/h2&gt;

&lt;p&gt;If you’d like to receive events about the progress of your call, you can also set up an event webhook.&lt;/p&gt;

&lt;p&gt;Connect an &lt;code&gt;http&lt;/code&gt; input node to an &lt;code&gt;http response&lt;/code&gt; node, as well as to a &lt;code&gt;debug&lt;/code&gt; node, so that you can view your call events in the debug area.&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;http&lt;/code&gt; input node, select &lt;code&gt;POST&lt;/code&gt; as a &lt;code&gt;Method&lt;/code&gt; and fill in the &lt;code&gt;URL&lt;/code&gt; field with &lt;code&gt;/event&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;http response&lt;/code&gt; node should have &lt;code&gt;200&lt;/code&gt; set as &lt;code&gt;Status code&lt;/code&gt;, but don’t worry about it; this is the default value as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fconference-final-flow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fconference-final-flow.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it Out!
&lt;/h2&gt;

&lt;p&gt;And that’s a wrap! Get a friend or more and take it for a spin! Don’t forget to take a peek in the debug area to follow your call events. Enjoy!&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Next?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Resources:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/ncco-reference#conversation" rel="noopener noreferrer"&gt;Conversation NCCO Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/ncco-reference#input" rel="noopener noreferrer"&gt;Input NCCO Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nexmo/getting-started-with-ngrok-in-node-red-4cn7"&gt;Get Started with ngrok in Node-RED&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nexmo.com/voice/voice-api/overview" rel="noopener noreferrer"&gt;Voice API Reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>node</category>
      <category>nodered</category>
      <category>javascript</category>
      <category>voice</category>
    </item>
    <item>
      <title>Verify Phone Numbers with Node-RED</title>
      <dc:creator>Julia Biro</dc:creator>
      <pubDate>Wed, 25 Sep 2019 08:00:13 +0000</pubDate>
      <link>https://forem.com/vonagedev/verify-phone-numbers-with-node-red-39b5</link>
      <guid>https://forem.com/vonagedev/verify-phone-numbers-with-node-red-39b5</guid>
      <description>&lt;p&gt;In &lt;a href="https://www.nexmo.com/blog/tag/node-red" rel="noopener noreferrer"&gt;previous tutorials&lt;/a&gt; you’ve learnt about the Nexmo SMS and Voice APIs, you’ve gotten comfortable with sending and receiving messages and calls, and hopefully, you’ve also had a chance to experiment and play around with customizing these experiences in Node-RED.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Interested in learning more about Node-RED? We’ve got a whole session dedicated to it at Vonage Campus, our first customer and developer conference taking place in San Francisco on October 29-30. It’s free to attend, so &lt;a href="https://web.cvent.com/event/9bba9ffb-c9b5-4022-a9b8-3a8184c70aa8/register" rel="noopener noreferrer"&gt;request your invite now&lt;/a&gt;!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this tutorial, we’ll look at the &lt;a href="https://developer.nexmo.com/verify/overview" rel="noopener noreferrer"&gt;Verify API&lt;/a&gt; and explore a handy way of validating your users’ phone numbers.&lt;/p&gt;

&lt;p&gt;Many apps on-board users with not much more than a phone number in order to keep the process as simple as possible, and they need to use that identifier for authentication later on.&lt;/p&gt;

&lt;p&gt;So let’s take a look at how we can do that, as well as ensure that there are no duplicate accounts and that the users are indeed reachable on the phone numbers provided by them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before getting started, you’ll need a few things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; and &lt;a href="https://nodered.org/docs/getting-started/installation" rel="noopener noreferrer"&gt;Node-RED&lt;/a&gt; installed on your machine&lt;/li&gt;
&lt;li&gt;A Nexmo account – &lt;a href="https://dashboard.nexmo.com/sign-up?utm_source=DEV_REL&amp;amp;utm_medium=nexmoblog&amp;amp;utm_campaign=verify-nodered" rel="noopener noreferrer"&gt;create one for free&lt;/a&gt; if you haven’t already&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting Your Credentials
&lt;/h3&gt;

&lt;p&gt;In order to interact with the Verify API, you’ll need to make note of a couple of things. Once you’ve created a Nexmo account, go to the &lt;a href="https://dashboard.nexmo.com" rel="noopener noreferrer"&gt;dashboard&lt;/a&gt; to find your API key and secret. You’ll be using these credentials later on to authenticate with the API.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up Your Node-RED Editor
&lt;/h3&gt;

&lt;p&gt;First, you’ll need to &lt;a href="https://nodered.org/docs/getting-started/installation" rel="noopener noreferrer"&gt;install&lt;/a&gt; the runtime and editor. This could be done either on your local machine, on a Single Board Computer (eg Raspberry Pi), or a number of cloud-hosted options.&lt;/p&gt;

&lt;p&gt;This example will be using your local machine, so once you’ve installed Node-RED globally, type the command below in your terminal to get started.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ node-red
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can then access the Node-RED editor by pointing your browser at &lt;a href="http://localhost:1880" rel="noopener noreferrer"&gt;http://localhost:1880&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you have your editor open, you’ll need to install the Nexmo nodes. You can do this under the &lt;em&gt;Manage palette&lt;/em&gt; menu, by searching for the &lt;code&gt;node-red-contrib-nexmo&lt;/code&gt; package and clicking install.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Finstall-nexmo-nodered.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Finstall-nexmo-nodered.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, repeat the previous step for the &lt;code&gt;node-red-dashboard&lt;/code&gt; package as well.&lt;/p&gt;

&lt;p&gt;After restarting Node-RED, you should now see all of the Nexmo and Dashboard nodes appear on the left side of your screen, among the other default nodes in the node palette.&lt;/p&gt;

&lt;h2&gt;
  
  
  User Interface
&lt;/h2&gt;

&lt;p&gt;For this tutorial you’ll need a simple user interface to collect user input. There are a couple of ways you could go about this, including writing your own HTML and CSS, but a much quicker alternative is using the Node-RED dashboard nodes.&lt;/p&gt;

&lt;h4&gt;
  
  
  What you’ll need:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;A text field collecting the user’s &lt;strong&gt;phone number&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A text field collecting the &lt;strong&gt;PIN code&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;Cancel Verification&lt;/strong&gt; button&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;Call Me&lt;/strong&gt; button – this will give the user the option to request a phone call on top of an SMS, as a means of receiving the PIN code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Speed up the process by &lt;em&gt;Importing from Clipboard&lt;/em&gt; the snippet below, or experiment with the dashboard nodes for yourself.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[{ "id": "463e8e92.d82a78", "type": "tab", "label": "Verify Demo", "disabled": false, "info": "" }, { "id": "fb7955ef.0e5fd8", "type": "ui\_form", "z": "463e8e92.d82a78", "name": "", "label": "Verify your phone number:", "group": "91563061.fc448", "order": 1, "width": 0, "height": 0, "options": [ { "label": "eg. 447401234567", "value": "number", "type": "text", "required": true }], "formValue": { "number": "" }, "payload": "", "submit": "Send me a code", "cancel": "delete", "topic": "", "x": 430, "y": 140, "wires": [[] ] }, { "id": "b60bf0b2.9a839", "type": "ui\_button", "z": "463e8e92.d82a78", "name": "", "group": "91563061.fc448", "order": 2, "width": "0", "height": "0", "passthru": false, "label": "Call me", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "", "payloadType": "str", "topic": "", "x": 520, "y": 580, "wires": [[] ] }, { "id": "b182a10d.c8f08", "type": "ui\_button", "z": "463e8e92.d82a78", "name": "", "group": "91563061.fc448", "order": 3, "width": 0, "height": 0, "passthru": false, "label": "Cancel Verification", "tooltip": "", "color": "", "bgcolor": "red", "icon": "", "payload": "", "payloadType": "str", "topic": "", "x": 550, "y": 760, "wires": [[] ] }, { "id": "a2251664.3ba2f", "type": "comment", "z": "463e8e92.d82a78", "name": "Start Verification - Collect phone number to be verified", "info": "", "x": 520, "y": 80, "wires": [] }, { "id": "7185f18d.87142", "type": "comment", "z": "463e8e92.d82a78", "name": "Check if received code matches the generated one", "info": "", "x": 510, "y": 280, "wires": [] }, { "id": "7f30e.60359cf28", "type": "comment", "z": "463e8e92.d82a78", "name": "Next Verification - Escalate to TTS Call", "info": "", "x": 610, "y": 520, "wires": [] }, { "id": "c46fa301.4eb0d8", "type": "comment", "z": "463e8e92.d82a78", "name": "Cancel Verification", "info": "", "x": 550, "y": 700, "wires": [] }, { "id": "ab7fb094.d7d1f8", "type": "ui\_form", "z": "463e8e92.d82a78", "name": "", "label": "Check code:", "group": "91563061.fc448", "order": 4, "width": 0, "height": 0, "options": [{ "label": "Enter the PIN code you received", "value": "code", "type": "text", "required": true }], "formValue": { "code": "" }, "payload": "", "submit": "submit", "cancel": "delete", "topic": "", "x": 390, "y": 340, "wires": [[] ] }, { "id": "91563061.fc448", "type": "ui\_group", "z": "", "name": "Verify Demo Input Fields", "tab": "fdce8e2a.f4364", "disp": false, "width": "8", "collapse": false }, { "id": "fdce8e2a.f4364", "type": "ui\_tab", "z": "", "name": "Verify Demo", "icon": "dashboard", "disabled": false, "hidden": false }]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you’re ready, your editor should look similar to this:&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-ui-template.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-ui-template.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To see your UI, navigate to &lt;code&gt;http://127.0.0.1:1880/ui&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-ui.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-ui.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Verifying your user
&lt;/h2&gt;

&lt;p&gt;Once we’ve collected a user’s phone number, we can start the verification process by sending a verify request to the Verify API.&lt;/p&gt;

&lt;h3&gt;
  
  
  Start Verification
&lt;/h3&gt;

&lt;p&gt;To start a verification, you’ll need a &lt;strong&gt;&lt;code&gt;sendverify&lt;/code&gt;&lt;/strong&gt; node wired to the form capturing the user’s phone number. By default, this will send a short custom text and a PIN code in an SMS message to the user’s phone number, followed by two text-to-speech phone calls in case they fail to submit the received code.&lt;/p&gt;

&lt;p&gt;Open up the &lt;strong&gt;&lt;code&gt;sendverify&lt;/code&gt;&lt;/strong&gt; node properties by double-clicking on it. There you’ll find the three required fields that you’ll need to fill in: &lt;code&gt;Nexmo Credentials&lt;/code&gt;, &lt;code&gt;To {}&lt;/code&gt; and &lt;code&gt;Brand {}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Note the &lt;code&gt;{}&lt;/code&gt; next to the labels, which means that those fields will support &lt;a href="https://mustache.github.io/" rel="noopener noreferrer"&gt;Mustache Templating&lt;/a&gt; and you will be able to pass in values dynamically.&lt;/p&gt;

&lt;p&gt;From the &lt;code&gt;Nexmo Credentials&lt;/code&gt; drop-down select &lt;em&gt;Add new nexmobasic&lt;/em&gt; and click the edit button. You will then be prompted to provide your &lt;code&gt;API Key&lt;/code&gt; and &lt;code&gt;API Secret&lt;/code&gt; to authenticate with the Verify API – both of these can be found in your &lt;a href="https://dashboard.nexmo.com" rel="noopener noreferrer"&gt;Nexmo Dashboard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you’re done, click &lt;strong&gt;add&lt;/strong&gt;. Now next to the &lt;code&gt;Nexmo Credentials&lt;/code&gt; label you’ll see a &lt;a href="https://nodered.org/docs/user-guide/editor/sidebar/config" rel="noopener noreferrer"&gt;config node&lt;/a&gt;, this will be storing your credentials going forward.&lt;/p&gt;

&lt;p&gt;Next, you’ll have to pass your user’s phone number into the &lt;code&gt;To {}&lt;/code&gt; field. If you imported the UI snippet above, this will be &lt;code&gt;{{msg.payload.number}}&lt;/code&gt;, since we specified in the first &lt;strong&gt;&lt;code&gt;form&lt;/code&gt;&lt;/strong&gt; node that the input value is to be collected in the &lt;code&gt;number&lt;/code&gt; key of &lt;code&gt;msg.payload&lt;/code&gt;. You can change this by opening up the &lt;strong&gt;&lt;code&gt;form&lt;/code&gt;&lt;/strong&gt; node properties and choosing a different &lt;code&gt;Name&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Finally, you can personalize the verification request SMS body under &lt;code&gt;Brand {}&lt;/code&gt; to help users identify your company or application name. It takes an 18-character alphanumeric string that will be prepended to the PIN number generated by the Verify API.&lt;/p&gt;

&lt;p&gt;For example: “Your Acme Inc PIN is …”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-sendverify-config.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-sendverify-config.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;&lt;code&gt;sendverify&lt;/code&gt;&lt;/strong&gt; node outputs the API response received from Nexmo, containing a &lt;code&gt;request_id&lt;/code&gt; and a &lt;code&gt;status&lt;/code&gt; parameter. Find out more about the status codes in the &lt;a href="https://developer.nexmo.com/api/verify#verify-request" rel="noopener noreferrer"&gt;Verify API Reference&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;request_id&lt;/code&gt; will be used for all following steps, so we have to make it accessible by all other nodes in the current flow. To do this, connect a &lt;strong&gt;&lt;code&gt;change&lt;/code&gt;&lt;/strong&gt; node to &lt;strong&gt;&lt;code&gt;sendverify&lt;/code&gt;&lt;/strong&gt; , open up its node properties and set &lt;code&gt;flow.request_id&lt;/code&gt; to &lt;code&gt;msg.payload.request_id&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-set-requestid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-set-requestid.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To have a bit more insight into what’s happening, you can also wire a &lt;strong&gt;&lt;code&gt;debug&lt;/code&gt;&lt;/strong&gt; node into &lt;strong&gt;&lt;code&gt;sendverify&lt;/code&gt;&lt;/strong&gt;. This way you can follow the API response in the debug sidebar.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check PIN Code
&lt;/h3&gt;

&lt;p&gt;The request has successfully been accepted by Nexmo, your user has received a verification code and has already submitted it through the corresponding form. Success? Almost.&lt;/p&gt;

&lt;p&gt;Now we have to figure out if the submitted code is indeed the one generated and sent by the Verify API.&lt;/p&gt;

&lt;p&gt;For this step we’ll need the &lt;strong&gt;&lt;code&gt;checkverify&lt;/code&gt;&lt;/strong&gt; node, which will take as input the &lt;em&gt;Request ID&lt;/em&gt; and the &lt;em&gt;Code&lt;/em&gt; supplied by the user, compare the two, then output the API response into &lt;code&gt;msg.payload&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After dragging it into your workspace, wire it to the form capturing the PIN code submitted by the user, then connect a &lt;strong&gt;&lt;code&gt;debug&lt;/code&gt;&lt;/strong&gt; node after it to see the response object in the debug sidebar.&lt;/p&gt;

&lt;p&gt;Open up the &lt;strong&gt;&lt;code&gt;checkverify&lt;/code&gt;&lt;/strong&gt; node properties. From the &lt;code&gt;Nexmo Credentials&lt;/code&gt; drop-down select the config node created by &lt;strong&gt;&lt;code&gt;sendverify&lt;/code&gt;&lt;/strong&gt; , fill in the &lt;code&gt;Request ID {}&lt;/code&gt; field with &lt;code&gt;{{flow.request_id}}&lt;/code&gt; and pass the code submitted by your user into the &lt;code&gt;Code {}&lt;/code&gt; field.&lt;/p&gt;

&lt;p&gt;If you imported the UI snippet above, this will be &lt;code&gt;{{msg.payload.code}}&lt;/code&gt;, since we specified in the second &lt;strong&gt;&lt;code&gt;form&lt;/code&gt;&lt;/strong&gt; node that the input value is to be collected in the &lt;code&gt;code&lt;/code&gt; key of &lt;code&gt;msg.payload&lt;/code&gt;. You can change this by opening up the &lt;strong&gt;&lt;code&gt;form&lt;/code&gt;&lt;/strong&gt; node properties and picking a different &lt;code&gt;Name&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-checkverify.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-checkverify.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congrats! &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flihei0ialdr82ned95ly.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flihei0ialdr82ned95ly.png" alt="🎉" width="72" height="72"&gt;&lt;/a&gt; Your Verify flow is up and running, go to &lt;code&gt;http://localhost:1880/ui&lt;/code&gt; and give it a try!&lt;/p&gt;

&lt;p&gt;After submitting the received PIN code, go back to your Node-RED Editor and have a closer look at the debug sidebar.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-send-check-debug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-send-check-debug.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The response object will contain details about your request including &lt;code&gt;status&lt;/code&gt;, which indicates whether it has been successful or not. If the PIN submitted by the user matches the one generated by the Verify API, &lt;code&gt;status&lt;/code&gt; will have a value of &lt;code&gt;"0"&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Check Verification Status
&lt;/h4&gt;

&lt;p&gt;Although the user’s phone number has been successfully validated, there is no sign of this event besides the debug sidebar at this moment.&lt;/p&gt;

&lt;p&gt;To define what is to happen after the verification process has ended, we can use the &lt;code&gt;status&lt;/code&gt; property of &lt;code&gt;msg.payload&lt;/code&gt; to separate the different scenarios.&lt;/p&gt;

&lt;p&gt;You might want to grant access to this user to a certain webpage or application, save the successfully verified user’s details into a database, or let them know what the result was and prompt them to try again in case it had failed. It really all depends on your use case and why you are trying to verify your users in the first place.&lt;/p&gt;

&lt;p&gt;To keep things simple, we are going to evaluate the &lt;code&gt;status&lt;/code&gt; property, then based on its value let the user know whether the verification has been successful or not. If you’d like to be more precise with your error messages, feel free to add more routes for other &lt;a href="https://developer.nexmo.com/api/verify#verifyCheck" rel="noopener noreferrer"&gt;status codes&lt;/a&gt; as well.&lt;/p&gt;

&lt;p&gt;To do this, we’ll need:&lt;br&gt;&lt;br&gt;
– a &lt;strong&gt;&lt;code&gt;switch&lt;/code&gt;&lt;/strong&gt; node to check the value of &lt;code&gt;msg.payload.status&lt;/code&gt;&lt;br&gt;&lt;br&gt;
– a &lt;strong&gt;&lt;code&gt;notification&lt;/code&gt;&lt;/strong&gt; dashboard node to inform the user&lt;br&gt;&lt;br&gt;
– two &lt;strong&gt;&lt;code&gt;change&lt;/code&gt;&lt;/strong&gt; nodes to prepare the message the &lt;strong&gt;&lt;code&gt;notification&lt;/code&gt;&lt;/strong&gt; node is going to display – one in case of success and one in case of a failed attempt.&lt;/p&gt;

&lt;p&gt;Add these nodes into your workspace and connect them as seen in the picture below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-checkverify-switch.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-checkverify-switch.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let’s have a closer look at each of these nodes:&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;switch&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;The &lt;strong&gt;&lt;code&gt;switch&lt;/code&gt;&lt;/strong&gt; node routes messages based on their property values or sequence position. In this case, we’re looking to create two routes based on the value of &lt;code&gt;msg.payload.status.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;When a message arrives, the node will evaluate each of the rules defined in its node properties, and forward the message to the corresponding outputs of any matching rules.&lt;/p&gt;

&lt;p&gt;First, double-click on the &lt;strong&gt;&lt;code&gt;switch&lt;/code&gt;&lt;/strong&gt; node to access its properties. In the &lt;code&gt;Property&lt;/code&gt; field replace “payload” with “status”, so that it’s &lt;code&gt;msg.payload.status&lt;/code&gt; that gets evaluated.&lt;/p&gt;

&lt;p&gt;Next, we have to define rules based on its value.&lt;br&gt;&lt;br&gt;
Click on the &lt;strong&gt;add&lt;/strong&gt; button to add a second rule, as we will be needing two:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;success: in the first rule, select “==” from the first drop-down and write a “0” in the text field next to it;
&lt;/li&gt;
&lt;li&gt;failure: in the second rule, select “!=” from the first drop-down and write a “0” in the text field next to it. This will cover all cases when the verification is not a success.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-switch-config.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-switch-config.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note how the rules have a &lt;code&gt;-&amp;gt; 1&lt;/code&gt; and a &lt;code&gt;-&amp;gt; 2&lt;/code&gt; sign next to them. This indicates that if the first statement is true, nodes connected to the first output will be triggered. In all other cases, the ones wired into the second output will be set off.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;notification&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;The &lt;strong&gt;&lt;code&gt;notification&lt;/code&gt;&lt;/strong&gt; node shows &lt;code&gt;msg.payload&lt;/code&gt; as a pop-up notification or an &lt;em&gt;OK/Cancel&lt;/em&gt; dialog message on the user interface. You can choose the type of notification from the &lt;code&gt;Layout&lt;/code&gt; drop-down in the node properties, and in case of a pop-up, you can also configure its position.&lt;/p&gt;

&lt;p&gt;Set the duration in the &lt;code&gt;Timeout (S)&lt;/code&gt; field by entering the number of seconds you wish to keep it visible on the UI.&lt;/p&gt;

&lt;p&gt;If you’d like to set a title, you can do so in the &lt;code&gt;Topic&lt;/code&gt; field, or in case a &lt;code&gt;msg.topic&lt;/code&gt; is available it will be used as the title.&lt;/p&gt;

&lt;p&gt;It’s possible to further customize the experience by defining a border colour, either in the &lt;code&gt;Border&lt;/code&gt; field or by passing it in dynamically in &lt;code&gt;msg.highlight&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-checkverify-notification.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-checkverify-notification.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;change&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;In the &lt;strong&gt;&lt;code&gt;change&lt;/code&gt;&lt;/strong&gt; nodes we’ll be using the &lt;code&gt;Set&lt;/code&gt; operation to specify the values of &lt;code&gt;msg.payload&lt;/code&gt; and &lt;code&gt;msg.highlight&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let’s open up the node properties of the first &lt;strong&gt;&lt;code&gt;change&lt;/code&gt;&lt;/strong&gt; node (make sure it’s wired into the first output of the &lt;strong&gt;&lt;code&gt;switch&lt;/code&gt;&lt;/strong&gt; node, our success scenario). Set &lt;code&gt;msg.payload&lt;/code&gt; to a success message like “Successful verification!”, click the &lt;strong&gt;add&lt;/strong&gt; button to define a second rule, and set &lt;code&gt;msg.highlight&lt;/code&gt; to “green”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-success-change.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-success-change.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Repeat the same steps for the second &lt;strong&gt;&lt;code&gt;change&lt;/code&gt;&lt;/strong&gt; node, but this time give &lt;code&gt;msg.payload&lt;/code&gt; “Verification failed!” as value and set &lt;code&gt;msg.highlight&lt;/code&gt; to “red”. Also, make sure it’s connected into the second output of the &lt;strong&gt;&lt;code&gt;switch&lt;/code&gt;&lt;/strong&gt; node.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-fail-change.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-fail-change.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hit &lt;strong&gt;Deploy&lt;/strong&gt; and give it another try! Now, when the verification process completes, you’ll see a pop-up appear with the result!&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Verification
&lt;/h3&gt;

&lt;p&gt;Once the verification process has started, Nexmo will make three attempts at delivering the PIN code to the submitted phone number: an SMS message and two text-to-speech(TTS) phone calls.&lt;/p&gt;

&lt;p&gt;There are times when a phone call is the better option, be it for accessibility reasons or out of pure personal preference. It’s always a nice touch to give our users the option to choose an alternative delivery method, so let’s have a look at implementing a button that would escalate the verification process to a TTS call instantly.&lt;/p&gt;

&lt;p&gt;In the provided flow template, find the &lt;strong&gt;Call Me&lt;/strong&gt; button and connect a &lt;strong&gt;&lt;code&gt;nextverify&lt;/code&gt;&lt;/strong&gt; node into it. Open up the &lt;strong&gt;&lt;code&gt;nextverify&lt;/code&gt;&lt;/strong&gt; node properties, select your &lt;code&gt;Nexmo Credentials&lt;/code&gt; from the drop-down menu and fill in the &lt;code&gt;Request ID {}&lt;/code&gt; field with &lt;code&gt;{{flow.request_id}}&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
You might want to also consider adding a &lt;strong&gt;&lt;code&gt;debug&lt;/code&gt;&lt;/strong&gt; node for a bit more insight on your end, and a &lt;strong&gt;&lt;code&gt;change&lt;/code&gt;&lt;/strong&gt; node followed by a &lt;strong&gt;&lt;code&gt;notification&lt;/code&gt;&lt;/strong&gt; node to let the user know what’s going on – just like you did at the previous step, but it’s completely optional.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-nextverify.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-nextverify.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Cancel Verification
&lt;/h3&gt;

&lt;p&gt;In an ideal world we would stop here, but something always comes up, doesn’t it? You’ve made a mistake while filling in a form and hit submit – too late to change your mind and hit that &lt;strong&gt;Delete&lt;/strong&gt; now, the verification has already started.&lt;/p&gt;

&lt;p&gt;You might think you could just wait it out and try again once it’s failed. Yes, that works as well, but it’s not an ideal way to go about it. Besides giving a frustrating experince to your users, think about the poor unsuspecting soul that ends up getting two phone calls in addition to that initial verification message – at 2am. Oops.&lt;/p&gt;

&lt;p&gt;Fortunately, there’s a quick and easy way of implementing a &lt;strong&gt;Cancel Verification&lt;/strong&gt; button.&lt;/p&gt;

&lt;p&gt;If you imported the provided UI snippet, all you need to do is connect a &lt;strong&gt;&lt;code&gt;cancelverify&lt;/code&gt;&lt;/strong&gt; node into the &lt;strong&gt;Cancel Verification&lt;/strong&gt; button’s output, open up the &lt;strong&gt;&lt;code&gt;cancelverify&lt;/code&gt;&lt;/strong&gt; node properties, select your &lt;code&gt;Nexmo Credentials&lt;/code&gt; from the drop-down menu and fill in the &lt;code&gt;Request ID {}&lt;/code&gt; field with &lt;code&gt;{{flow.request_id}}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You could also add a &lt;strong&gt;&lt;code&gt;debug&lt;/code&gt;&lt;/strong&gt; node to see the response object in the debug sidebar, and a &lt;strong&gt;&lt;code&gt;change&lt;/code&gt;&lt;/strong&gt; node followed by a &lt;strong&gt;&lt;code&gt;notification&lt;/code&gt;&lt;/strong&gt; node to let the user know it has successfully been cancelled.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-cancelverify.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-cancelverify.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now hit that &lt;strong&gt;Deploy&lt;/strong&gt; button and test it out! Keep in mind that for a cancel request to be valid, it has to be initiated at least 30 seconds after the phone number has been submitted. Still plenty of time to avoid that TTS call being initiated!&lt;/p&gt;

&lt;p&gt;Et voilà! With your safety guard in place, you can now sleep better at night – and so can all the unsuspecting strangers you’ll be verifying as well. Good job!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-flow.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-flow.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Extra Credit – Search Verification
&lt;/h3&gt;

&lt;p&gt;You can already follow the flow of the verification process in the debug sidebar, since every return object received from the Nexmo API is logged by a debug node, and it provides valuable insight into what’s happening.&lt;/p&gt;

&lt;p&gt;Sometimes the debug area can get a little crowded, making it hard to pinpoint the piece of information you’re looking for. Besides that, you might want to check on your verification in between events, not having to wait for the next one to occur in order for another return object to pup up. It might have already completed, but you’re not exactly sure whether it failed or completed successfully.&lt;/p&gt;

&lt;p&gt;The good news is, there’s a &lt;strong&gt;&lt;code&gt;searchverify&lt;/code&gt;&lt;/strong&gt; Nexmo node that takes care of all these concerns. Being triggered by, let’s say, an &lt;strong&gt;&lt;code&gt;inject&lt;/code&gt;&lt;/strong&gt; node, it will output all available information about a past or current verification request identified by a &lt;code&gt;request_id&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Add a &lt;strong&gt;&lt;code&gt;searchverify&lt;/code&gt;&lt;/strong&gt; node to your workspace, wire it between an &lt;strong&gt;&lt;code&gt;inject&lt;/code&gt;&lt;/strong&gt; and a &lt;strong&gt;&lt;code&gt;debug&lt;/code&gt;&lt;/strong&gt; node. In the &lt;strong&gt;&lt;code&gt;searchverify&lt;/code&gt;&lt;/strong&gt; node properties select your &lt;code&gt;Nexmo Credentials&lt;/code&gt; from the drop-rown menu and fill in the &lt;code&gt;Request ID {}&lt;/code&gt; field with &lt;code&gt;{{flow.request_id}}&lt;/code&gt; to get details about the current verification. You could also paste in a specific &lt;code&gt;request_id&lt;/code&gt; in this field, in case you wanted to check on a verification that took place before the current one.&lt;/p&gt;

&lt;p&gt;Now when you look at the debug sidebar, after taking your app for a spin, you’ll notice that every time you click on the &lt;strong&gt;&lt;code&gt;inject&lt;/code&gt;&lt;/strong&gt; node’s button in your editor it will return an object with all available details about the request in question. Have a closer look at the response fields and head over to the &lt;a href="https://developer.nexmo.com/api/verify#verifySearch" rel="noopener noreferrer"&gt;Nexmo API Reference&lt;/a&gt; to find out more about each of them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-searchverify.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nexmo.com%2Fwp-content%2Fuploads%2F2019%2F09%2Fverify-searchverify.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Where next?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Nexmo Verify &lt;a href="https://developer.nexmo.com/api/verify#verify-request" rel="noopener noreferrer"&gt;API Reference&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Verify &lt;a href="https://developer.nexmo.com/verify/overview" rel="noopener noreferrer"&gt;Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try another tutorial:&lt;br&gt;&lt;br&gt;
– &lt;a href="https://dev.to/nexmo/how-to-stream-audio-into-a-call-with-node-red-1c1m"&gt;How to Stream Audio into a Call with Node-RED&lt;/a&gt;&lt;br&gt;&lt;br&gt;
– &lt;a href="https://dev.to/nexmo/how-to-make-text-to-speech-phone-calls-with-node-red-2nfj"&gt;How to Make Text-to-Speech Phone Calls with Node-RED&lt;/a&gt;&lt;br&gt;&lt;br&gt;
– &lt;a href="https://dev.to/nexmo/how-to-receive-phone-calls-with-node-red-3ihc"&gt;How to Receive Phone Calls with Node-RED&lt;/a&gt;&lt;br&gt;&lt;br&gt;
– &lt;a href="https://www.nexmo.com/blog/2019/02/21/nexmo-node-red-package-dr/" rel="noopener noreferrer"&gt;Announcing the Nexmo Node-RED Package&lt;/a&gt;&lt;br&gt;&lt;br&gt;
– &lt;a href="https://dev.to/nexmo/how-to-send-sms-messages-with-node-red-2l2o"&gt;How to Send SMS Messages with Node-RED&lt;/a&gt;&lt;br&gt;&lt;br&gt;
– &lt;a href="https://dev.to/nexmo/how-to-receive-sms-messages-with-node-red-55ll"&gt;How to Receive SMS Messages with Node-RED&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>nodered</category>
      <category>nexmo</category>
    </item>
  </channel>
</rss>
