TypeScript: Parse DLR from an Android SMS Gateway API

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

Parse delivery reports in TypeScript for an Android SMS Gateway API: state machines, scheduled SMS adjacency, WordPress plugin contrast.

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
July 9, 2025
Updated
August 3, 2025
Reading time
17 minute read

Key Takeaways

  • TypeScript parse DLR maps message.status from GET /messages/{id} or webhooks — not fetch() success as delivered.
  • Use fetch/undici over HTTPS/JSON. Not an npm “Complete SMS SDK” product.
  • Dedupe webhook event ids. Confirm enums in Developer Center.
  • Failed DLR does not refund operator airtime.
  • Free is a lifetime SMS cap on the platform.

TypeScript parse DLR on an android sms gateway api is status mapping after the SIM fired. Delivery reports · Send OTP. Docs: Developer Center.

REST only — not a Complete TypeScript SDK. Devices and send volume.

Pending → Delivered (when the carrier says so)

Accepted is not delivered

{
  "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 Node marks the user notified on HTTP 200, you will debug OTPs that never left a Doze-killed phone.

How to parse DLR in TypeScript

  1. Persist messages[].id.
  2. GET or webhook.
  3. Map status.
  4. Do not treat DLR as MFA success.
curl -X GET "https://app.sms-gateway.app/api/v1/messages/41822" \
  -H "Authorization: Bearer $SMS_GATEWAY_API_KEY"

Status map

You seeMeansYour row
PendingQueued / not yet radiosent_pending
DeliveredCarrier DLR when provideddelivered
FailedRadio or SMSC gave upfailed — inspect; no blind resend

fetch sketch

// Sketch only — confirm JSON in Developer Center
export async function getDlr(apiKey: string, id: number) {
  const res = await fetch(`https://app.sms-gateway.app/api/v1/messages/${id}`, {
    headers: { Authorization: `Bearer ${apiKey}` },
  });
  if (!res.ok) throw new Error(`dlr_http_${res.status}`);
  return res.json() as Promise<{ status?: string; number?: string }>;
}

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"
    }
  }
}

Webhook guide.

Next steps

Staff SMS → GET id → assert status enum matches docs. Downloads. Free: 300 SMS lifetime.

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 in TypeScript for an Android SMS gateway?

Persist messages[].id from send. GET /messages/{id} with Bearer, or verify webhooks. Map status with JSON.parse. Confirm live fields in Developer Center.

Is there an official TypeScript SDK?

No. Call REST HTTPS/JSON from Node or a BFF — not from a public browser with a secret.

Should I poll forever?

No. Webhooks in production; poll as break-glass.

Does Failed mean free SMS?

No. On Free and Developer, sending pauses when you use the plan SMS allowance rather than silently billing aggregator-style overage. Upgrade or request a custom allowance to continue. Free is 300 SMS lifetime.
Keep learning

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

Information
send sms with typescript android gateway

Send Sms With Typescript Android Gateway: In-Depth Guide

Send Sms With Typescript Android Gateway: In-Depth Guide. Long-tail article focused on exact query "send sms with typescript android gateway". 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.

Apr 9, 202516 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.