Skicka bulk e-post från mall med Python
Skicka bulk e-post till en grupp adress med en mall med Python
Python : API-DOKUMENTATION
- Skapa grupp med Python
- Hämta gruppfältlista med Python
- Lägg till ett fält i en grupp med Python
- Radera ett fält från en grupp med Python
- Radera en kontakt från en grupp
- Assistera land till e-grupp med Python
- Hämta gruppkontaktlista med Python
- Lägg till kontakt i en grupp med Python
- Ändra kontakt med en grupp med Python
- Radera kontakt med en grupp med Python
Skicka bulk e-post från mall med Python
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)
Parameter | Beskrivning | Obligatorisk / valfri |
---|---|---|
class=email | Klass begärt: Klass som begäran görs till | Obligatorisk |
method=sendemailtogroupfromtemplate | Klassmetod begärd: Metod för den klass som begäran görs till | Obligatorisk |
user | Användare och e-post till ditt Afilnet-konto | Obligatorisk |
password | Lösenord för ditt Afilnet-konto | Obligatorisk |
idgroup | Identifierare för destinationsgruppen | Obligatorisk |
idtemplate | email.sendemailtogroupfromtemplate_idtemplate | Obligatorisk |
scheduledatetime | Leveransdatum och tid i åååå-mm-dd hh:mm:ss-format | Valfri |
output | Outputformat för resultatet | Valfri |
När du gör förfrågningar får du följande fält:
- status
-
resultat (om status = framgång), här får du följande värden:
- id
- count
- credits
-
destinations
- messageid
- destination
- fel (om status = fel), här får du felkoden
De möjliga felkoderna listas nedan
Koda | Beskrivning |
---|---|
MISSING_USER | Användare eller e-post ingår inte |
MISSING_PASSWORD | Lösenord ingår inte |
MISSING_CLASS | Klass ingår inte |
MISSING_METHOD | Metod ingår inte |
MISSING_COMPULSORY_PARAM | Obligatorisk parameter ingår inte |
INCORRECT_USER_PASSWORD | Felaktig användare eller lösenord |
INCORRECT_CLASS | Fel klass |
INCORRECT_METHOD | Fel metod |
NOT_ACCESS_TO_GROUP | Du får inte delta i den angivna gruppen |
NO_CREDITS | Din balans är otillräcklig |
parametrar:
- class : email
- method : sendemailtogroupfromtemplate
- user : user
- password : password
- idgroup : 1000
- idtemplate : 1000
- scheduledatetime :
- output :
Begäran:
https://www.afilnet.com/api/http/?class=email&method=sendemailtogroupfromtemplate&user=user&password=password&idgroup=1000&idtemplate=1000&scheduledatetime=&output=