Python ile şablondan toplu e-posta gönder
Python ile bir şablon kullanarak bir adres grubuna toplu e-posta gönderin
Python : API BELGELERİ
- Python ile grup oluştur
- Python ile grup alanı listesini al
- Python ile bir gruba alan ekleyin
- Python ile bir gruptan alan silme
- Gruptaki bir kişiyi silme
- Ülkeyi Python ile e grubuna atama
- Python ile grup irtibat listesini al
- Python ile bir gruba kişi ekleyin
- Bir grubun kişisini Python ile değiştirin
- Python 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
Python ile şablondan toplu e-posta gönder
import urllib2
afilnet_class="email"
afilnet_method="sendemailtogroupfromtemplate"
afilnet_user="user"
afilnet_password="password"
afilnet_idgroup="1000"
afilnet_idtemplate="1000"
afilnet_scheduledatetime=""
afilnet_output=""
# 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+"&idtemplate="+afilnet_idtemplate+"&scheduledatetime="+afilnet_scheduledatetime+"&output="+afilnet_output
result = urllib2.urlopen(sUrl).read()
from urllib.request import urlopen
from urllib.parse import urlencode
afilnet_class="email"
afilnet_method="sendemailtogroupfromtemplate"
afilnet_user="user"
afilnet_password="password"
afilnet_idgroup="1000"
afilnet_idtemplate="1000"
afilnet_scheduledatetime=""
afilnet_output=""
# Create an URL request
sUrl = "https://www.afilnet.com/api/http/"
data = urlencode({"class": afilnet_class,"method": afilnet_method,"user": afilnet_user,"password": afilnet_password,"idgroup": afilnet_idgroup,"idtemplate": afilnet_idtemplate,"scheduledatetime": afilnet_scheduledatetime,"output": afilnet_output}).encode("utf-8")
result = urlopen(sUrl, data).read()
print(result)
import requests
afilnet_class="email"
afilnet_method="sendemailtogroupfromtemplate"
afilnet_user="user"
afilnet_password="password"
afilnet_idgroup="1000"
afilnet_idtemplate="1000"
afilnet_scheduledatetime=""
afilnet_output=""
# Create an URL request
sUrl = "https://www.afilnet.com/api/basic/?class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&idtemplate="+afilnet_idtemplate+"&scheduledatetime="+afilnet_scheduledatetime+"&output="+afilnet_output
result = requests.get(sUrl,auth=requests.auth.HTTPBasicAuth(afilnet_user,afilnet_password))
print(result.text)
Parametre | Açıklama | Zorunlu / Seçmeli |
---|---|---|
class=email | İstenen sınıf: İsteğin yapıldığı sınıf | Zorunlu |
method=sendemailtogroupfromtemplate | İ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 | Hedef grubun tanımlayıcısı | Zorunlu |
idtemplate | email.sendemailtogroupfromtemplate_idtemplate | Zorunlu |
scheduledatetime | Teslim tarihi ve saati yyyy-aa-gg ss: s: dd: ss formatında | İsteğe bağlı |
output | Sonucun çıktı formatı | İsteğe bağlı |
İ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:
- id
- count
- credits
-
destinations
- messageid
- destination
- 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 |
NOT_ACCESS_TO_GROUP | Belirtilen gruba giremezsiniz |
NO_CREDITS | Bakiyeniz yetersiz |
Parametreler:
- class : email
- method : sendemailtogroupfromtemplate
- user : user
- password : password
- idgroup : 1000
- idtemplate : 1000
- scheduledatetime :
- output :
İstek:
https://www.afilnet.com/api/http/?class=email&method=sendemailtogroupfromtemplate&user=user&password=password&idgroup=1000&idtemplate=1000&scheduledatetime=&output=