إضافة حقل إلى مجموعة بها C Sharp
إضافة عمود إلى مجموعة من contats مع C Sharp
C Sharp : وثائق API
- إنشاء مجموعة باستخدام C Sharp
- الحصول على قائمة حقول المجموعة باستخدام C Sharp
- إضافة حقل إلى مجموعة بها C Sharp
- حذف حقل من مجموعة بها C Sharp
- حذف جهة اتصال من مجموعة
- عيّن البلد إلى مجموعة بها C Sharp
- الحصول على قائمة جهات اتصال المجموعة باستخدام C Sharp
- إضافة جهة اتصال إلى مجموعة بها C Sharp
- تعديل جهة اتصال مجموعة بها C Sharp
- حذف جهة اتصال لمجموعة بها C Sharp
إضافة حقل إلى مجموعة بها C Sharp
String afilnet_class="group";
String afilnet_method="addcolumntogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_field="name";
// 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+"&idgroup="+afilnet_idgroup+"&field="+afilnet_field);
// 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"] = "group";
data["method"] = "addcolumntogroup";
data["user"] = "user";
data["password"] = "password";
data["idgroup"] = "1000";
data["field"] = "name";
// 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"] = "group";
data["method"] = "addcolumntogroup";
data["idgroup"] = "1000";
data["field"] = "name";
// 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="group";
String afilnet_method="addcolumntogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_field="name";
// 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, "{\"idgroup\":\""+afilnet_idgroup+"\",\"field\":\""+afilnet_field+"\"}");
معامل | وصف | إجباري / اختياري |
---|---|---|
class=group | الفئة المطلوبة: الفئة التي تم تقديم الطلب إليها | إلزامي |
method=addcolumntogroup | طريقة الفصل المطلوبة: طريقة الفصل الذي تم تقديم الطلب إليه | إلزامي |
user | المستخدم والبريد الإلكتروني لحساب Afilnet الخاص بك | إلزامي |
password | كلمة المرور لحساب Afilnet الخاص بك | إلزامي |
idgroup | معرف مجموعة | إلزامي |
field | مجال المجموعة | إلزامي |
عند تقديم طلبات ، ستتلقى الحقول التالية:
- status
-
النتيجة (إذا كانت الحالة = النجاح) ، سوف تتلقى هنا القيم التالية:
- لن يتم إرسال قيم إضافية إليك
- خطأ (إذا كانت الحالة = خطأ) ، هنا ستتلقى رمز الخطأ
يتم سرد رموز الأخطاء المحتملة أدناه
الشفرة | وصف |
---|---|
MISSING_USER | المستخدم أو البريد الإلكتروني غير المدرجة |
MISSING_PASSWORD | كلمة المرور غير المدرجة |
MISSING_CLASS | الطبقة غير المدرجة |
MISSING_METHOD | طريقة غير المدرجة |
MISSING_COMPULSORY_PARAM | المعلمة الإجبارية غير المدرجة |
INCORRECT_USER_PASSWORD | مستخدم غير صحيح أو كلمة المرور |
INCORRECT_CLASS | فئة غير صحيحة |
INCORRECT_METHOD | طريقة غير صحيحة |
NOT_ACCESS_TO_GROUP | غير مسموح لك بالدخول إلى المجموعة المشار إليها |
المعلمات:
- class : group
- method : addcolumntogroup
- user : user
- password : password
- idgroup : 1000
- field : name
طلب:
https://www.afilnet.com/api/http/?class=group&method=addcolumntogroup&user=user&password=password&idgroup=1000&field=name