Ruby on rails olan bir gruba bir kişi ekleyin
Ruby on rails olan bir gruba yeni bir kişi ekle
Ruby on rails : API BELGELERİ
- Ruby on rails ile grup oluştur
- Ruby on rails ile grup alanı listesini al
- Ruby on rails ile bir gruba alan ekleyin
- Ruby on rails ile bir gruptan alan silme
- Gruptaki bir kişiyi silme
- Ülkeyi Ruby on rails ile e grubuna atama
- Ruby on rails ile grup irtibat listesini al
- Ruby on rails ile bir gruba kişi ekleyin
- Bir grubun kişisini Ruby on rails ile değiştirin
- Ruby on rails ile bir grubun kişisini sil
- {Language} ile aktif sohbet kanallarının bir listesini alın
- {Language} ile sohbet yoluyla mesaj gönderin
- {Language} ile sohbet yoluyla bir dosya gönderin
- {Language} ile bir sohbette konuşmaların listesini alın
- {Language} ile bir sohbetten mesajların listesini alın
- {Language} ile bir sohbetten okunmamış mesajların bir listesini alın
Ruby on rails olan bir gruba bir kişi ekleyin
# net/http library is required
require 'net/http'
afilnet_class="group";
afilnet_method="addcontact";
afilnet_user="user";
afilnet_password="password";
afilnet_idgroup="1000";
afilnet_contact="mobile:123456789,name:testname";
# Create an URL request
sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&contact="+afilnet_contact;
uri = URI(sUrl)
response = Net::HTTP.get(uri)
# net/http library is required
require 'net/http'
afilnet_class="group";
afilnet_method="addcontact";
afilnet_user="user";
afilnet_password="password";
afilnet_idgroup="1000";
afilnet_contact="mobile:123456789,name:testname";
# 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, "idgroup" => afilnet_idgroup, "contact" => afilnet_contact)
puts response.body
# net/http library is required
require 'net/http'
afilnet_class="group";
afilnet_method="addcontact";
afilnet_user="user";
afilnet_password="password";
afilnet_idgroup="1000";
afilnet_contact="mobile:123456789,name:testname";
# Create an URL request
sUrl = "https://www.afilnet.com/api/basic/?class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&contact="+afilnet_contact;
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="group";
afilnet_method="addcontact";
afilnet_user="user";
afilnet_password="password";
afilnet_idgroup="1000";
afilnet_contact="mobile:123456789,name:testname";
# 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: "{\"idgroup\":\""+afilnet_idgroup+"\",\"contact\":\""+afilnet_contact+"\"}"
})
puts res.body
Parametre | Açıklama | Zorunlu / Seçmeli |
---|---|---|
class=group | İstenen sınıf: İsteğin yapıldığı sınıf | Zorunlu |
method=addcontact | İstenen sınıf yöntemi: İsteğin yapıldığı sınıfın yöntemi | Zorunlu |
user | Afilnet hesabınızın kullanıcısı ve e-postası | Zorunlu |
password | Afilnet hesabınızın şifresi | Zorunlu |
idgroup | Grup kimliği | Zorunlu |
contact | Virgülle ayrılmış alanlarıyla eklenecek temas, örneğe bakın | Zorunlu |
İstek yaptığınızda aşağıdaki alanları alacaksınız:
- status
-
sonuç (eğer durum = başarı ise), aşağıdaki değerleri alacaksınız:
- Size başka hiçbir değer gönderilmeyecek
- hata (eğer durum = hata ise), burada hata kodunu alacaksınız
Muhtemel hata kodları aşağıda listelenmiştir.
kod | Açıklama |
---|---|
MISSING_USER | Kullanıcı veya e-posta dahil değil |
MISSING_PASSWORD | Şifre dahil değil |
MISSING_CLASS | Sınıf dahil değil |
MISSING_METHOD | Yöntem dahil değil |
MISSING_COMPULSORY_PARAM | Zorunlu parametre dahil değil |
INCORRECT_USER_PASSWORD | Yanlış kullanıcı veya şifre |
INCORRECT_CLASS | Yanlış sınıf |
INCORRECT_METHOD | Yanlış yöntem |
CONTACT_EXISTS | Kişi grupta zaten var |
NOT_ACCESS_TO_GROUP | Belirtilen gruba giremezsiniz |
Parametreler:
- class : group
- method : addcontact
- user : user
- password : password
- idgroup : 1000
- contact : mobile:123456789,name:testname
İstek:
https://www.afilnet.com/api/http/?class=group&method=addcontact&user=user&password=password&idgroup=1000&contact=mobile:123456789,name:testname