{
  "info": {
    "name": "SMSTAKE API",
    "description": "SMSTAKE messaging requests. SMSTAKE_BASE_URL is https://api.smstake.com/v1 for RCS, Voice and WhatsApp. SMS stays on https://api.smstake.com. Field references: https://smstake.com/docs/index.html",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "SMSTAKE_BASE_URL", "value": "https://api.smstake.com/v1" },
    { "key": "SMSTAKE_API_KEY", "value": "YOUR_API_TOKEN" },
    { "key": "SMSTAKE_USERNAME", "value": "YOUR_USERNAME" },
    { "key": "SMSTAKE_PASSWORD", "value": "YOUR_PASSWORD" },
    { "key": "SMSTAKE_PE_ID", "value": "YOUR_DLT_PE_ID" },
    { "key": "SMSTAKE_TEMPLATE_ID", "value": "YOUR_DLT_TEMPLATE_ID" }
  ],
  "item": [
    {
      "name": "SMS",
      "auth": { "type": "noauth" },
      "item": [
        {
          "name": "HTTP GET send",
          "request": {
            "method": "GET",
            "header": [],
            "url": "https://api.smstake.com/smsapi/httpapi.jsp?username={{SMSTAKE_USERNAME}}&password={{SMSTAKE_PASSWORD}}&from=SMSTKE&to=919876543210&text=Your%20OTP%20is%20482913&pe_id={{SMSTAKE_PE_ID}}&template_id={{SMSTAKE_TEMPLATE_ID}}&coding=0&flash=0&responsetype=json"
          }
        },
        {
          "name": "JSON send",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"username\": \"{{SMSTAKE_USERNAME}}\",\n  \"password\": \"{{SMSTAKE_PASSWORD}}\",\n  \"from\": \"SMSTKE\",\n  \"text\": \"Your OTP is 482913\",\n  \"pe_id\": \"{{SMSTAKE_PE_ID}}\",\n  \"template_id\": \"{{SMSTAKE_TEMPLATE_ID}}\",\n  \"to\": [\"919876543210\"]\n}"
            },
            "url": "https://api.smstake.com/smsapi/jsonapi.jsp"
          }
        },
        {
          "name": "Pull delivery report",
          "request": {
            "method": "GET",
            "header": [],
            "url": "https://api.smstake.com/dirresponse/dlrresp.jsp?username={{SMSTAKE_USERNAME}}&password={{SMSTAKE_PASSWORD}}&msgid=YOUR_ACK_ID&responsetype=json"
          }
        }
      ]
    },
    {
      "name": "RCS",
      "auth": {
        "type": "bearer",
        "bearer": [{ "key": "token", "value": "{{SMSTAKE_API_KEY}}", "type": "string" }]
      },
      "item": [
        {
          "name": "Send text",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"+919876543210\",\n  \"agent_id\": \"your_rcs_agent_id\",\n  \"type\": \"text\",\n  \"text\": \"Your order ORD-2847 has been shipped.\",\n  \"client_ref\": \"order_ORD2847\"\n}"
            },
            "url": "{{SMSTAKE_BASE_URL}}/rcs/send"
          }
        },
        {
          "name": "Send batch",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"messages\": [\n    { \"to\": \"+919876543210\", \"agent_id\": \"your_rcs_agent_id\", \"type\": \"text\", \"text\": \"Hi Ananya, your appointment is confirmed for 4:30 PM.\", \"client_ref\": \"appt_1001\" }\n  ]\n}"
            },
            "url": "{{SMSTAKE_BASE_URL}}/rcs/send-batch"
          }
        }
      ]
    },
    {
      "name": "Voice",
      "auth": {
        "type": "bearer",
        "bearer": [{ "key": "token", "value": "{{SMSTAKE_API_KEY}}", "type": "string" }]
      },
      "item": [
        {
          "name": "Outbound call",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone\": \"+919876543210\",\n  \"text_to_speech\": \"Your order is out for delivery today.\",\n  \"language\": \"en\",\n  \"client_ref\": \"tts_order_1001\"\n}"
            },
            "url": "{{SMSTAKE_BASE_URL}}/voice/call"
          }
        },
        {
          "name": "Voice OTP",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone\": \"+919876543210\",\n  \"text_to_speech\": \"Your verification code is 4 8 2 9 1 3.\",\n  \"language\": \"en\",\n  \"client_ref\": \"otp_login_1001\"\n}"
            },
            "url": "{{SMSTAKE_BASE_URL}}/voice/otp"
          }
        }
      ]
    },
    {
      "name": "WhatsApp",
      "auth": {
        "type": "bearer",
        "bearer": [{ "key": "token", "value": "{{SMSTAKE_API_KEY}}", "type": "string" }]
      },
      "item": [
        {
          "name": "Send utility template",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"+919876543210\",\n  \"type\": \"template\",\n  \"client_ref\": \"order_ORD2847\",\n  \"template\": {\n    \"name\": \"order_shipped\",\n    \"language\": \"en\",\n    \"category\": \"utility\",\n    \"components\": [\n      { \"type\": \"body\", \"parameters\": [{ \"type\": \"text\", \"text\": \"ORD-2847\" }] }\n    ]\n  }\n}"
            },
            "url": "{{SMSTAKE_BASE_URL}}/whatsapp/send"
          }
        }
      ]
    }
  ]
}
