v3 में सामूहिक बहाली
इस API फ़ंक्शन का उद्देश्य कई फ़ोन नंबरों को एक साथ पुनर्स्थापित करना है।
POST: https://api.multitel.net/v3/bulk_restore
- प्रमाणीकरण: उपयोगकर्ता के API लॉगिन विवरण के साथ HTTP basic।
- अनुरोध का मुख्य भाग (application/json): {
"numbers":
[
"15551230111",
"15551230112",
"15551230113"
],
"webhook_url": "https://client.example.com/restore-hook"
}
- केवल अंकों वाली स्ट्रिंग स्वीकार होती हैं; numbers_text (अलग-अलग पंक्तियों में) भी काम करता है।
- 10 नंबर या कम → समकालिक रूप से संसाधित होते हैं; 10 से अधिक → कतार में रखे जाते हैं और पृष्ठभूमि सेवा प्रक्रिया द्वारा संसाधित होते हैं।
- समकालिक प्रतिक्रिया (केवल तभी संभव जब 10 नंबर या कम दिए गए हों): {
"job_uuid": "8f6c1f0e-23d2-4717-8c8e-1a518e5738f0",
"status": "completed",
"total_numbers": 3,
"success_count": 1,
"failure_count": 2,
"webhook_url": "https://client.example.com/restore-hook",
"created_at": "2025-10-28 12:31:45",
"started_at": "2025-10-28 12:31:45",
"completed_at": "2025-10-28 12:31:48",
"results": [
{
"number": "15551230111",
"status": "success",
"message": "Number restored",
"status_code": 200,
"requires_identity_update": 0
},
{
"number": "15551230112",
"status": "failed",
"message": "Error: 'restore failed, please contact support'",
"status_code": 500,
"requires_identity_update": 0
},
{
"number": "15551230113",
"status": "success",
"message": "Number restored",
"status_code": 200,
"requires_identity_update": 1,
"needs_registration": 1
}
]
}
भेजे गए डेटा को संसाधित करने में त्रुटियाँ होने पर (प्रतीक्षा समय समाप्त होना, DNS में डोमेन का पता न मिलना आदि), त्रुटियाँ "results" ऐरे के बाद लौटाई जाएँगी:
"webhook_error":"Could not resolve host: asidhaiufsd0uf.multitel.net"
या, यदि 10 से अधिक नंबर दिए गए हों:
- कतार में रखा गया (202 Accepted): {
"job_uuid": "c5bc4f3a-7b0a-4d5d-9f7e-d3fd87f41a00",
"status": "pending",
"total_numbers": 25,
"webhook_url": "https://client.example.com/restore-hook",
"message": "Restore job queued. Results will be POSTed to https://client.example.com/restore-hook"
}
- वेबहुक का डेटा अंतिम समकालिक संरचना के समान होता है (हर नंबर के स्थिति कोड/संदेश सहित)।
समय-समय पर स्थिति पूछना
- GET https://api.multitel.net/v3/bulk_restore_status
- job_uuid अनिवार्य है; number वैकल्पिक है (केवल अंक)।
- प्रतिक्रिया में कार्य का सारांश, प्रत्येक नंबर की वर्तमान स्थिति, प्रयास और समय-मुहरें होती हैं; number फ़िल्टर केवल उसी नंबर की प्रविष्टि लौटाता है।
- उदाहरण: GET …/bulk_restore_status?job_uuid=8f6c1f0e-23d2-4717-8c8e-1a518e5738f0
- फ़िल्टर किया गया: GET …/bulk_restore_status?job_uuid=…&number=15551230113
- GET https://api.multitel.net/v3/bulk_restore_status
- प्रमाणीकरण: अन्य v3 कॉल जैसा ही HTTP Basic।
- क्वेरी पैरामीटर:
- job_uuid (अनिवार्य) – POST प्रतिक्रिया में लौटाया जाता है।
- number (वैकल्पिक) – केवल अंक; परिणाम एक ही DID तक सीमित करता है।
- प्रतिक्रिया वेबहुक के डेटा जैसी होती है और अब इसमें requires_identity_update (1/0) तथा लागू होने पर needs_registration भी शामिल होते हैं। उदाहरण: {
"job_uuid": "8f6c1f0e-23d2-4717-8c8e-1a518e5738f0",
"status": "processing",
"total_numbers": 25,
"success_count": 10,
"failure_count": 0,
"webhook_url": "https://client.example.com/restore-hook",
"created_at": "2025-10-28 12:31:45",
"started_at": "2025-10-28 12:31:45",
"completed_at": null,
"results": [
{
"number": "15551230111",
"status": "success",
"message": "Number restored",
"status_code": 200,
"attempts": 1,
"started_at": "2025-03-28 12:31:45",
"completed_at": "2025-03-28 12:31:47",
"requires_identity_update": 0
},
{
"number": "15551230112",
"status": "failed",
"message": "Error: 'restore failed, please contact support'",
"status_code": 500,
"attempts": 1,
"started_at": "2025-03-28 12:31:45",
"completed_at": "2025-03-28 12:31:46",
"requires_identity_update": 0
},
{
"number": "15551230113",
"status": "success",
"message": "Number restored",
"status_code": 200,
"attempts": 1,
"started_at": "2025-03-28 12:31:45",
"completed_at": "2025-03-28 12:31:48",
"requires_identity_update": 1,
"needs_registration": 1
}
]
}
- number=15551230113 होने पर, results ऐरे में केवल उसी नंबर की प्रविष्टि होगी और डेटा में filtered_number भी होगा।
यदि आप एक साथ कई नंबर पुनर्स्थापित करने का अपना फ़ंक्शन बनाना चाहते हैं, तो नीचे दिए गए एकल नंबर वाले API एंडपॉइंट का उपयोग करके उसे हर उस नंबर के लिए अलग-अलग कॉल कर सकते हैं जिसे आप पुनर्स्थापित करना चाहते हैं।
curl -u 'USERNAME:PASSWORD' \
-H 'Accept: application/json' \
https://api.multitel.net/v3/restore/447000123456