Sending WhatsApp message using Sendchamp WhatsApp API

This guide will walk you through how to send WhatsApp messages using sendchamp WhatsApp API

Aliyu Abubakar

Aug 4, 2021

In this tutorial, you’ll learn how to send WhatsApp messages to your customers using Sendchamp WhatsApp API.

First thing's first, make sure you have signed up for your free sendchamp Account.

image

Once you have signed up for a free account, you’ll then need to do the following;

  1. Obtain your API keys
  2. Install a library or use your preferred language
  3. WhatsApp Message API Call
  4. Send a WhatsApp 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.

image

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.

WhatsApp Message API Call

Your WhatsApp API call must have the following components:

  1. A host.
  2. Authorization Header
  3. Request

An API 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 WhatsApp Message

Depending on the language you wish to use, using one of our WhatsApp code samples here, write a script that will submit a message request.

For OTP/Notification Requests:

  • Copy the sample example for your preferred language.
  • Paste the example into your favorite text editor.
  • Copy your API key and paste it in the "Authorization" header.

In the data section, specify the following;

Sender: Your approved WhatsApp number on Sendchamp. You can use our phone number if you have not registered a number 2347067959173

Recipient: WhatsApp number of the customer you are sending the message to Template_code: You can find this on the template page under WhatsApp Channel of your Sendchamp dashboard

Message: This is the message based on the template approved on Sendchamp Dashboard

For Two way Messaging Requests:

  • Copy the sample example for your preferred language.
  • Paste the example into your favorite text editor.
  • Copy your API key and paste it in the "Authorization" header.

In the data section, specify the following;

Sender: Your approved WhatsApp number on Sendchamp. You can use our phone number if you have not registered a number 2347067959173 Type: Use Parameter "text" if you are sending a text message.

Recipient: WhatsApp number of the customer you are sending the message to

Message: message to customer

Thanks for getting to the end of the tutorial. Be sure that if you have more questions, you can join our [Slack community] (https://bit.ly/community-tutorial-link) here and we will help resolve it.

© 2022 Sendchamp. All rights reserved.