5 posts categorized "Tutorials"


Automating SMS via Drag-and-Drop

Subscription-simple2 Today, Telerivet is excited to make it dramatically easier for anyone to create your own automated SMS system. Without needing to hire a programmer or write a single line of code, you can easily create your interactive messaging service just by building an intuitive, visual flowchart.

Each action in your SMS service has a corresponding shape in the flowchart, and the logic flow simply follows the lines and arrows between the shapes. It's easy to add follow-up questions and handle responses to create an automated conversation.

As an example, let’s see how to create a registration flow to ask new subscribers to provide information about themselves. After they text the keyword JOIN, we’ll follow up by asking their name, then their email address.

Creating this SMS system with Telerivet only takes 2 minutes from start to finish.

In addition to triggering custom actions when an SMS is received, you can also trigger custom actions manually, for one or more messages or contacts. For example, you could message several contacts and wait for a response. Or, you could use custom actions to streamline your workflow and automate repetitive tasks like adding/removing contacts from groups, or updating contact information.

There are dozens of other improvements with this update, all with the goal of making it even simpler to create and manage automated SMS services. To explore the latest updates, visit the Services page in your Telerivet account.    


How to accept mobile money payments online without an API

In many developing countries, where most business transactions have historically been conducted with cash, mobile payment systems like M-Pesa have rapidly transformed the way goods and services are bought and sold.

Instead of carrying cash everywhere, you can now pay with your mobile phone – and unlike Google Wallet or Apple Pay, you don’t even need a smartphone. To complete a transaction, you simply use your phone’s keypad to enter the business’ phone number or ID, the amount of money to send, and your PIN.

When a transaction is completed, the mobile network sends a SMS receipt to both the sender (buyer) and recipient (seller). If you’re the seller, you can see the SMS receipt and know that you’ve been paid.

This payment flow works for in-person payments – but what about businesses that operate online? Developer APIs provided by services like Stripe and PayPal make it easy for online services to accept payments via credit cards and bank accounts, but not via mobile money systems. Some mobile money systems may offer their own APIs, while others don’t have developer APIs at all, or have APIs that are only available for large businesses.

If you want to accept mobile payments and there’s no API available, don’t give up – just scrape the SMS receipts! There are just three easy steps:

  1. Forward SMS receipts from your phone to your server
  2. Extract the relevant data from the SMS receipt
  3. Match the payment with the correct user and credit their account

At Telerivet, we’ve been using this method to accept payments from Tanzania via M-Pesa and Tigo Pesa for over a year already – allowing us to receive millions of shillings in revenue from customers who would have been unable to pay via credit cards or PayPal.

If you want to accept mobile money payments in your own online service, read on to learn how to do it:

1. Forward SMS receipts from your phone to your server

When anyone sends you a mobile money payment, the mobile network will send your phone a SMS receipt. Your online service needs this receipt to know that someone has paid you.

To forward SMS receipts from your phone to your server, you can use the Telerivet Android app together with the Telerivet Webhook API.

If you don’t have an Android phone already, get an Android phone and install the SIM card associated with your mobile money account. Then install the Telerivet Android app on your phone. Finally, configure the Webhook API to forward incoming SMS messages to a URL on your server.

Of course, this method requires your business to have a presence in the country where you’re accepting payments – it doesn’t help accept or transmit mobile payments internationally, since your business still needs to register for a mobile money account, and the funds stay in the mobile money account until you withdraw them.

2. Extract the relevant data from the SMS receipt

Each mobile money system uses a different format for their SMS receipts.

Here’s an anonymized example receipt (in Swahili) from Tigo Pesa in Tanzania:

Tigopesa: Salio jipya ni Tsh 67,676. Umepokea Tsh 16,000 kutoka kwa JOHN SMITH, 0730000000. 06/10/2014 11:59 AM, kumbukumbu no. PP141006.1159.B00001. Tigo Pesa inakulipa mteja wake faida kulingana na wastani wa salio lako la kila siku. Faida nyingine italipwa mwezi wa 10, 2014. Pata zaidi na Tigo Pesa TU.

It contains several pieces of data:

Current Balance: Tsh 67,676
Amount Received: Tsh 16,000
Payee Name: John Smith
Payee Phone Number: 0730000000
Transaction Time: 6 October 2014, 11:59 AM (East Africa Time)
Transaction ID: PP141006.1159.B00001

In order for your online service to process a user’s payment, the most important information is the amount received and the transaction ID.

Extracting this information will likely involve writing regular expressions to match the particular format of SMS receipts generated by the mobile money service. This can get a little tricky.

In the case of receiving funds via Tigo Pesa, we first make sure to only consider SMS messages from the sender ID “Tigopesa”.

(You may want to test if your mobile network allows other people to send spoofed SMS messages with the same the sender ID as their mobile money system. If so, you could prevent spoofed SMS receipts by keeping track of your current balance, and verifying that the balance in the SMS receipt is correct.)

To extract the amount received, we can use this regular expression:


Note: You may also want to take special care to avoid letting someone falsify their payment amount by changing their registered name to “Umepokea Tsh 1,000,000”.

To extract the transaction ID, we can use this regular expression:

kumbukumbu no\W+(\w{8}\.\d{4}\.\w{5,}\b)

While SMS receipt formats are typically relatively stable, mobile money systems sometimes change the format or wording of the receipts.

At this point, your service still doesn’t know which user account should be credited for the payment. (You might be able to figure it out from the payee name and phone number, but that’s unreliable.)

Instead, just store the transaction ID and payment amount in your database, so that it’s available in the next step.

3. Match the payment with the correct user and credit their account

Finally, you need to match the receipt with the correct user of your online service, so you can credit the correct account.

Some mobile money systems, including Tigo Pesa, have systems for businesses that allow customers to enter a reference number for their account when sending a bill payment. But this type of bill payment system is sometimes only available to large businesses. When someone sends money to your phone number, they probably won’t be able to send a reference number.

In this case, you can simply prompt the user to enter the transaction ID in your application, like in the example below:


The customer knows this transaction ID because the mobile money system sent the customer their own SMS receipt containing the same transaction ID:

Tigopesa: Salio jipya ni Tsh 118,006. Hamisho la fedha kwenda kwa EXAMPLE INC limekamilika; 0731110000; Kiasi Tsh.  16,000; Ada Tsh. 350;kumbukumbu no. PP141006.1159.B00001. Tigo Pesa inakulipa mteja wake faida kulingana na wastani wa salio lako la kila siku. Faida nyingine italipwa mwezi wa 10, 2014. Pata zaidi na Tigo Pesa TU.

When the customer enters a transaction ID in your application, your application can check your database for that transaction ID. If it matches, then credit the user with the payment amount associated with that transaction ID. (Be sure to prevent people from reusing the same transaction ID multiple times.)

If the customer enters a transaction ID that doesn’t match your database, it could be because you haven’t received the SMS receipt yet, or because the customer made a typo (often it can be hard to tell the difference between the digit zero and the letter O, or the letters I and L and the digit 1).

In this case, we suggest storing the transaction ID entered by the customer in your database and notifying someone on your team to look into the transaction. If there was a typo, you can record the payment manually; if the receipt was delayed, your system can process the payment manually whenever the receipt is received.


Scraping data from SMS receipts may not be the cleanest solution for accepting mobile money payments, but sometimes it’s the only solution.

Fortunately, at least one mobile money system soon plans to make this easier: Safaricom M-PESA in Kenya currently plans to open their developer API in April 2015 . But there’s no need to wait for someone else to release an API -- just start scraping SMS receipts and letting  your customers pay you today.


Message scheduling and data collection just got even better

You asked for it and we delivered!

At the request of several organizations conducting mHealth projects—including the Mobile Alliance for Maternal Action—we’re excited to unveil new tools that will make Telerivet even more useful for organizations conducting maternal or infant health campaigns, and for many other businesses and NGOs too.

Store important dates as contact information

Telerivet already supports storing custom contact information (e.g. text, numbers, yes/no fields, email addresses, and alternate phone numbers) and with this update, we’ve included dates as a new type of contact information that you can store.

Whether you need to keep track of expectant mothers’ due dates, customer birthdates, or borrowers’ repayment dates, you can now include important date information for contacts in Telerivet. When you store information in a date field, you’ll be able to sort contacts chronologically by date, and quickly input dates using a calendar.


We also made it easier to manage your custom contact information. On the Contacts page, click “More”, then click “Manage fields”. If you’ve already been storing dates as text, you can edit your Text field and change its type to Date.


Schedule messages relative to each contact

Now that you can store dates for each contact, Telerivet also now makes it super simple to schedule messages relative to those dates. For example:

  • Maternal health campaign managers can schedule a series of messages for a particular number of weeks before or after the expectant mother’s due date.

  • Business owners can easily wish their customers a happy birthday by storing their contacts' birthdates and scheduling a message on their birthday every year.

With "relative" scheduled messages, it’s no longer necessary to manually calculate the right time to send each message for each contact. Simply import your contact information and let Telerivet calculate the right time to send each message.

To schedule a relative message, go to the Messages page, click “New Message”, then “Schedule”, then click the “Relative” tab. Everything works the same way as scheduling a basic message to a group or set of contacts, but instead of specifying one date to send all messages, you select an interval relative to one of your Date fields. For example, “34 weeks before Due Date”, “on Due Date”, or “2 months after Due Date”:


When you save a relative message, Telerivet will automatically generate a scheduled message for each contact and will keep the schedule updated even if contact information changes or if new contacts are added or removed.

You can easily see when each message will be sent on the “Scheduled” tab of the Messages page (the auto-generated messages are shown in blue).

Register other contacts via the Rules Engine

Telerivet’s Rules Engine has always made it easy to build systems that let people update their own contact information. Now we’ve made it possible to build systems that let you update a contact different from the one who sent the message.

As shown in the example below, this feature lets community health workers use their own mobile phones to collect due dates from expectant mothers and send a structured SMS message containing the expectant mother’s phone number, due date, and name (eg. “065155555 6.2.14 Jane Smith”). With the simple automated service below, Telerivet will automatically update the contact information and schedule the expectant mother to receive personalized messages according to their due date:


You can customize Telerivet to interpret dates in your local format (such as m/d/yy or d.m.yy), and Telerivet can even interpret dates if the year is omitted.

If someone registers an invalid date, Telerivet will highlight it in red on your Contacts page, so you can correct any invalid data (or you could add additional rules to validate the date before saving it).

To use this feature, simply create a custom rule-based service and add a “Use another contact” action. With this action, you can extract the phone number of the contact from the content of the incoming SMS, such as [[word1]] (the first word of the SMS message). Then any other actions your automated service performs -- such as adding the contact to a group or setting contact information -- will be applied to the contact with that phone number, instead of the contact who actually sent the message.

See it in action!

Watch the video below for a step-by-step demonstration of how to use these new features to set up a maternal health campaign with Telerivet:


To try it out yourself, log in to your Telerivet account or register a new account.

As always, email us at support@telerivet.com if you run into any problems or if you have any suggestions for new features. And stay tuned for even more updates in a few weeks!


MAMA's global learning course

At Telerivet, we always enjoy sharing our technology with new audiences. So Jesse (our CTO) and I were thrilled to participate in the Mobile Alliance for Maternal Action global learning course last week and share a tutorial video we created to show how MAMA programs can create their mobile messaging campaign with Telerivet. Our cloud-based platform makes it easy to set up and deploy a wide variety of mobile messaging programs -- including maternal health campaigns, polling, community organizing, sending appointment reminders, and much more.

The video we presented last week focuses on the steps for creating a mobile messaging campaign within Telerivet. For maternal health campaigns, the easiest way is to use any spreadsheet program (like Excel) to quickly generate a schedule of messages to send according to each mother’s due date, then simply copy and paste those messages into Telerivet. To download an Excel template that you could adapt for your organization’s messaging campaign, click here.

View our tutorial video to see how it works:

Update 1/23/14: We just launched improved features for message scheduling, so the above method is no longer the easiest way to conduct maternal health campaigns. See blog post and updated tutorial video

We're rapidly improving and adding capabilities to Telerivet, and we’re always looking to our customers for suggestions on what we should build next -- so let us know if you have ideas about new features that could help your organization.

Thanks again to the Mobile Alliance for Maternal Action for including us in their global learning course and we hope to work with the MAMA community to support maternal health through mobile messaging!



You’ve got options: 2 ways to distribute polls

Need to distribute a poll so you can collect important through responses? Using our automated services templates you can create custom SMS polls and surveys, and anyone with a cell phone can respond. But what’s great is having two options to distribute these polls out to respondents. You can send the poll to a list of respondent phone numbers via SMS or publish the poll publicly through any method, such as television, radio, or print ads.

To send a poll via SMS, first create your poll and then go to the Services page and click Send poll via SMS.

My Poll

Then, enter the phone numbers you want to send the poll to. Want to make things even quicker? If you have a spreadsheet or other document containing phone numbers, you can copy and paste a column of phone numbers into the To field.

When sending a poll using Send poll via SMS, we will automatically add these phone numbers to a group with a name such as poll-sample. This group name can be customized by clicking Edit settings. To view the members of this sample group, click View poll sample.

To distribute a poll through other means, such as radio, television, or print all you need to do is create your poll in Telerivet and give your audience the first question and ask that they send their SMS response to your phone number. For example, a radio announcer can ask listeners a question over the air and have them text Yes or No to their designated phone number. If your poll only has a single question, this options allows you to conduct your poll without sending any outgoing SMS messages, which is usually free if using an Android phone to send and receive SMS messages. With this options make sure that you have selected Yes, allow anyone to submit this poll in your poll settings.

Now go out there and get those questions answered! 


Subscribe to feed