Integrating SMS capabilities into your Nigerian application is straightforward with a well-designed REST API. This guide walks through everything developers need to know — from API authentication to handling delivery reports.
Prerequisites
Before integrating, you need: an API key (obtained from your NigeriaSMS dashboard), your application backend in any language (Node.js, Python, PHP, Java, etc.), and a test phone number on a Nigerian network to verify delivery.
Authentication
All NigeriaSMS API calls require authentication via API key in the request header. Include your key as "Authorization: Bearer YOUR_API_KEY" in all requests. Never include API keys in client-side code — always make API calls from your backend.
Sending Your First SMS
A basic send SMS request is a POST to the /messages endpoint with a JSON body containing: to (Nigerian phone number in 234XXXXXXXXXX format), from (your registered sender ID), and body (your message text). A successful request returns a message ID for tracking delivery.
Handling Nigerian Phone Number Formats
Nigerian numbers can be submitted in various formats — 08012345678, 2348012345678, or +2348012345678. Best practice is to normalise all numbers to the 234XXXXXXXXXX format before sending to the API. A simple normalisation function strips the leading 0 or + and ensures the 234 country code is present.
Checking Delivery Status
After sending, use the message ID to query delivery status via GET /messages/{messageId}. Alternatively, configure a webhook URL in your dashboard to receive real-time delivery report callbacks — more efficient for high-volume applications.
Rate Limits and Best Practices
The NigeriaSMS API supports up to 100 messages per second for business accounts. For bulk sends above this rate, use the batch sending endpoint. Implement exponential backoff retry logic for failed requests. Always handle API errors gracefully with appropriate user feedback.
Related Services