Kotlin: Parse DLR from an Android SMS Gateway API

Featured illustration for Kotlin: Parse DLR from an Android SMS Gateway API

Parse delivery reports in Kotlin for an Android SMS Gateway API: sealed classes, transactional SMS adjacency, MCP context.

Written by the SMS Gateway team for operators who run phones and airtime themselves — not for theoretical cloud SMS demos.

InformationAndroid SMS GatewayAPIDevelopers
Article
Published
April 11, 2026
Updated
April 12, 2026
Reading time
17 minute read

Key Takeaways

  • Parse DLR in Kotlin with kotlinx.serialization or Moshi against Developer Center fields — not a branded Kotlin SDK.
  • Map vendor strings to a sealed class you own. Never overwrite Delivered with a late Pending.
  • Webhooks are at-least-once. Idempotent upserts on message id. Constant-time signature compare.
  • HTTP 200 on send is accepted. DLR is the radio. Keep OTP codes out of logs.
  • You bring the Android and operator credit. Platform pricing is devices plus send volume.

android sms gateway api DLR from Kotlin is a webhook (or poll) plus a mapper. Hub: API guide, DLR, webhooks. Live fields: Developer Center. Go sibling: Go OTP.

You bring the phone and airtime. Devices and send volume. REST samples are HTTPS/JSON — not a Kotlin SDK, NuGet, or Composer package.

sealed class · monotonic

PendingSentDeliveredFailed

A late Pending must not un-deliver a login code.

HTTPS JSON, not a Kotlin SDK

Conceptual decode only — copy live keys from Developer Center:

sealed class DlrState {
  data object Pending : DlrState()
  data object Delivered : DlrState()
  data object Failed : DlrState()
}
fun DlrState.canReplace(next: DlrState) = this !is DlrState.Delivered

Keys stay in env on the server. Env. Curl send canary: curl.

If you log the OTP body next to the DLR row, you already lost. Persist ids and states, not the code.

State table

EventMeansKotlin jobDo not
HTTP send 2xxAcceptedStore gateway idTell the user “delivered”
Pending / SentRadio still workingAge the rowOverwrite Delivered
DeliveredTerminal successSticky writeRe-send OTP
FailedTerminal failControlled resendRetry storm

Own the enum

Vendor strings change. Your sealed class does not. Transactional SMS. OTP: OTP.

Delivered is sticky

Events reorder. Encode precedence in one function used by webhook and poll. DLR practices. Queue: backlog.

Verify the raw body

MAC over bytes, then parse. At-least-once means unique constraints. Messaging practices. Device health: health.

Next steps

Fixture three payloads: pending, delivered, late pending. Spend 300 lifetime SMS proving the mapper — then a funded SIM. Pair the APK from Downloads.

Jump to the live product docs for this topic—not another long-form article.

FAQ

Frequently asked questions

Direct answers about android sms gateway api.

How do I parse DLR from an Android SMS gateway API in Kotlin?

Verify the webhook, decode JSON from Developer Center, map status into a sealed class, persist with unique message id, ignore regressions. Samples here are REST HTTPS/JSON only.

Is there a Kotlin SDK for DLR?

No Complete SDK product. Keep a thin HTTP client in your repo.

Does DLR include carrier SMS credit?

No. The radio already billed the operator. Free is 300 SMS lifetime for canaries.

Where are live status strings?

Developer Center. This page is mapping and precedence.

Should marketing and OTP share one DLR table?

Share the mapper. Isolate device_id and retry budgets.
Keep learning

Topically related guides—chosen by subject overlap, not a fixed sitewide footer.

Information
kotlin android sms gateway api

Kotlin Android Sms Gateway Api: In-Depth Guide

Kotlin Android Sms Gateway Api: In-Depth Guide. Long-tail article focused on exact query "kotlin android sms gateway api". Expand with examples, limits, FAQ, and links to hub C. Priced by devices and SMS send volume; BYO phone and operator credit. Developer Center owns live API parameters.

May 5, 202616 min
Read article

Browse the full Android SMS gateway knowledge base or return to how an Android SMS gateway works.

Get started

Test the gateway on your own Android phone

Install the app, pair one device, and validate your API flow before choosing a paid plan.

You supply the phone, SIM, and operator SMS credit.