What to look for in an SMS API provider
When comparing SMS providers in Uganda, check destination and network coverage, sender-ID requirements, delivery reports, message encoding and segment rules, pricing, support and test options. Confirm current coverage and sender registration requirements with the provider; network delivery is not guaranteed by an accepted API request.
Phoenix exposes an HTTPS JSON endpoint for sending messages from a backend. SMS service activation, sufficient credits and an API key with the sms:send permission are required. The server-side provider configuration determines actual delivery routing.
Send an SMS from Node.js
Set PHOENIX_API_BASE_URL to the Phoenix API origin and store your key in your Node.js server environment. Each message request requires a unique Idempotency-Key; reuse that same key and payload if you retry the same operation after a timeout.
import { randomUUID } from 'node:crypto';
const apiBase = process.env.PHOENIX_API_BASE_URL
|| 'https://phoenixapiplatform.onrender.com';
const apiKey = process.env.PHOENIX_SMS_API_KEY;
if (!apiKey) throw new Error('Missing Phoenix SMS API key');
const response = await fetch(`${apiBase}/v1/sms/messages`, {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
'Idempotency-Key': randomUUID(),
},
body: JSON.stringify({
phoneNumbers: ['+256785151142'],
message: 'Your verification code is 123456.',
}),
});
if (!response.ok) {
throw new Error(`Phoenix request failed: HTTP ${response.status}`);
}
const result = await response.json();
console.log('Message request accepted:', result.data.externalId);
The send route returns HTTP 202 when it accepts the request; that response is not a guarantee that a handset received the SMS. Keep the API key on your server and do not put it in a web page, public repository or mobile application.
Check message status and handle retries
Use GET /v1/sms/messages with a key that has the sms:read permission to retrieve message records for your organization. Phoenix records message status and provider identifiers, not the message body. Use idempotency keys to prevent accidental duplicate sends when your server retries after an uncertain network result.
- Use HTTPS and keep the API key in server-side configuration.
- Normalize recipient phone numbers and validate them before sending.
- Ask for appropriate consent and follow applicable messaging rules.
- Check service credits, provider delivery status and sender requirements.
When Phoenix may fit
Phoenix can be considered when you want SMS sending and message records in the same workspace as Mobile Money and transactional email. Compare current coverage, pricing and operational support against your application's needs before committing to a provider.
Explore the Phoenix API Platform or read the Mobile Money API guide for Uganda.
