How to Use a Local SMS Service Provider Other than Twilio With Customer.io
Tags: twilio, smsapi, javascript, customerio
Published: 2023-06-24 23:35:23

![](https://cdn-images-1.medium.com/max/1600/1*rs_Nxid4ptotRXa6dtCmig.png align="left")

If you’re running a Business in Africa, you know that every cent counts.

While I love [Twilio](http://twilio.com), and I’m always impressed by their delivery rates, the truth is that at [$0.1982](https://www.twilio.com/sms/pricing/ng) per SMS, it’s expensive to use for early-stage startups whose revenues aren’t based in USD.

I’m a big fan of [customer.io](http://customer.io) and the power it packs and as such it’s something we use a lot at [Moni](https://moni.africa) for automating our Marketing campaigns and running in-app and push notifications. I still think that African Startups pay too much for tools — especially startups whose revenues aren’t based in USD, but this is a topic for another day.

[Customer.io](http://Customer.io) has a direct integration with Twilio and it’s easy to set up that integration. If that’s something you’re interested in, follow the [customer.io](http://customer.io) docs [here](https://customer.io/docs/twilio/).

In this tutorial, we’ll be using a local Nigerian SMS Service provider [Sleengshort](https://sleengshort.com/) to send SMS’ to users on our platform. You can follow along with this tutorial without a Sleengshort account. Simply make sure that you have the following;

1. A registered sender ID with your SMS provider
    
2. An API Gateway you can connect to, to trigger the SMS
    
3. A [customer.io](http://customer.io) account and basic knowledge of [customer.io](http://customer.io)
    

Let’s get into it.

First, log in to your Sleengshort account to get your Sender ID and API Keys. You can find both from your Sleengshort Dashboard by going to Settings &gt; Sender ID and Settings &gt; API Keys.

In the Settings &gt; API Keys section, create a new API Key by clicking **Add new Key**. Give it a name e.g [customer.io](http://customer.io). Feel free to leave the callback URL and Route/bind options blank. To learn more about both, you can refer to the sleengshort docs [here](https://sleengshort.gitbook.io/sleengshort-sms-api-documentation/). Once your API keys and sender ID are set up, head over to [customer.io](http://customer.io). We’ll be using the [customer.io](http://customer.io) Webhooks feature for this integration. To learn more, [customer.io](http://customer.io) has some great documentation [here](https://customer.io/docs/webhooks-action/).

Within [Customer.io](http://Customer.io), head to Campaigns &gt; Create Campaign &gt; Give the Campaign a name. I believe these steps would also work for a broadcast. Setup your Campaign with your triggers &gt; Settings &gt; Goal & Exit. The real magic begins in the **workflow** section. You should end up on a screen like below

![](https://cdn-images-1.medium.com/max/1600/1*yyIV62vhJS2mOTUc8VsyNg.png align="left")

Click, hold, and drag the **send and receive data** block on the left into the large **Drag your first block here** section. Your screen should look like below;

![](https://cdn-images-1.medium.com/max/1600/1*fybKPIakyVIsDkDcce8OqQ.png align="left")

You can now make changes to the **Webhook 1** section by clicking it. Click **Add request** in the slider that pops up.

![](https://cdn-images-1.medium.com/max/1600/1*LaGPTez1BggUk6fXqEb9sQ.png align="left")

The **Add request** button will bring you to the screen below. The screenshot below already contains the URL to the Sleengshort APIs.

![](https://cdn-images-1.medium.com/max/1600/1*52GJgIP_vvBU1QSVCEa5Fw.png align="left")

You also need to add the **headers**. The headers will contain the authorization keys Sleengshort’s APIs expect to receive. Click the **Add header** button and add the following fields.

**Name** -&gt; X-Api-Key

**Value** -&gt; your\_api\_key\_from\_sleensghort\_starting\_with\_APPKEY

![](https://cdn-images-1.medium.com/max/1600/1*mJtLRLsH60BG7yApYYhPgA.png align="left")

Sleengshort and [Customer.io](http://Customer.io)

Once done, use the fields above in the editor. I’ve also repeated them below.

```plaintext
{
"sender_id" : "Your Sender ID",
"recipients" : {{customer.phone_number}},
"msg" : "Hello {{customer["First Name"]}}, welcome to our Company",
"type": 0
}
```

Make sure that each key and value is wrapped in a double quote `" "` to avoid errors in your messages sent. Also, use the **+** button next to each field that your users in your segment already have to add the recipient’s **phone number** and to add details like the customer’s name and other custom fields to the **“msg”** field. Click the **send test** button at the top to test that everything works fine. Make sure the test message is being delivered to a phone number you have access to.

If you get anything other than a **200** and **ok** response, you’ll need to make sure that you have setup everything correctly as show from the beginning of this tutorial.

Finally, click done and review your workflow before starting the campaign. Engineering teams can easily set up this workflow for their marketing teams. In the future, if the marketing team needs to start another campaign, they can simply duplicate the webhook settings by clicking the **copy from workflow** button and searching for the previous campaign that contains the webhooks setting.

![](https://cdn-images-1.medium.com/max/1600/1*Wjs8z-9jF0jP0WAmbujexQ.png align="left")

And that’s how you save your company thousands of every month on Marketing SMS by using a local SMS provider other than Twilio!