Funkce mailkit.mailinglist.import umožňuje hromadně importovat příjemce do seznamu.
Tato API funkce však není primárně určena k plnění seznamu příjemců, ale jako nástroj pro hromadné aktualizace. Pro synchronizaci s informačními systémy doporučujeme využívat datové zdroje, které umožňují jednodušší a flexibilnější implementaci, která je časově méně náročná na realizaci.
<?xml version="1.0"?>
<methodCall>
<methodName>mailkit.mailinglist.import</methodName>
<params>
<param>
<value>
<int>client_id</int>
</value>
</param>
<param>
<value>
<string>client_md5</string>
</value>
</param>
<param>
<value>
<int>ID_user_list</int>
</value>
</param>
<param>
<value>
<array>
<data>
<value>
<struct>
<member>
<name>first_name</name>
<value>
<string>Jméno</string>
</value>
</member>
<member>
<name>last_name</name>
<value>
<string>Příjmení</string>
</value>
</member>
<member>
<name>email</name>
<value>
<string>mail@mail.cz</string>
</value>
</member>
<member>
<name>status</name>
<value>
<string>enabled</string>
</value>
</member>
<member>
<name>company</name>
<value>
<string>firma</string>
</value>
</member>
<member>
<name>prefix</name>
<value>
<string>titul</string>
</value>
</member>
<member>
<name>vocative</name>
<value>
<string>oslovení</string>
</value>
</member>
<member>
<name>reply_to</name>
<value>
<string>mail@mail.cz</string>
</value>
</member>
<member>
<name>nick_name</name>
<value>
<string>přezdívka</string>
</value>
</member>
<member>
<name>gender</name>
<value>
<string>pohlaví</string>
</value>
</member>
<member>
<name>phone</name>
<value>
<string>12345</string>
</value>
</member>
<member>
<name>mobile</name>
<value>
<string>12345</string>
</value>
</member>
<member>
<name>fax</name>
<value>
<string>12345</string>
</value>
</member>
<member>
<name>street</name>
<value>
<string>adresa</string>
</value>
</member>
<member>
<name>city</name>
<value>
<string>město</string>
</value>
</member>
<member>
<name>state</name>
<value>
<string>země</string>
</value>
</member>
<member>
<name>country</name>
<value>
<string>kraj</string>
</value>
</member>
<member>
<name>zip</name>
<value>
<string>PSČ</string>
</value>
</member>
<member>
<name>custom1</name>
<value>
<string>vlastní pole č. 1</string>
</value>
</member>
<member>
<name>customX</name>
<value>
<string>vlastní pole č. X</string>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>status</name>
<value>
<string>unknown</string>
</value>
</member>
<member>
<name>email</name>
<value>
<string>mail2@mail.cz</string>
</value>
</member>
</struct>
</value>
</data>
</array>
</value>
</param>
</params>
</methodCall>
{
"function":"mailkit.mailinglist.import",
"id":"client_id",
"md5":"client_md5",
"parameters":{
"ID_user_list":ID_user_list,
"recipients":[
{
"street":"stret",
"custom16":"custom16",
"nick_name":"nick_name",
"custom3":"custom3",
"state":"state",
"email":"email",
"custom17":"custom17",
"custom20":"custom20",
"vocative":"vocative",
"custom19":"custom19",
"custom12":"custom12",
"custom1":"custom1",
"custom22":"custom22",
"zip":"zip",
"custom2":"custom2",
"custom23":"custom23",
"custom18":"custom18",
"custom13":"custom13",
"custom25":"custom25",
"status":"status",
"mobile":"mobile",
"last_name":"last_name",
"custom6":"custom6",
"city":"city",
"fax":"fax",
"custom5":"custom5",
"company":"company",
"gender":"m",
"country":"country",
"custom24":"custom24",
"custom4":"custom4",
"custom9":"custom9",
"custom15":"custom15",
"custom10":"custom10",
"phone":"phone",
"custom11":"custom11",
"custom21":"custom21",
"custom7":"custom7",
"custom14":"custom14",
"reply_to":"email20@example.eu",
"custom8":"custom8",
"first_name":"first_name",
"prefix":"prefix"
},
{
"street":"stret",
"custom16":"custom16",
"nick_name":"nick_name",
"custom3":"custom3",
"state":"state",
"email":"email",
"custom17":"custom17",
"custom20":"custom20",
"vocative":"vocative",
"custom19":"custom19",
"custom12":"custom12",
"custom1":"custom1",
"custom22":"custom22",
"zip":"zip",
"custom2":"custom2",
"custom23":"custom23",
"custom18":"custom18",
"custom13":"custom13",
"custom25":"custom25",
"status":"status",
"mobile":"mobile",
"last_name":"last_name",
"custom6":"custom6",
"city":"city",
"fax":"fax",
"custom5":"custom5",
"company":"company",
"gender":"m",
"country":"country",
"custom24":"custom24",
"custom4":"custom4",
"custom9":"custom9",
"custom15":"custom15",
"custom10":"custom10",
"phone":"phone",
"custom11":"custom11",
"custom21":"custom21",
"custom7":"custom7",
"custom14":"custom14",
"reply_to":"email20@example.eu",
"custom8":"custom8",
"first_name":"first_name",
"prefix":"prefix"
}
]
}
}
client_id * = API ID naleznete ve svém Mailkit účtu v menu Profil / Integrace.
client_md5 * = MD5 kód naleznete ve svém Mailkit účtu v menu Profil / Integrace.
ID_user_list * = ID seznamu příjemců
first_name = jméno příjemce
last_name = příjmení příjemce
email * = e-mailová adresa příjemce
status = status příjemce
company = firma příjemce
prefix = titul příjemce
vocative = oslovení příjemce
reply_to = e-mailová adresa pro odpověď příjemce
nick_name = přezdívka příjemce
gender = pohlaví příjemce příjemce. Může nabývat hodnot male/female; m/f; muz/zena; M/F
phone = telefon příjemce
mobile = mobil příjemce
fax = fax příjemce
street = adresa (ulice) příjemce
city = město příjemce
state = země příjemce
country = kraj příjemce
zip = PSČ příjemce
custom1 = vlastní pole příjemce č. 1. Celkový počet vlastních polí je 25.
* povinný parametr
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<string>w/x/y/z</string>
</value>
</param>
</params>
</methodResponse>
{
"invalid_emails": [],
"count_new": "10",
"error_status": 0,
"count_bad": "0",
"count_all": "20",
"count_updated": "10"
}
invalid_emails = neplatné adresy
count_new = nové adresy
error_status = chybový stav
count_bad = počet neplatných adres
count_all = celkový počet adres
count_updated = počet aktualizovaných adres
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<string>Wrong ID_mailing_list</string>
</value>
</param>
</params>
</methodResponse>
{
"error_status": 1,
"error": "Invalid ID_user_list"
}
Wrong ID_mailing_list = vloženo špatné nebo neexistující ID seznamu příjemců (pro XML)
Invalid ID_user_list = neplatné ID seznamu příjemců (pro JSON)
Missing ID_user_list = chybí ID seznamu příjemců (pro JSON)