Help Center TurboSMS API संगतता

TurboSMS API संगतता

SMSBAT TurboSMS API के साथ संगतता परत का पूर्ण समर्थन करता है। इससे आप TurboSMS के लिए बनाए गए अपने मौजूदा इंटीग्रेशन को संदेश संरचनाओं या एंडपॉइंट पेलोड को दोबारा लिखे बिना सीधे SMSBAT पर माइग्रेट कर सकते हैं।

हम उन्हीं अनुरोध बॉडी संरचनाओं का उपयोग करके, जिनसे आप पहले से परिचित हैं, SMS और Viber संदेश भेजने (कैरोसेल और सर्वे जैसी उन्नत सुविधाओं सहित), स्थितियाँ प्राप्त करने और संदेश विवरण प्राप्त करने का समर्थन करते हैं।

प्रमाणीकरण

मूल TurboSMS API से एकमात्र अंतर प्रमाणीकरण तंत्र में है। जहाँ TurboSMS कस्टम token क्वेरी पैरामीटर या विशिष्ट ऑथ हेडर का उपयोग करता है, वहीं SMSBAT को मानक Bearer Token की आवश्यकता होती है।

सभी अनुरोधों के लिए आपको अपना SMSBAT API टोकन Authorization हेडर में शामिल करना होगा:

Authorization: Bearer YOUR_SMSBAT_TOKEN

बेस URL

सभी एंडपॉइंट को SMSBAT API के बेस URL पर निर्देशित किया जाना चाहिए:

https://restapi.smsbat.com

एकल संदेश भेजें

एंडपॉइंट: POST /api/tsms/message/send

हाइब्रिड डिलीवरी (SMS फ़ॉलबैक के साथ Viber) के समर्थन के साथ SMS और Viber संदेश भेजने की अनुमति देता है। यह एक भेजने का अनुरोध संसाधित करता है और प्रत्येक प्राप्तकर्ता के लिए डिलीवरी परिणाम लौटाता है।

मुख्य क्षमताएँ

  • लचीले पैरामीटर: वैश्विक पैरामीटर को विशिष्ट SMS/Viber पैरामीटर से ओवरराइड किया जा सकता है।
  • सामग्री: Viber कैरोसेल, सर्वे, फ़ाइल अटैचमेंट और इंटरैक्टिव बटन का समर्थन करता है।
  • त्रुटि प्रबंधन: त्रुटियों के लिए भी HTTP 200 लौटाता है (संरचित त्रुटि प्रतिक्रियाएँ)। सिस्टम त्रुटियों के लिए response_code: 999 और स्थिति FATAL_ERROR।
  • प्राप्तकर्ता त्रुटियाँ: विशिष्ट प्राप्तकर्ता त्रुटियाँ response_result ऐरे में लौटाई जाती हैं। विफल प्राप्तकर्ताओं के लिए message_id: null और विशिष्ट त्रुटि कोड होते हैं।

अनुरोध उदाहरण (हाइब्रिड संदेश)

{
  "sender": "GlobalSender",
  "text": "Test message",
  "recipients": ["380951111111", "380952222222"],
  "start_time": "2025-09-29T10:00:00Z",
  "sequence_id": "seq_12345",
  "sms": {
    "sender": "SMSSender",
    "text": "SMS version of message",
    "is_flash": false
  },
  "viber": {
    "sender": "ViberSender",
    "text": "Viber version of message",
    "ttl": 3600,
    "image_url": "https://example.com/image.png",
    "caption": "Button text",
    "action": "https://google.com",
    "count_clicks": true,
    "is_transactional": false
  }
}

अनुरोध उदाहरण (Viber कैरोसेल)

{
  "sender": "GlobalSender",
  "text": "Check out our products",
  "recipients": ["380951111111"],
  "viber": {
    "sender": "ViberSender",
    "text": "Check out our products",
    "is_transactional": false,
    "carousel": [
      {
        "title": "Product 1",
        "image_url": "https://example.com/product1.jpg",
        "button_caption": "Buy Now",
        "button_url": "https://example.com/buy/product1",
        "link_caption": "Learn More",
        "link_url": "https://example.com/product1"
      },
      {
        "title": "Product 2",
        "image_url": "https://example.com/product2.jpg",
        "button_caption": "Buy Now",
        "button_url": "https://example.com/buy/product2",
        "link_caption": "Learn More",
        "link_url": "https://example.com/product2"
      }
    ]
  }
}

अनुरोध उदाहरण (Viber सर्वे)

{
  "sender": "GlobalSender",
  "text": "Please rate our service",
  "recipients": ["380951111111"],
  "viber": {
    "sender": "ViberSender",
    "text": "Please rate our service",
    "is_transactional": true,
    "survey": [
      "Excellent",
      "Good",
      "Average",
      "Poor"
    ]
  }
}

कई संदेश भेजें (बैच)

एंडपॉइंट: POST /api/tsms/message/sendmulti

यह विधि आपको एक ही HTTP अनुरोध में कई send अनुरोध भेजने देती है, जिससे कनेक्शन का ओवरहेड बचता है। 100 अनुरोधों के डेटा के साथ sendmulti को कॉल करना 100 अलग-अलग send अनुरोध चलाने की तुलना में तेज़ होगा।

अनुरोध उदाहरण

{
  "batch_1": {
    "sender": "GlobalSender",
    "text": "Test message",
    "recipients": ["380982462128", "380501111111"],    
    "sms": {
        "sender": "SMSSender",
        "text": "SMS version of message"
    }
  },
  "batch_2": {
    "sender": "GlobalSender",
    "text": "Second message",
    "recipients": ["380501111111"],
    "viber": {
      "sender": "ViberSender",
      "text": "Viber message",
      "is_transactional": true
    }
  }
}

प्रतिक्रिया उदाहरण

{
    "response_code": 0,
    "response_status": "OK",
    "response_result": {
        "batch_1": {
            "response_code": 800,
            "response_status": "SUCCESS_MESSAGE_ACCEPTED",
            "response_result": [
                {
                    "phone": "380982462128",
                    "response_code": 0,
                    "message_id": "f1640579-ea75-4bc1-b708-1c3858bf222d",
                    "response_status": "OK"
                }
            ]
        },
        "batch_2": { ... }
    }
}

संदेश की स्थिति प्राप्त करें

एंडपॉइंट: POST /api/tsms/message/status

भेजे गए संदेशों की message_id देकर उनकी डिलीवरी स्थितियाँ प्राप्त करें।

अनुरोध उदाहरण

{
  "messages": [
      "573dcb46-7851-4e16-bb1f-721c13ef5f38", 
      "6b7f9ff5-28c8-4f38-913b-31af6021fbea"
  ]
}

संदेश विवरण प्राप्त करें

एंडपॉइंट: POST /api/tsms/message/details

बनाए गए संदेशों की विस्तृत जानकारी प्राप्त करने की अनुमति देता है, जिसमें SMS और Viber चैनलों के लिए पूर्ण पेलोड विवरण, मूल्य निर्धारण और सटीक टाइमस्टैम्प शामिल हैं।

अनुरोध उदाहरण

{
  "messages": [
      "573dcb46-7851-4e16-bb1f-721c13ef5f38", 
      "f1640579-ea75-4bc1-b708-1c3858bf222d"
  ]
}

प्रतिक्रिया उदाहरण

{
    "response_code": 0,
    "response_status": "OK",
    "response_result": [
        {
            "message_id": "573dcb46-7851-4e16-bb1f-721c13ef5f38",
            "sms": null,
            "viber": {
                "added": "2025-09-29T14:17:02.577Z",
                "start": "2025-09-29T10:00:00Z",
                "sent": "2025-09-29T14:17:02.577Z",
                "updated": "2025-09-29T14:17:02.577Z",
                "sender": "ViberSender",
                "text": "Viber version of message",
                "recipient": "380982462128",
                "message_type": "promotional",
                "status": "Queued",
                "price": 0,
                "ttl": 3600,
                "caption": "Button text",
                "action": "https://google.com"
            },
            "response_code": 0,
            "response_status": "OK"
        }
    ]
}