1 Base URL
The default base URL for LAfricaMobile API WhatsApp is https://waba-dev.lafricamobile.com.
If you want to send a message using the
/messages endpoint, you must append the endpoint to your base URL then make the POST request.
Below is an example of a full POST request to the resource: https://waba-dev.lafricamobile.com/messages.
Currently, there is only 1 method of authorization available
* API KEY
Retrieve your API Key
Log into the LAfricaMobile . You will need a valid user account for this.
Once all of the steps from the setup process are successfully completed, you can generate an API Key. When the phone number has the setup status DONE the Generate API Key button will be enabled. Click on the button to display the API Key in your browser.
Each endpoint described later in the docs has to be accessed with HTTP Request +SSL and either with API Key based authorization.
When making POST requests, JSON data specified in the docs has to be sent as POST data payload
Every request to the needs to be authorized using an API Key authentication. Adding LAM-API-KEY in the header with your unique API Key as a value will grant access.
Example for POST request with curl:
Example using POSTMAN:
3 Sending Messages
Use the messages node
/messages to send text messages, media, documents, and message templates to your customers.
You can send messages by making a POST call to the
/messages node regardless of message type.
The content of the JSON message body differs for each type of message (text, image, etc.).
Below is a simple example to send a text message:
4 Receiving Messages
You must configure a callback (webhook URL) to receive messages.
Webhooks can be used for:
- Inbound Message Notifications: Use it to get a notification you when you have received a message.
- Message Status Notifications: Monitor the status of sent messages.
If a webhook event isn't delivered for any reason (e.g., the client is offline) or if the webhook request returns a HTTP status code other than 200, we retry the webhook delivery. We continue retrying delivery with increasing delays up to a certain timeout (typically 24 hours, though this may vary), or until the delivery succeeds.
=> Webhook Requirements
To deploy a live webhook that can receive webhook events from the WhatsApp Business API, your code must have the following :
- HTTPS support
- A valid SSL certificate
=> Set your callback URL
Send a POST request to the
/configs/webhook endpoint to set the resource.