Getting started
Getting StartedAPI BasicsAPIs
AuthenticationBlocklistsCall ChannelsCall CenterCall RecordingsDevicesPivotQuickcallWebhooksBusiness SMS
VirtualTextAutomation
ZapierUse cases
Create Trello Card for Voicemails Received Send Call Data to Google SheetsSlack Notifications from Call EventsSMS Airtable TemplateTrigger SMS Messages from Your CRMZapier Webinar RecordingA Quick Look at the Finished Product
Let’s start at the end and see what an SMS setup in Airtable could look like in your organization. The screenshot here shows you a lot about what the SMS tool does.
Showing Received Messages
At the top of the screen, you can see four tabs titled “Messages,” “Outbox,” “Sender,” and “Phone Numbers.” These are filters for specific information you can capture within your database. In our Airtable template in the “Messages” tab, we filter for the sender and receiver, their phone numbers, and the messages received from the sender.
You can also see a button here titled “Reply” that gives the ability to send an SMS message back to the sender. This is the entry point for recognizing an inbound text. We have multiple team members with permissions to access this Airtable setup, and you can do the same with chosen members of your marketing, sales, or customer service departments.
“Adding users and permissions would be available for customers to implement in their own systems,” Baker commented about group access. “What we have build so far is just a basic prototype, but in Airtable you can review the history of tasks, so we could build extra add-ins like a Confirmation dialogue that would keep text replies ordered.”
Filtering Message Types and System Users
The other tabs visible in this Airtable template are self-explanatory in their purpose.
- “Outbox” filters all the messages sent through Airtable to an individual’s phone
- “Sender” gives the ability for any user to send a direct message – not a reply – from Airtable by clicking a “Send SMS” button we built
- “Phone Numbers” tab shows all the messages that have been exchanged between two people
This is a proof of concept but is applicable to production scenarios and configurable to what customers need. You might wish to limit your tabs and message views to these tabs, or you might want to add additional tabs to gain even more fine-grained detail.
Baker noted that “a method of tracking messages through threads could be possible, and there could be additional checks in the system that validate or filter messages.”
“I would expect businesses to push this tool further by adding, for example, sending SMS notifications to team members through Airtable,” he continued. In this way, an Airtable template that manages SMS could be good both for handling customer interactions and for keeping team members informed through internal communication.
Buttons, and Leveraging the VirtualPBX API
The buttons shown and mentioned above are custom. Lon and the VirtualPBX team built them to perform specific functions inside of Airtable and to send data to the VirtualPBX API.
“This is pure JavaScript,” Baker said. “That is it. It’s very simple to use. Airtable has good documentation and a decent community.”
let replyData = {
'data': {
'from': fromValue[0],
'to': phoneNumber,
'body': reply
}
}
Airtable lets you create Apps within your account. You build them with custom scripts that are allowed access to the internal workings of your account and allowed to interface with third-party services. For example, we can build an SMS message with a few pieces of information.
Here, the
from
to
, and
body
are populated with strings we will send to VirtualPBX through the phone system’s API. We can customize the look of the reply screen to include or exclude information you need. Our prototype, however, does show the basic information of the SMS being created and gives users a place to insert the body of their message.
When it comes time to send a message, Airtable must speak to the VirtualPBX API and tell the API what information it wants to send. Shown below is the few lines of code it takes to complete that process:
await fetch('https://api.virtualpbx.net/v2/api_auth', requestOptions)
.then(response => response.text())
.then(result => JSON.parse(result))
.then(result => requestOptions.headers.append('X-Auth-Token', result.auth_token))
.catch(error => console.log('error', error));
requestOptions.body = JSON.stringify(replyData)
await fetch('https://api.virtualpbx.net/v2/accounts/{account-id}/sms', requestOptions)
.then(response => response.text())
.catch(error => console.log('error', error));
All that’s done here is reaching out to the VirtualPBX API endpoint for SMS, passing it the appropriate login information (the requestOptions variable), modifying the text message data into a JSON string, and sending that string through the VirtualPBX SMS endpoint, which delivers the message.
Capturing Messages with Zapier and VirtualPBX Webhooks
Still working backward here, you might be asking yourself: How do I receive text messages in the first place? This job is completed through a Zapier workflow and with Webhooks.
As a quick recap, when you use Webhooks, you create a trigger that waits for an action to take place in your VirtualPBX Plan. An SMS hook waits for an inbound text message; then the hook posts information about the message (sender, message body, timestamp, etc.) to a URL you can reference with another service.
Zapier can provide you with a URL to which you attach the hook you create in VirtualPBX. We do that exact task in our own Zapier account to send messages to the Airtable template discussed in this article.