احصل على قائمة بالرسائل غير المقروءة من دردشة WhatsAPP مع C Sharp
WhatsAPP Business API. احصل على رسائل غير مقروءة من دردشة WhatsAPP باستخدام C Sharp
C Sharp : وثائق API
- إنشاء مجموعة باستخدام C Sharp
- الحصول على قائمة حقول المجموعة باستخدام C Sharp
- إضافة حقل إلى مجموعة بها C Sharp
- حذف حقل من مجموعة بها C Sharp
- حذف جهة اتصال من مجموعة
- عيّن البلد إلى مجموعة بها C Sharp
- الحصول على قائمة جهات اتصال المجموعة باستخدام C Sharp
- إضافة جهة اتصال إلى مجموعة بها C Sharp
- تعديل جهة اتصال مجموعة بها C Sharp
- حذف جهة اتصال لمجموعة بها C Sharp
احصل على قائمة بالرسائل غير المقروءة من دردشة WhatsAPP مع C Sharp
String afilnet_class="whatsapp";
String afilnet_method="getunreadmessages";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_platformid="100";
String afilnet_destination="34600000000";
// 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+"&platformid="+afilnet_platformid+"&destination="+afilnet_destination);
// 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"] = "whatsapp";
data["method"] = "getunreadmessages";
data["user"] = "user";
data["password"] = "password";
data["platformid"] = "100";
data["destination"] = "34600000000";
// 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"] = "whatsapp";
data["method"] = "getunreadmessages";
data["platformid"] = "100";
data["destination"] = "34600000000";
// 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="whatsapp";
String afilnet_method="getunreadmessages";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_platformid="100";
String afilnet_destination="34600000000";
// 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, "{\"platformid\":\""+afilnet_platformid+"\",\"destination\":\""+afilnet_destination+"\"}");
معامل | وصف | إجباري / اختياري |
---|---|---|
class=whatsapp | الفئة المطلوبة: الفئة التي تم تقديم الطلب إليها | إلزامي |
method=getunreadmessages | طريقة الفصل المطلوبة: طريقة الفصل الذي تم تقديم الطلب إليه | إلزامي |
user | المستخدم والبريد الإلكتروني لحساب Afilnet الخاص بك | إلزامي |
password | كلمة المرور لحساب Afilnet الخاص بك | إلزامي |
platformid | معرّف النظام الأساسي | إلزامي |
destination | المستلم الذي تريد الحصول منه على الرسائل | إلزامي |
عند تقديم طلبات ، ستتلقى الحقول التالية:
- status
-
النتيجة (إذا كانت الحالة = النجاح) ، سوف تتلقى هنا القيم التالية:
-
list
- platformid
- message
- destination
- messageid
- issent
- status
- datetime
-
list
- خطأ (إذا كانت الحالة = خطأ) ، هنا ستتلقى رمز الخطأ
يتم سرد رموز الأخطاء المحتملة أدناه
الشفرة | وصف |
---|---|
MISSING_USER | المستخدم أو البريد الإلكتروني غير المدرجة |
MISSING_PASSWORD | كلمة المرور غير المدرجة |
MISSING_CLASS | الطبقة غير المدرجة |
MISSING_METHOD | طريقة غير المدرجة |
MISSING_COMPULSORY_PARAM | المعلمة الإجبارية غير المدرجة |
INCORRECT_USER_PASSWORD | مستخدم غير صحيح أو كلمة المرور |
INCORRECT_CLASS | فئة غير صحيحة |
INCORRECT_METHOD | طريقة غير صحيحة |
CHANNEL_NOT_FOUND | القناة المشار إليها غير موجودة |
CHAT_NOT_FOUND | الدردشة المشار إليها غير موجودة |
المعلمات:
- class : whatsapp
- method : getunreadmessages
- user : user
- password : password
- platformid : 100
- destination : 34600000000
طلب:
https://www.afilnet.com/api/http/?class=whatsapp&method=getunreadmessages&user=user&password=password&platformid=100&destination=34600000000