Key Takeaways
- Ruby parse DLR on an Android SMS gateway API means mapping message.status from GET /messages/{id} or webhooks — not treating HTTP accept as delivered.
- Use Net::HTTP or Faraday over HTTPS/JSON. This is not a packaged Ruby SMS SDK or gem product.
- Deduplicate webhook event ids before updating rows. Confirm live enums in Developer Center.
- You bring phone and operator airtime. Failed DLR does not cash out carrier credit.
- Free/Developer pause at the platform SMS allowance. We meter devices + send volume.
Ruby parse DLR on an android sms gateway api is mapping delivery state after the SIM transmitted — or failed to. Product: delivery reports. API corner: Android SMS Gateway API. Docs: Developer Center.
REST HTTPS/JSON only — not a Complete Ruby SDK. Devices and send volume. You fund the SIM.
Pending → Delivered (when the carrier says so)
Accepted is not delivered
Send returns a batch with Pending:
{
"campaignId": 17,
"accepted": 1,
"scheduledAt": null,
"messages": [
{
"id": 41822,
"number": "+14155552671",
"text": "Your verification code is 481920",
"type": "sms",
"status": "Pending",
"campaignId": 17,
"deviceId": 3
}
]
}If Sidekiq marks the user “notified” on HTTP 200/202, you will debug OTPs that never left the docked phone.
How to parse DLR in Ruby
- Persist
messages[].id. - GET that id or wait for webhook.
- Map
status/deliveredAt. - Do not treat DLR as login success.
GET /messages/{id}
curl -X GET "https://app.sms-gateway.app/api/v1/messages/41822" \
-H "Authorization: Bearer $SMS_GATEWAY_API_KEY"Confirm the GET body in docs. Match OpenAPI — do not invent properties from this sketch.
Status map
| You see | Means | Your row |
|---|---|---|
| Pending | Queued / not yet radio | sent_pending |
| Delivered | Carrier DLR when provided | delivered |
| Failed | Radio or SMSC gave up | failed — inspect; don’t auto-resend without a new key |
Sibling: C# parse DLR. JSON: Ruby JSON.
Prefer webhooks
{
"id": "evt_01K2F8QW3N4RXB7M",
"type": "message.delivered",
"createdAt": "2026-08-12T14:04:09Z",
"apiVersion": "2026-08-12",
"data": {
"message": {
"id": 41823,
"number": "+14155552671",
"text": "Your verification code is 481920",
"status": "Delivered",
"campaignId": 17,
"deviceId": 3,
"metadata": { "orderId": "1234" },
"sentAt": "2026-08-12T14:04:02Z",
"deliveredAt": "2026-08-12T14:04:09Z"
}
}
}HMAC + event-id unique. Server webhook · /webhook.
Net::HTTP sketch
# Sketch only — confirm JSON shape in Developer Center
require "net/http"
require "json"
require "uri"
def get_dlr(api_key, id)
uri = URI("#{API_DLR_URL}/#{id}")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{api_key}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
raise "dlr_http_#{res.code}" unless res.is_a?(Net::HTTPSuccess)
JSON.parse(res.body)
endOTP path: OTP verification. Keep keys server-side — never in a mobile client.
DLR is not a refund
Failed after the SIM fired still cost airtime. Free: 300 SMS lifetime. We meter devices + volume; carrier fair-use remains. No “Unlimited SMS” titles for this tutorial.
Next steps
Send one staff SMS, GET the id, then fire a webhook into a Rack endpoint. Downloads.
Related product pages
Jump to the live product docs for this topic—not another long-form article.
- SMS delivery reports (DLR)Delivery status tracking
- SMS API documentationLive endpoint reference
- device and SMS volume pricingPlans and allowances
- Android SMS gateway product guideDefinition, product, and how to buy




