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.co
API 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

UHIDNamePhone
UG000000001AJohn Test+256700000001
UG000000002BJane Test+256700000002
UG000000003CMary Test+256700000003

Test Providers

IDNameSpecialty
prov-test-001Dr. Test ProviderGeneral Practice
prov-test-002Dr. Sarah TestPediatrics
prov-test-003Dr. James TestInternal Medicine

Test Facilities

IDNameType
fac-test-001Test Hospitalhospital
fac-test-002Test Clinicclinic
fac-test-003Test Pharmacypharmacy
fac-test-004Test Laboratorylaboratory

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

ValueDescription
deliveredSimulate successful delivery
failedSimulate delivery failure
delayedSimulate delayed delivery (webhook after 30s)
bouncedSimulate email bounce
timeoutSimulate 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:

LimitSandboxProduction
Requests per minute100Plan-based
Requests per day10,000Plan-based
Bulk recipients100Up to 1,000

Going Live

When you're ready to go live:

  1. Complete verification in the Developer Portal
  2. Generate production API keys (sk_live_)
  3. Update your base URL to https://api.mediloop.co
  4. Remove any X-Sandbox-Simulate headers
  5. Test with real data in production