Ding! Your Machine Just Texted You – Powered by Peakboard + seven.io

Published in api

Ding! Your Machine Just Texted You – Powered by Peakboard + seven.io

March 01, 2023 3 mins read

Communicating with the outside world is one the most important tasks of almost any Peakboard application. In today’s article we take a look at the seven.io API, a business messaging gateway service that let’s B2B customers easily send and receive SMS. We will have a look at the API and build a small Peakboard application to send out the SMS to a given phone number. Beside the API seven.io also offers an Email-to-SMS service for those who dont want to use the API.

The seven.io portal

Creating an account in the seven.io portal is free of charge and come with a free plan for some indivual tests of the API without the need to pay any money. Within the portal we can manage the payment plans and also the configuration for those who need to build processing of incoming sms.

For our example we need to create an API key that covers at least the scope “SMS”.

image

The UI

For our sample we chosse a simple UI with two text fields and a button.

image

The API

The API documentation for seven.io services can be found here. The call we use in our example is epxlained here.

So the actual payload is submitted through query parameters of a HTPP GET call that follows this pattern:

https://gateway.seven.io/api/sms?to=#[to]#&from=#[from]#&text=#[text]#
  • “to” is the number destintion number
  • “from” is the sender number or just the sender’s name
  • “text” is the actual text message

Beside this we need to submit the API key in a header named “X-Api-Key”. In the Peakboard Building block we just use a text placeholder block to build the correct URL including the query parameters. That’s all.

image

Currently we’re not evaluating the response form the API but just writing it into the log. The API returns a code to that lets us precisely determine success or error reasons. The codes can be check here.

result

The screenshot shows the incoming SMS. As some kind of expansion to our very quick and easy example here are some thoughts for other cool stuff you can do with the seven.io portal.

  • Of course seven.io API works too in all Hub Flows. It might even more appropriate to process the seven.io through a central Hub Flow rather than a single Peakboard application
  • We can use seven.io to receive SMS and process them in a Peakboard application or a Hub Flow.
  • seven.io also supports sending out voice calls. Imagine a machine calling the supervisor and tell him details about his current error state. How cool is that? The voice message is as easy to build as sending an SMS.

image