Failure modes
Real providers fail: wrong keys, outages, slow answers, DLT refusals. Each smsyra API key can fail on purpose, in your provider’s own words, so you can test what your app does — without touching a real account.
A key’s failure mode
Set it in the app: API keys → a key’s menu → Change how it answers. It applies to the next request.
| Mode | Tests | What smsyra does |
|---|---|---|
| Success | The normal setting. | Answers as your provider does when it takes a text. The text goes to the inbox. |
| Provider error | Your error handling. | Answers with your provider's own error. The text is kept as “Simulated error”. |
| Provider down | Retries and fallbacks. | Answers 503, as if the provider were down. The text is kept as “Simulated outage”. |
| Slow | Timeouts. | Waits as long as you set (up to 30 seconds), then answers normally. |
Give different keys different modes — say, one for the normal suite and one that is always down for the retry tests. When many slow requests are waiting at once, smsyra answers the extra ones as if the provider were down.
Strict DLT
Turn on strict DLT for a key and smsyra refuses a text that doesn’t match its template, the way your provider refuses a DLT failure, instead of taking it. The text is kept as “Refused (strict DLT)” so you can see why. Only texts to Indian numbers are checked.
Other answers you can test
- A wrong or revoked key gets your provider’s authentication error. Nothing is kept: there is no workspace to keep it in.
- The plan’s monthly limit gets your provider’s “out of balance” error until the next cycle.
- Too many requests per second gets your provider’s rate-limit answer.
- A bad number or a missing field gets the error your provider gives for it; the request is kept as “Rejected”.
Each provider’s answers
| Provider | Provider error | Provider down | Strict DLT refusal |
|---|---|---|---|
| AmazeSMS | HTTP 200{"status":"error","message":"Service temporarily unavailable"} | HTTP 503{"error":"Service Unavailable"} | HTTP 200{"status":"error","message":"DLT template mismatch"} |
| MSG91 (Flow v5) | HTTP 200{"message":"Internal error, please contact your account manager","type":"error","code":"506"} | HTTP 503{"message":"Service Unavailable","type":"error"} | HTTP 200{"message":"Template mismatch","type":"error","code":"400"} |
| Fast2SMS | HTTP 400{"return":false,"status_code":415,"message":"Account Disabled"} | HTTP 503{"return":false,"message":"Service Unavailable"} | HTTP 400{"return":false,"status_code":424,"message":"Invalid Message ID"} |
| Twilio | HTTP 500{"code":20500,"message":"Internal Server Error","more_info":"https://www.twilio.com/docs/errors/20500","status":500} | HTTP 503{"code":20503,"message":"Service Unavailable","more_info":"https://www.twilio.com/docs/errors/20503","status":503} | HTTP 400{"code":21901,"message":"DltTemplateId is invalid","more_info":"https://www.twilio.com/docs/errors/21901","status":400} |
| Exotel | HTTP 500{"RestException":{"Status":500,"Code":"INTERNAL_SERVER_ERROR","Message":"Internal server error. Please try again later."}} | HTTP 503{"RestException":{"Status":503,"Code":"SERVICE_UNAVAILABLE","Message":"Service temporarily unavailable. Please try again later."}} | HTTP 400{"RestException":{"Status":400,"Code":"INVALID_DLT_TEMPLATE","Message":"Invalid DltTemplateId. Template not found or not approved."}} |
| smsyra JSON | HTTP 502{"error":{"code":"PROVIDER_ERROR","message":"Simulated provider error (this key's failure mode)."}} | HTTP 503{"error":{"code":"UNAVAILABLE","message":"Service unavailable. Please try again later."}} | HTTP 422{"error":{"code":"DLT_REJECTED","message":"The text doesn't match its DLT template (strict mode is on)."}} |
Each provider’s guide has the full list, with the authentication error too.