للمطورين

هذا هو القسم الخاص بتوثيق API لربط خدمتك بـ سمس مان وشراء الأرقام تلقائيًا

API v2.0

واجهة برمجة التطبيقات (API) هي بروتوكول التفاعل بين برنامجك وخادم التفعيل الخاص بنا. تُستخدم واجهة برمجة التطبيقات لأتمام عملية استلام الرسائل النصية للتفعيل من جانبك. لاستخدام واجهة برمجة التطبيقات، يجب عليك استخدام مفتاح API الخاص بك، يمكنك الحصول عليه من خلال الانتقال إلى صفحة الملف الشخصي. برنامجنا متوافق تمامًا مع مواقع سمس المنافسة.

وصف بروتوكول API

يجب أن تذهب جميع الطلبات إلى http://api.sms-man.com/control/ طلب POST أو GET. يجب أن تحتوي جميع الطلبات على مفتاح API في شكل معلمة معلمة الرمز (token parameter)

طلب الرصيد

http://api.sms-man.com/control/get-balance?token=$token

المعلمات

الحقل النوع مطلوب القيمة
token String yes مفتاح API الخاص بك:

النتيجة

{"balance":"799.70"}

الأخطاء المحتملة

{"success":false,"error_code":"wrong_token","error_msg": "Wrong token!"}

احصل على الحدود

http://api.sms-man.com/control/limits?token=$token&country_id=$country_id&application_id=$application_id

المعلمات

الحقل النوع مطلوب القيمة
token String yes مفتاح API الخاص بك:
country_id Integer no
رقم الدولة
application_id Integer no
خدمة الأرقام

النتيجة

[{"application_id":"1","country_id":"1","numbers":"32302"},{"application_id":"1","country_id":"2","numbers":"3494"}]

الأخطاء المحتملة

{"success":false,"error_code":"wrong_token","error_msg": {"token": "Wrong token!"}}

اطلب رقم هاتف

http://api.sms-man.com/control/get-number?token=$token&country_id=$country_id&application_id=$application_id

المعلمات

لاختيار دولة عشوائية، استخدم country_id=0
الحقل النوع مطلوب القيمة
token String yes مفتاح API الخاص بك:
country_id Integer no
رقم الدولة
application_id Integer no
خدمة الأرقام
maxPrice Integer no القيمة المطلوبة الخاصة بك
currency String no RUB/USD/EUR
ref String no قم بتمرير معرف الإحالة

النتيجة

{"request_id":1,"country_id":1,"application_id":1,"number":"79002415539"}

الأخطاء المحتملة

{"success":false,"error_code":"wrong_token","error_msg": {"token": "Wrong token!"}}

احصل على الرسائل النصية

http://api.sms-man.com/control/get-sms?token=$token&request_id=$request_id

المعلمات

الحقل النوع مطلوب القيمة
token String yes مفتاح API الخاص بك:
request_id Integer yes معرف الطلب

النتيجة

{"request_id":1,"country_id":1,"application_id":1,"number":"79002415539", "sms_code": "1243"}

الأخطاء المحتملة

{"request_id":1,"country_id":1,"application_id":1,"number":"79002415539", "error_code": "wait_sms", "error_msg": "Still waiting..."}

تغيير حالة الطلب

http://api.sms-man.com/control/set-status?token=$token&request_id=$request_id&status=$status

المعلمات

الحقل النوع مطلوب القيمة
token String yes مفتاح API الخاص بك:
request_id Integer yes معرف الطلب
الحالة String yes ready / close / reject / used

النتيجة

{"request_id": 1, "success": true}

الأخطاء المحتملة

{"success":false,"error_code":"wrong_token","error_msg": "Wrong token!"}{"success":false,"error_code":"wrong_status","error_msg": "Status $status does not exists"}

المعلمات

http://api.sms-man.com/control/get-prices?token=$token&country_id=$country_id

المعلمات

الحقل النوع مطلوب القيمة
token String yes مفتاح API الخاص بك:
country_id Integer no
رقم الدولة

النتيجة

{"0":{"1":{"cost":"15","count":6455},"2":{"cost":"50","count":124}}, "1":{"3":{"cost":"6","count":1000}}

الأخطاء المحتملة

{"success":false,"error_code":"wrong_token","error_msg": {"token": "Wrong token!"}}

احصل على قائمة بجميع الدول

http://api.sms-man.com/control/countries?token=$token

المعلمات

الحقل النوع مطلوب القيمة
token String yes مفتاح API الخاص بك:

النتيجة

[{'id':0,'title':"Russia"}, {'id':3,'title':"China"}]

الأخطاء المحتملة

{"success":false,"error_code":"wrong_token","error_msg": "Wrong token!"}

احصل على قائمة بجميع الخدمات

http://api.sms-man.com/control/applications?token=$token

المعلمات

الحقل النوع مطلوب القيمة
token String yes مفتاح API الخاص بك:

النتيجة

[{'id':'1','name':"Vkontakte", "code":"vk"}, {'id':'2','name':"WeChat", "code": "wb"}, {'id':'3','name':"Telegram", "code":"tg"}]

الأخطاء المحتملة

{"success":false,"error_code":"wrong_token","error_msg": "Wrong token!"}
{{country.title}}
{{country.id}}
logo {{service.title}}
{{service.id}}
×

لقبول