تحقق من OTP باستخدام C Sharp
تحقق من رمز OTP (كلمة مرور واحدة) تم إنشاؤه مسبقًا باستخدام C Sharp
C Sharp : وثائق API
- إنشاء مجموعة باستخدام C Sharp
- الحصول على قائمة حقول المجموعة باستخدام C Sharp
- إضافة حقل إلى مجموعة بها C Sharp
- حذف حقل من مجموعة بها C Sharp
- حذف جهة اتصال من مجموعة
- عيّن البلد إلى مجموعة بها C Sharp
- الحصول على قائمة جهات اتصال المجموعة باستخدام C Sharp
- إضافة جهة اتصال إلى مجموعة بها C Sharp
- تعديل جهة اتصال مجموعة بها C Sharp
- حذف جهة اتصال لمجموعة بها C Sharp
تحقق من OTP باستخدام C Sharp
String afilnet_class="otp";
String afilnet_method="verifyotp";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_destination="34600000000";
String afilnet_code="A73HF3I";
String afilnet_output="";
// Create an URL request
WebRequest request = WebRequest.Create("https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&destination="+afilnet_destination+"&code="+afilnet_code+"&output="+afilnet_output);
// Get the response
WebResponse response = request.GetResponse ();
// Get the stream returned by the server
Stream dataStream = response.GetResponseStream();
// Open the stream
StreamReader reader = new StreamReader (dataStream);
// Read the Response
String result = reader.ReadToEnd ();
// Asign vars
var data = new NameValueCollection();
data["class"] = "otp";
data["method"] = "verifyotp";
data["user"] = "user";
data["password"] = "password";
data["destination"] = "34600000000";
data["code"] = "A73HF3I";
data["output"] = "";
// Create Web client
var wb = new WebClient();
// Execute POST petition
var response = wb.UploadValues("https://www.afilnet.com/api/http/", "POST", data);
// Get response
string responseString = Encoding.UTF8.GetString(response);
// Asign vars
var data = new NameValueCollection();
data["class"] = "otp";
data["method"] = "verifyotp";
data["destination"] = "34600000000";
data["code"] = "A73HF3I";
data["output"] = "";
// Create Web client
var wb = new WebClient { Credentials = new NetworkCredential("user", "password") };
// Execute POST petition
var response = wb.UploadValues("https://www.afilnet.com/api/http/", "POST", data);
// Get response
string responseString = Encoding.UTF8.GetString(response);
String afilnet_class="otp";
String afilnet_method="verifyotp";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_destination="34600000000";
String afilnet_code="A73HF3I";
String afilnet_output="";
// Allow SSL/TLS config
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// We create the webservice instance (Register Web Service first in project)
var service = new WebService.ApplicationServicesPortTypeClient();
// Call to WebService method
String response = service.call(afilnet_user, afilnet_password, afilnet_class, afilnet_method, "{\"destination\":\""+afilnet_destination+"\",\"code\":\""+afilnet_code+"\",\"output\":\""+afilnet_output+"\"}");
معامل | وصف | إجباري / اختياري |
---|---|---|
class=otp | الفئة المطلوبة: الفئة التي تم تقديم الطلب إليها | إلزامي |
method=verifyotp | طريقة الفصل المطلوبة: طريقة الفصل الذي تم تقديم الطلب إليه | إلزامي |
user | المستخدم والبريد الإلكتروني لحساب Afilnet الخاص بك | إلزامي |
password | كلمة المرور لحساب Afilnet الخاص بك | إلزامي |
destination | رقم الجوال أو البريد الإلكتروني للوجهة | إلزامي |
code | كلمة المرور للتحقق | اختياري |
output | تنسيق الإخراج من النتيجة | اختياري |
عند تقديم طلبات ، ستتلقى الحقول التالية:
- status
-
النتيجة (إذا كانت الحالة = النجاح) ، سوف تتلقى هنا القيم التالية:
- لن يتم إرسال قيم إضافية إليك
- خطأ (إذا كانت الحالة = خطأ) ، هنا ستتلقى رمز الخطأ
يتم سرد رموز الأخطاء المحتملة أدناه
الشفرة | وصف |
---|---|
MISSING_USER | المستخدم أو البريد الإلكتروني غير المدرجة |
MISSING_PASSWORD | كلمة المرور غير المدرجة |
MISSING_CLASS | الطبقة غير المدرجة |
MISSING_METHOD | طريقة غير المدرجة |
MISSING_COMPULSORY_PARAM | المعلمة الإجبارية غير المدرجة |
INCORRECT_USER_PASSWORD | مستخدم غير صحيح أو كلمة المرور |
INCORRECT_CLASS | فئة غير صحيحة |
INCORRECT_METHOD | طريقة غير صحيحة |
CODE_NOT_FOUND | ERROR_CODE_NOT_FOUND |
المعلمات:
- class : otp
- method : verifyotp
- user : user
- password : password
- destination : 34600000000
- code : A73HF3I
- output :
طلب:
https://www.afilnet.com/api/http/?class=otp&method=verifyotp&user=user&password=password&destination=34600000000&code=A73HF3I&output=