Sending Voice message using Sendchamp Voice API
This guide will walk you through how to send Voice messages using sendchamp Voice API
Aliyu Abubakar
Aug 4, 2021
In this tutorial, you’ll learn how to send voice messages such as text-to-speech to your customers using Sendchamp Voice API. Sendchamp Voice API allows you to convert text into a voice-based message using text-to-speech (TTS).
First thing's first, make sure you have signed up for your free sendchamp Account.
Once you have signed up for a free account, you’ll then need to do the following;
- Obtain your API keys
- Install a library or use your preferred language
- Voice Message API Call
- Send a Voice Message
Obtain your API keys
Sendchamp authenticates your API requests using your account’s API Key. If you do not include your key when making an API request, or use one that is incorrect or outdated, your request will return an error.
We included a test API KEY in our code samples. Make sure you replace our API test key with your own live or test API Key depending on what you intend to do, whether you want to test the API or send live messages.
Obtain your API key so sendchamp can authenticate your integration’s API requests. You can obtain your API key by simply visiting your dashboard, click on account settings, APIs & webhooks and there you’ll find your Access key.
If you cannot see your API keys on your dashboard, this means you do not have access to them. Only sendchamp users can access API Keys.
Install a library
You'll need to ensure that you have the library you wish to use installed on your computer. If you haven’t installed any library, follow the official installation instructions for your operating system to install it.
Voice Message API Call
Your Voice API call must have the following components:
A host.
An Authorization header.
A request.
The host for Live Voice requests: https://api.sendchamp.com/api/v1/voice/send The host for sandbox voice requests: https://sandbox-api.sendchamp.com/api/v1/voice/send
An API Access Key must be included in the Authorization header.
When submitting data to a resource via POST, you must submit your payload in JSON.
Send a Voice Message
Depending on the language you wish to use, using one of our Voice code samples here, write a script that will submit a message request.
- Copy the sample example for your preferred language.
- Paste the sample example into your favorite text editor.
- Copy your API key and paste it in the "Authorization" header.
- In the data section, specify the "customer_mobile_number", "message" and "type".