Skip to main content

Test Your First API Call

Start with one sandbox request. Keep it small, verify the response, then move to SDKs, webhooks, and production readiness.

Before You Start​

  • Create an AfriRoute account.
  • Create a sandbox API key in the console.
  • Store the key as an environment variable on your machine or server.
  • Use E.164 phone numbers, for example +251900000000.

Do not paste real API keys into docs, screenshots, browser code, or public repositories.

Send One Sandbox Message​

curl --request POST https://api.afriroute.ai/api/v1/sms/send \
--header "Authorization: Bearer $AFRIROUTE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"to": "+251900000000",
"message": "Hello from AfriRoute",
"country": "ET",
"senderId": "AFRIROUTE"
}'

Use a sandbox key for this first call. Sandbox traffic is for validation and should not be treated as proof of live delivery.

Expected Shape​

{
"messageId": "msg_01JPFZ0D4PT4X6YQ8ZZ8E1KS8R",
"status": "queued",
"channel": "sms",
"createdAt": "2026-06-01T18:20:00Z"
}

Statuses such as queued, accepted, or sent_to_carrier mean AfriRoute accepted the request. Only a delivery receipt or status lookup should be treated as confirmed delivery.

Check The Result​

Use the returned message ID with the public message status endpoint:

curl --request GET https://api.afriroute.ai/api/v1/messages/msg_01JPFZ0D4PT4X6YQ8ZZ8E1KS8R \
--header "Authorization: Bearer $AFRIROUTE_API_KEY"

Common Failures​

StatusMeaningFix
401Missing or invalid API keyCheck the Authorization header and environment
403Key lacks permissionUse a key scoped for the product
400Invalid requestCheck phone format and required fields
429Rate limitedBack off and retry later
503Route temporarily unavailableRetry with exponential backoff

Next Steps​