HLR HTTP مع
الحصول على حالة رقم الهاتف الثابت أو المحمول باستخدام python
python : وثائق API
- إنشاء مجموعة باستخدام python
- الحصول على قائمة حقول المجموعة باستخدام python
- إضافة حقل إلى مجموعة بها python
- حذف حقل من مجموعة بها python
- حذف جهة اتصال من مجموعة
- عيّن البلد إلى مجموعة بها python
- الحصول على قائمة جهات اتصال المجموعة باستخدام python
- إضافة جهة اتصال إلى مجموعة بها python
- تعديل جهة اتصال مجموعة بها python
- حذف جهة اتصال لمجموعة بها python
HLR HTTP مع
import urllib2
afilnet_class="hlr"
afilnet_method="checkphonenumbers"
afilnet_user="user"
afilnet_password="password"
afilnet_numbers="100000000,100000001,100000002"
# Create an URL request
sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&numbers="+afilnet_numbers
result = urllib2.urlopen(sUrl).read()
from urllib.request import urlopen
from urllib.parse import urlencode
afilnet_class="hlr"
afilnet_method="checkphonenumbers"
afilnet_user="user"
afilnet_password="password"
afilnet_numbers="100000000,100000001,100000002"
# Create an URL request
sUrl = "https://www.afilnet.com/api/http/"
data = urlencode({"class": afilnet_class,"method": afilnet_method,"user": afilnet_user,"password": afilnet_password,"numbers": afilnet_numbers}).encode("utf-8")
result = urlopen(sUrl, data).read()
print(result)
import requests
afilnet_class="hlr"
afilnet_method="checkphonenumbers"
afilnet_user="user"
afilnet_password="password"
afilnet_numbers="100000000,100000001,100000002"
# Create an URL request
sUrl = "https://www.afilnet.com/api/basic/?class="+afilnet_class+"&method="+afilnet_method+"&numbers="+afilnet_numbers
result = requests.get(sUrl,auth=requests.auth.HTTPBasicAuth(afilnet_user,afilnet_password))
print(result.text)
معامل | وصف | إجباري / اختياري |
---|---|---|
class=hlr | الفئة المطلوبة: الفئة التي تم تقديم الطلب إليها | إلزامي |
method=checkphonenumbers | طريقة الفصل المطلوبة: طريقة الفصل الذي تم تقديم الطلب إليه | إلزامي |
user | المستخدم والبريد الإلكتروني لحساب Afilnet الخاص بك | إلزامي |
password | كلمة المرور لحساب Afilnet الخاص بك | إلزامي |
numbers | قائمة بأرقام الهواتف بما في ذلك رمز البلد مفصولة بـ ، (فواصل) | إلزامي |
عند تقديم طلبات ، ستتلقى الحقول التالية:
- status
-
النتيجة (إذا كانت الحالة = النجاح) ، سوف تتلقى هنا القيم التالية:
- credits
-
list
- number
- mccmnc
- imsi
- onname
- onprefix
- oncountry
- ported
- portedcountry
- portedname
- portedprefix
- error
- permanent_error
- خطأ (إذا كانت الحالة = خطأ) ، هنا ستتلقى رمز الخطأ
يتم سرد رموز الأخطاء المحتملة أدناه
الشفرة | وصف |
---|---|
MISSING_USER | المستخدم أو البريد الإلكتروني غير المدرجة |
MISSING_PASSWORD | كلمة المرور غير المدرجة |
MISSING_CLASS | الطبقة غير المدرجة |
MISSING_METHOD | طريقة غير المدرجة |
MISSING_COMPULSORY_PARAM | المعلمة الإجبارية غير المدرجة |
INCORRECT_USER_PASSWORD | مستخدم غير صحيح أو كلمة المرور |
INCORRECT_CLASS | فئة غير صحيحة |
INCORRECT_METHOD | طريقة غير صحيحة |
المعلمات:
- class : hlr
- method : checkphonenumbers
- user : user
- password : password
- numbers : 100000000,100000001,100000002
طلب:
https://www.afilnet.com/api/http/?class=hlr&method=checkphonenumbers&user=user&password=password&numbers=100000000,100000001,100000002