Sandbox
Test the same API without sending to a real phone.
Use a Sandbox key to call the same host and routes as production. Messages are not delivered to real phones and do not use wallet credits. Create the key in the dashboard under API Integration, then API Token. The secret starts with msnp_test_. Sandbox keys and sandbox sends do not require KYC and work on Flex. Switch to a Live key (msnp_live_) when you are ready to send to real phones; live keys need a Package or Enterprise plan, approved dashboard KYC (individual nagarita or national ID, or company registration plus letterhead cover letter; PAN optional), and a separate live API approval.
Request: sandbox send
bash
curl -X POST "https://api.messengernepal.com.np/api/v1/sms/send" \
-H "X-API-Key: msnp_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: sandbox-1" \
-d '{
"to": "98XXXXXXX",
"message": "Your Content Here!"
}'Response: 202 Accepted
json
{
"success": true,
"message": "SMS accepted for delivery",
"data": {
"dispatch_id": "661f0a1b2c3d4e5f67890123",
"job_id": "661f0a1b2c3d4e5f67890123",
"message_id": "661f0a1b2c3d4e5f67890123",
"status": "accepted",
"environment": "sandbox",
"charged": false,
"recipient": "98XXXXXXX",
"cost": 1,
"remaining_balance": 999,
"remaining_credits": 999
}
}Accepted responses include environment: "sandbox" and charged: false. Review messages in Sandbox inbox under API Integration (SMS and WhatsApp when your key has the right scopes). Sandbox inbox includes the message body so you can confirm what was sent, including OTP codes.
WhatsApp sandbox uses the same msnp_test_ keys on https://api.messengernepal.com.np/api/v1/whatsapp. No real phone delivery. Connect your WhatsApp Business number in the dashboard first; see Help: Connect WhatsApp.
The sender SANDBOX is always available. Sender IDs from your account also work in sandbox.
Optional: set a sandbox webhook URL under API Integration, then Webhooks. Sandbox events use the same signing secret as live events and are never sent to your live webhook URL.
On Sandbox keys only, these numbers always produce the same result:
9000000001request rejected (HTTP 400)9000000002accepted, thenfailed9000000003reachessent, thenfailed9000000004stayssent- Any other valid number reaches
deliveredshortly after accept
Request: forced reject (sandbox)
bash
curl -X POST "https://api.messengernepal.com.np/api/v1/sms/send" \
-H "X-API-Key: msnp_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"to": "9000000001",
"message": "This should fail validation"
}'Response: 400
json
{
"success": false,
"error": "Test number 9000000001 is rejected at accept in sandbox",
"code": "INVALID_TO_FORMAT"
}