AxeDz

v1.0

  • Overview
  • Quickstart
  • SDK
  • Authentication
  • Payment
  • API Reference
  • Errors

Errors

When something goes wrong, AxeDz returns a clear error message so you know exactly what happened and how to fix it.

Error response format

All errors follow the same structure:

JSON
1{
2 "success": false,
3 "message": "Detailed error description"
4}

HTTP status codes

CodeMeaningWhat to do
200SuccessYour request worked
201CreatedYour resource was created successfully
400Bad RequestCheck your request — a field may be missing or invalid
401UnauthorizedCheck your API key — it may be missing, wrong, or revoked
403ForbiddenYour balance may be too low, or you lack permission
404Not FoundThe resource you requested does not exist
429Too Many RequestsSlow down — you are sending requests too quickly
500Server ErrorSomething went wrong on our end — try again shortly
502Delivery FailedThe message provider could not deliver — check the logs
503UnavailableWe are temporarily down for maintenance — try again later

Common errors

Invalid API key

Your API key is missing, incorrect, or has been revoked.

JSON
1// HTTP 401
2{
3 "success": false,
4 "message": "Invalid or revoked API key"
5}

Insufficient balance

Your wallet does not have enough credit to send this message.

JSON
1// HTTP 403
2{
3 "success": false,
4 "message": "Insufficient wallet balance. Current: 5 DZD, Required: 2 DZD"
5}

Invalid request

A required field is missing or a value is in the wrong format.

JSON
1// HTTP 400
2{
3 "success": false,
4 "message": "Field 'to' is required"
5}

Rate limit exceeded

You are sending too many requests. Wait before trying again.

JSON
1// HTTP 429
2{
3 "success": false,
4 "message": "Rate limit exceeded. Retry after 60 seconds"
5}

Message delivery status

After you send a message, it goes through several stages. You can track the status in your dashboard or via the logs API.

StatusWhat it means
queuedYour message was accepted and is waiting to be sent
sentThe message was handed off to the carrier or email provider
deliveredThe message reached the recipient successfully
failedDelivery failed — check the logs for details

Handling errors in your app

Here is a simple pattern for handling API errors in your code:

Node.js
1const response = await fetch("https://api.axedz.com/v1/sms/send", {
2 method: "POST",
3 headers: {
4 "Content-Type": "application/json",
5 "X-API-Key": process.env.AXEDZ_API_KEY,
6 },
7 body: JSON.stringify({ to: "+213555123456", message: "Hi" }),
8});
9 
10const body = await response.json();
11 
12if (!body.success) {
13 switch (response.status) {
14 case 401:
15 // Check or replace your API key
16 break;
17 case 403:
18 // Ask the user to top up their wallet
19 break;
20 case 429:
21 // Wait and retry
22 break;
23 default:
24 console.error(body.message);
25 }
26}