Jo Agy Ltd API

Fast & Reliable SMS & OTP Service for Ghana

Authentication & Base URL

Base URL: https://joagyapongltd.com/sms_api/

Required Header:

X-Client-Key: your-api-key-here

All endpoints use POST. Include the header in every call.

1. Send Single SMS

Endpoint: POST /send_sms.php

Send a single message to one Ghana number.

Request Body

{
  "to": "0243930223",
  "message": "Hello, this is a test message!"
}

Success Response

{
  "success": true,
  "message": "SMS sent successfully",
  "data": {
    "request_id": "7",
    "message_id": "7",
    "provider_status": "delivered",
    "segments": 1,
    "cost": 0.1
  }
}

Code Samples

curl -X POST https://joagyapongltd.com/sendexa/send_sms.php \
  -H "X-Client-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"to":"0243930223","message":"Hello from Jo Agy Ltd!"}'
final response = await http.post(
  Uri.parse('https://joagyapongltd.com/sendexa/send_sms.php'),
  headers: {
    'X-Client-Key': 'your-api-key',
    'Content-Type': 'application/json',
  },
  body: jsonEncode({
    "to": "0243930223",
    "message": "Hello, this is a test!",
  }),
);
fetch('https://joagyapongltd.com/sendexa/send_sms.php', {
  method: 'POST',
  headers: {
    'X-Client-Key': 'your-api-key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    to: '0243930223',
    message: 'Hello, this is a test!'
  })
})
.then(res => res.json())
.then(data => console.log('Success:', data))
.catch(err => console.error('Error:', err));

2. Send Bulk SMS

Endpoint: POST /send_sms.php

Send multiple messages (up to 1000) in one request.

Request Body

{
  "messages": [
    {
      "to": "0243930223",
      "message": "Hello John! 20% off today"
    },
    {
      "to": "0272972512",
      "message": "Hello Sarah! 20% off today"
    },
    {
      "to": "0540519119",
      "message": "Hello everyone! 20% off today"
    }
  ]
}

Success Response

{
  "success": true,
  "message": "Bulk SMS processing completed",
  "data": {
    "request_id": "10",
    "total_messages": 3,
    "successful": 3,
    "failed": 0,
    "invalid": 0,
    "total_cost": 0.3,
    "actual_cost": 0.3,
    "invalid_messages": []
  }
}

Code Samples

curl -X POST https://joagyapongltd.com/sendexa/send_sms.php \
  -H "X-Client-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {"to":"0243930223","message":"Bulk test from Salifu"},
      {"to":"0272972512","message":"Bulk test from Salifu"},
      {"to":"0540519119","message":"Bulk test from Salifu"}
    ]
  }'
final phones = ["0243930223", "0272972512", "0540519119"];
final msg = "Hello everyone! 20% off today";

final payload = {
  "messages": phones.map((p) => {"to": p, "message": msg}).toList(),
};

final response = await http.post(
  Uri.parse('https://joagyapongltd.com/sendexa/send_sms.php'),
  headers: {
    'X-Client-Key': 'your-api-key',
    'Content-Type': 'application/json',
  },
  body: jsonEncode(payload),
);
const phones = ["0243930223", "0272972512", "0540519119"];
const message = "Hello everyone! 20% off today";

const payload = {
  messages: phones.map(phone => ({
    to: phone,
    message: message
  }))
};

fetch('https://joagyapongltd.com/sendexa/send_sms.php', {
  method: 'POST',
  headers: {
    'X-Client-Key': 'your-api-key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(payload)
})
.then(res => res.json())
.then(data => console.log('Success:', data))
.catch(err => console.error('Error:', err));

3. Send OTP (Request Access Code)

Endpoint: POST /send_otp.php

Send a 6-digit OTP via SMS.

Request Body (minimal)

{
  "phone": "0243930223"
}

Success Response

{
  "success": true,
  "message": "OTP sent successfully",
  "data": {
    "id": "12",
    "phone": "233243930223",
    "channel": "SMS",
    "pinLength": 6,
    "pinType": "NUMERIC",
    "expiry": { "amount": 10, "duration": "minutes", "expiresAt": "..." }
  }
}

Code Samples

curl -X POST https://joagyapongltd.com/sendexa/send_otp.php \
  -H "X-Client-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"phone":"0243930223"}'
final response = await http.post(
  Uri.parse('https://joagyapongltd.com/sendexa/send_otp.php'),
  headers: {
    'X-Client-Key': 'your-api-key',
    'Content-Type': 'application/json',
  },
  body: jsonEncode({"phone": "0243930223"}),
);
fetch('https://joagyapongltd.com/sendexa/send_otp.php', {
  method: 'POST',
  headers: {
    'X-Client-Key': 'your-api-key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ phone: '0243930223' })
})
.then(res => res.json())
.then(data => console.log('Success:', data))
.catch(err => console.error('Error:', err));

4. Verify OTP

Endpoint: POST /verify_otp.php

Validate the OTP code entered by the user.

Request Body

{
  "phone": "0243930223",
  "code": "400985"
}

Success Response

{
  "success": true,
  "message": "Access code verified successfully",
  "data": {
    "phone": "233243930223",
    "verifiedAt": "2026-02-01 19:45:21"
  }
}

Code Samples

curl -X POST https://joagyapongltd.com/sendexa/verify_otp.php \
  -H "X-Client-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"phone":"0243930223","code":"400985"}'
final response = await http.post(
  Uri.parse('https://joagyapongltd.com/sendexa/verify_otp.php'),
  headers: {
    'X-Client-Key': 'your-api-key',
    'Content-Type': 'application/json',
  },
  body: jsonEncode({
    "phone": "0243930223",
    "code": "400985",
  }),
);
fetch('https://joagyapongltd.com/sendexa/verify_otp.php', {
  method: 'POST',
  headers: {
    'X-Client-Key': 'your-api-key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    phone: '0243930223',
    code: '400985'
  })
})
.then(res => res.json())
.then(data => console.log('Success:', data))
.catch(err => console.error('Error:', err));

Common Errors & Important Notes

CodeDescription
401Invalid or missing API key
402Insufficient balance
429Rate limit exceeded
400Invalid input (phone, message, format)
500Server error — contact support

Important Notes:
• Use valid Ghana numbers (024xxxxxxx or 23324xxxxxx format)
• Bulk supports up to 1000 messages per request
• OTP expires in 10 minutes by default
• All costs are in Ghana Cedis (GHS)