Sandbox Environment
The sandbox environment allows you to test your integration without affecting real data or incurring charges. All API features are available in sandbox mode.
Sandbox Credentials
Use the sandbox base URL and test API keys for development:
Base URL
https://sandbox.api.mediloop.coAPI Key Prefix
sk_test_Sandbox Features
- No real messages sent - SMS, Email, WhatsApp are simulated
- No charges - All API calls are free in sandbox
- Instant callbacks - Webhook delivery status simulated immediately
- Relaxed rate limits - Higher limits for testing
- Test data available - Pre-populated test patients and providers
Test Data
The sandbox comes with pre-populated test data you can use:
Test Patients
| UHID | Name | Phone |
|---|---|---|
UG000000001A | John Test | +256700000001 |
UG000000002B | Jane Test | +256700000002 |
UG000000003C | Mary Test | +256700000003 |
Test Providers
| ID | Name | Specialty |
|---|---|---|
prov-test-001 | Dr. Test Provider | General Practice |
prov-test-002 | Dr. Sarah Test | Pediatrics |
prov-test-003 | Dr. James Test | Internal Medicine |
Test Facilities
| ID | Name | Type |
|---|---|---|
fac-test-001 | Test Hospital | hospital |
fac-test-002 | Test Clinic | clinic |
fac-test-003 | Test Pharmacy | pharmacy |
fac-test-004 | Test Laboratory | laboratory |
Simulating Responses
Use the X-Sandbox-Simulate header to control how the sandbox responds:
Notification Delivery
Simulate Successful Delivery
bash
curl -X POST https://sandbox.api.mediloop.co/api/v1/triggers/appointment-reminder/ \
-H "Authorization: Bearer sk_test_..." \
-H "X-Sandbox-Simulate: delivered" \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG000000001A",
"appointment_id": "apt-test-001",
"provider_name": "Dr. Test",
"facility_name": "Test Hospital",
"appointment_date": "2024-01-20T10:00:00Z"
}'RESPONSE200
{
"success": true,
"notification_id": "notif-test-001",
"simulated_status": "delivered"
}Simulate Failed Delivery
bash
curl -X POST https://sandbox.api.mediloop.co/api/v1/triggers/appointment-reminder/ \
-H "Authorization: Bearer sk_test_..." \
-H "X-Sandbox-Simulate: failed" \
-H "Content-Type: application/json" \
-d '{ ... }'RESPONSE200
{
"success": true,
"notification_id": "notif-test-002",
"simulated_status": "failed",
"simulated_error": "Phone number unreachable"
}Simulation Options
| Value | Description |
|---|---|
delivered | Simulate successful delivery |
failed | Simulate delivery failure |
delayed | Simulate delayed delivery (webhook after 30s) |
bounced | Simulate email bounce |
timeout | Simulate provider timeout |
Testing Webhooks
In sandbox mode, webhooks are delivered immediately after API calls. Configure your webhook URL in the Developer Portal to receive test events.
Sample Webhook Payload
json
{
"event": "notification.delivered",
"timestamp": "2024-01-15T10:00:05Z",
"environment": "sandbox",
"data": {
"notification_id": "notif-test-001",
"channel": "SMS",
"status": "DELIVERED",
"simulated": true
}
}Sandbox Rate Limits
Sandbox has relaxed rate limits for testing:
| Limit | Sandbox | Production |
|---|---|---|
| Requests per minute | 100 | Plan-based |
| Requests per day | 10,000 | Plan-based |
| Bulk recipients | 100 | Up to 1,000 |
Going Live
When you're ready to go live:
- Complete verification in the Developer Portal
- Generate production API keys (
sk_live_) - Update your base URL to
https://api.mediloop.co - Remove any
X-Sandbox-Simulateheaders - Test with real data in production