تعديل حساب فرعي باستخدام ruby on rails
تعديل حساب فرعي باستخدام ruby on rails
ruby on rails : وثائق API
- إنشاء مجموعة باستخدام ruby on rails
- الحصول على قائمة حقول المجموعة باستخدام ruby on rails
- إضافة حقل إلى مجموعة بها ruby on rails
- حذف حقل من مجموعة بها ruby on rails
- حذف جهة اتصال من مجموعة
- عيّن البلد إلى مجموعة بها ruby on rails
- الحصول على قائمة جهات اتصال المجموعة باستخدام ruby on rails
- إضافة جهة اتصال إلى مجموعة بها ruby on rails
- تعديل جهة اتصال مجموعة بها ruby on rails
- حذف جهة اتصال لمجموعة بها ruby on rails
- احصل على قائمة بقنوات الدردشة النشطة باستخدام ruby on rails
- إرسال رسالة عبر الدردشة مع ruby on rails
- إرسال ملف عبر الدردشة مع ruby on rails
- احصل على قائمة المحادثات في دردشة مع ruby on rails
- الحصول على قائمة بالرسائل من دردشة مع ruby on rails
- احصل على قائمة بالرسائل غير المقروءة من دردشة مع ruby on rails
تعديل حساب فرعي باستخدام ruby on rails
# net/http library is required
require 'net/http'
afilnet_class="subaccount";
afilnet_method="modifysubaccount";
afilnet_user="user";
afilnet_password="password";
afilnet_accountemail="email@email.com";
afilnet_modifypassword="1";
afilnet_accountpassword="password";
afilnet_namelastname="name+lastname";
afilnet_iscompany="1";
afilnet_companyname="mycompany";
afilnet_documentid="123456789A";
afilnet_language="en";
afilnet_countrycode="us";
afilnet_cityid="1";
afilnet_cityname="town";
afilnet_zipcode="123456";
afilnet_address="address";
# Create an URL request
sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&accountemail="+afilnet_accountemail+"&modifypassword="+afilnet_modifypassword+"&accountpassword="+afilnet_accountpassword+"&namelastname="+afilnet_namelastname+"&iscompany="+afilnet_iscompany+"&companyname="+afilnet_companyname+"&documentid="+afilnet_documentid+"&language="+afilnet_language+"&countrycode="+afilnet_countrycode+"&cityid="+afilnet_cityid+"&cityname="+afilnet_cityname+"&zipcode="+afilnet_zipcode+"&address="+afilnet_address;
uri = URI(sUrl)
response = Net::HTTP.get(uri)
# net/http library is required
require 'net/http'
afilnet_class="subaccount";
afilnet_method="modifysubaccount";
afilnet_user="user";
afilnet_password="password";
afilnet_accountemail="email@email.com";
afilnet_modifypassword="1";
afilnet_accountpassword="password";
afilnet_namelastname="name+lastname";
afilnet_iscompany="1";
afilnet_companyname="mycompany";
afilnet_documentid="123456789A";
afilnet_language="en";
afilnet_countrycode="us";
afilnet_cityid="1";
afilnet_cityname="town";
afilnet_zipcode="123456";
afilnet_address="address";
# Create an URL request
sUrl = "https://www.afilnet.com/api/http/";
uri = URI(sUrl)
response = Net::HTTP.post_form(uri, "class" => afilnet_class, "method" => afilnet_method, "user" => afilnet_user, "password" => afilnet_password, "accountemail" => afilnet_accountemail, "modifypassword" => afilnet_modifypassword, "accountpassword" => afilnet_accountpassword, "namelastname" => afilnet_namelastname, "iscompany" => afilnet_iscompany, "companyname" => afilnet_companyname, "documentid" => afilnet_documentid, "language" => afilnet_language, "countrycode" => afilnet_countrycode, "cityid" => afilnet_cityid, "cityname" => afilnet_cityname, "zipcode" => afilnet_zipcode, "address" => afilnet_address)
puts response.body
# net/http library is required
require 'net/http'
afilnet_class="subaccount";
afilnet_method="modifysubaccount";
afilnet_user="user";
afilnet_password="password";
afilnet_accountemail="email@email.com";
afilnet_modifypassword="1";
afilnet_accountpassword="password";
afilnet_namelastname="name+lastname";
afilnet_iscompany="1";
afilnet_companyname="mycompany";
afilnet_documentid="123456789A";
afilnet_language="en";
afilnet_countrycode="us";
afilnet_cityid="1";
afilnet_cityname="town";
afilnet_zipcode="123456";
afilnet_address="address";
# Create an URL request
sUrl = "https://www.afilnet.com/api/basic/?class="+afilnet_class+"&method="+afilnet_method+"&accountemail="+afilnet_accountemail+"&modifypassword="+afilnet_modifypassword+"&accountpassword="+afilnet_accountpassword+"&namelastname="+afilnet_namelastname+"&iscompany="+afilnet_iscompany+"&companyname="+afilnet_companyname+"&documentid="+afilnet_documentid+"&language="+afilnet_language+"&countrycode="+afilnet_countrycode+"&cityid="+afilnet_cityid+"&cityname="+afilnet_cityname+"&zipcode="+afilnet_zipcode+"&address="+afilnet_address;
uri = URI(sUrl)
req = Net::HTTP::Get.new(uri)
req.basic_auth afilnet_user, afilnet_password
res = Net::HTTP.start(uri.hostname) {|http|
http.request(req)
}
puts res.body
# Savon library is required
require 'savon'
# We define vars
afilnet_class="subaccount";
afilnet_method="modifysubaccount";
afilnet_user="user";
afilnet_password="password";
afilnet_accountemail="email@email.com";
afilnet_modifypassword="1";
afilnet_accountpassword="password";
afilnet_namelastname="name+lastname";
afilnet_iscompany="1";
afilnet_companyname="mycompany";
afilnet_documentid="123456789A";
afilnet_language="en";
afilnet_countrycode="us";
afilnet_cityid="1";
afilnet_cityname="town";
afilnet_zipcode="123456";
afilnet_address="address";
# We create the client instance
client = Savon.client(wsdl: 'https://www.afilnet.com/api/soap/index.php?wsdl', ssl_verify_mode: :none)
# We call to the service
res = client.call(:call, message: {
user: afilnet_user,
password: afilnet_password,
class: afilnet_class,
method: afilnet_method,
petition: "{\"accountemail\":\""+afilnet_accountemail+"\",\"modifypassword\":\""+afilnet_modifypassword+"\",\"accountpassword\":\""+afilnet_accountpassword+"\",\"namelastname\":\""+afilnet_namelastname+"\",\"iscompany\":\""+afilnet_iscompany+"\",\"companyname\":\""+afilnet_companyname+"\",\"documentid\":\""+afilnet_documentid+"\",\"language\":\""+afilnet_language+"\",\"countrycode\":\""+afilnet_countrycode+"\",\"cityid\":\""+afilnet_cityid+"\",\"cityname\":\""+afilnet_cityname+"\",\"zipcode\":\""+afilnet_zipcode+"\",\"address\":\""+afilnet_address+"\"}"
})
puts res.body
معامل | وصف | إجباري / اختياري |
---|---|---|
class=subaccount | الفئة المطلوبة: الفئة التي تم تقديم الطلب إليها | إلزامي |
method=modifysubaccount | طريقة الفصل المطلوبة: طريقة الفصل الذي تم تقديم الطلب إليه | إلزامي |
user | المستخدم والبريد الإلكتروني لحساب Afilnet الخاص بك | إلزامي |
password | كلمة المرور لحساب Afilnet الخاص بك | إلزامي |
accountemail | حساب البريد الإلكتروني | إلزامي |
modifypassword | إلزامي | |
accountpassword | كلمة مرور الحساب | اختياري |
namelastname | اسم ولقب الشخص المسؤول | إلزامي |
iscompany | (0) إذا كان شخصًا طبيعيًا أو (1) إذا كانت شركة | إلزامي |
companyname | اسم الشركة (في حال كانت شركة) | اختياري |
documentid | كود وثيقة تعريف الشركة | إلزامي |
language | لغة الحساب الفرعي. انظر الجدول المرفق | إلزامي |
countrycode | رمز البلد ISO بتنسيق ISO-3166-1 ALPHA-2 | إلزامي |
cityid | معرف المدينة | إلزامي |
cityname | اسم المدينة أو البلدة التي تنتمي إليها | إلزامي |
zipcode | رمز بريدي | إلزامي |
address | العنوان الفعلي | إلزامي |
عند تقديم طلبات ، ستتلقى الحقول التالية:
- status
-
النتيجة (إذا كانت الحالة = النجاح) ، سوف تتلقى هنا القيم التالية:
- لن يتم إرسال قيم إضافية إليك
- خطأ (إذا كانت الحالة = خطأ) ، هنا ستتلقى رمز الخطأ
يتم سرد رموز الأخطاء المحتملة أدناه
الشفرة | وصف |
---|---|
MISSING_USER | المستخدم أو البريد الإلكتروني غير المدرجة |
MISSING_PASSWORD | كلمة المرور غير المدرجة |
MISSING_CLASS | الطبقة غير المدرجة |
MISSING_METHOD | طريقة غير المدرجة |
MISSING_COMPULSORY_PARAM | المعلمة الإجبارية غير المدرجة |
INCORRECT_USER_PASSWORD | مستخدم غير صحيح أو كلمة المرور |
INCORRECT_CLASS | فئة غير صحيحة |
INCORRECT_METHOD | طريقة غير صحيحة |
EMPTY_COUNTRYCODE | رمز البلد فارغ |
EMPTY_FIELDS | بعض الحقول الإلزامية فارغة |
COUNTRY_NOT_FOUND | لا توجد دولة مع الرمز المشار إليه |
EMPTY_CITY | لم تحدد المدينة |
CITY_NOT_FOUND | المدينة المشار إليها غير موجودة |
INCORRECT_EMAIL | البريد الإلكتروني المتضمن غير صالح |
INCORRECT_PASSWORD | كلمة المرور المضمنة غير صالحة |
ACCOUNT_NOT_FOUND | لم يتم العثور على حساب المستخدم |
المعلمات:
- class : subaccount
- method : modifysubaccount
- user : user
- password : password
- accountemail : email@email.com
- modifypassword : 1
- accountpassword : password
- namelastname : name+lastname
- iscompany : 1
- companyname : mycompany
- documentid : 123456789A
- language : en
- countrycode : us
- cityid : 1
- cityname : town
- zipcode : 123456
- address : address
طلب:
https://www.afilnet.com/api/http/?class=subaccount&method=modifysubaccount&user=user&password=password&accountemail=email@email.com&modifypassword=1&accountpassword=password&namelastname=name+lastname&iscompany=1&companyname=mycompany&documentid=123456789A&language=en&countrycode=us&cityid=1&cityname=town&zipcode=123456&address=address