This API function is not primarily intended to insert recipients in the recipient list, but as a bulk update tool. For synchronization with information systems, we recommend using data sources that enable a simpler and more flexible implementation that is less time-consuming to implement.
API call example:
JSON
{
"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@example.com",
"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",
"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":"email2@example.com",
"custom8":"custom8",
"first_name":"first_name",
"prefix":"prefix"
},
{
"email":"email@example.eu",
"first_name":"first_name",
"last_name":"last_name"
}
]
}
}
XML
<?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>mailinglist_id</int>
</value>
</param>
<param>
<value>
<array>
<data>
<!-- recipient nr. 1 -->
<value>
<struct>
<member>
<name>first_name</name>
<value>
<string>first name</string>
</value>
</member>
<member>
<name>last_name</name>
<value>
<string>last name</string>
</value>
</member>
<member>
<name>email</name>
<value>
<string>example@example.cz</string>
</value>
</member>
<member>
<name>company</name>
<value>
<string>company</string>
</value>
</member>
<member>
<name>prefix</name>
<value>
<string>title</string>
</value>
</member>
<member>
<name>vocative</name>
<value>
<string>salutation</string>
</value>
</member>
<member>
<name>reply_to</name>
<value>
<string>example@example.cz</string>
</value>
</member>
<member>
<name>nick_name</name>
<value>
<string>nick</string>
</value>
</member>
<member>
<name>gender</name>
<value>
<string>gender</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>address</string>
</value>
</member>
<member>
<name>city</name>
<value>
<string>city</string>
</value>
</member>
<member>
<name>state</name>
<value>
<string>state</string>
</value>
</member>
<member>
<name>country</name>
<value>
<string>country</string>
</value>
</member>
<member>
<name>zip</name>
<value>
<string>zip</string>
</value>
</member>
<member>
<name>custom1</name>
<value>
<string>custom field n.1</string>
</value>
</member>
<member>
<name>customX</name>
<value>
<string>custom field n.X</string>
</value>
</member>
</struct>
</value>
<!-- recipient nr. 2 -->
<value>
<struct>
<member>
<name>email</name>
<value>
<string>example@example.cz</string>
</value>
</member>
</struct>
</value>
</data>
</array>
</value>
</param>
</params>
</methodCall>
Values
client_id * = client ID can be found in your Mailkit account's menu Profile/Integration.
client_md5 * = MD5 code can be found in your Mailkit account's menu Profile/Integration.
mailinglist_id * = ID of mailing list
first_name = first name of recipient
last_name = last name of recipient
email * = e-mail address of recipient
company = company of recipient
prefix = title of recipient
vocative = salutation of recipient
reply_to = e-mail address of recipient for reply-to
nick_name = nick of recipient
gender = gender of recipient. Possible values: male/female; m/f; muz/zena; M/F
phone = phone of recipient
mobile = mobile of recipient
fax = fax of recipient
street = address of recipient
city = city of recipient
state = state of recipient
country = country of recipient
zip = ZIP of recipient
custom1 = custom field of recipient n. 1. Total number of custom fields is 25.
* required value
Successful call response:
JSON
{
"invalid_emails": [],
"count_new": "10",
"error_status": 0,
"count_bad": "0",
"count_all": "20",
"count_updated": "10"
}
XML
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<string>x/y/z</string>
</value>
</param>
</params>
</methodResponse>
Values (JSON)
invalid_emails = number of invalid emails
count_new = number of new records
error_status = error status
count_bad = number of invalid records
count_all = total number of imported records
count_updated = number of updated records
Values (XML)
w = total number of imported records
x = number of newly records
y = number of updated records
z = number of invalid records
Unsuccessful call response:
JSON
{
"error_status": 1,
"error": "Invalid ID_user_list"
}
XML
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<string>Wrong ID_mailing_list</string>
</value>
</param>
</params>
</methodResponse>
Values
Invalid ID_user_list = invalid mailing list ID (JSON)
Missing ID_user_list = missing mailing list ID (JSON)
Wrong ID_mailing_list = wrong ID of mailing list / or ID of mailing list does not exist (XML)