This method creates and automatically starts an import process for the contacts listed in the xmlDoc parameter. You can use this method instead of calling a sequence of NewImportProcess and StartProcess methods. StartImportProcesses can also be used to update fields of an existing contact. Please note that, while updating, empty parameters are handled as "do not update this field", not as "overwrite with an empty value".
Method parameters
Mandatory fields must be specified even when they are empty. Optional fields can be skipped if you want to use the default value.
Parameter | |||
---|---|---|---|
listsIDs | Mandatory - List identifiers. You can include multiple list IDs, separated by semicolons. Example: | ||
listsGUIDs string | List Mandatory - List GUIDs. You can include multiple list GUIDs, separated by semicolons. Example: | ||
xmlDoc | When specified: An XML string containing the recipients to be imported to the specified lists and groups. In this case the method Does not import any pending lists that were previously submitted using NewImportProccess If not specified (NULL): method sequentially imports all pending XML structures that have been previously submitted using NewImportProccess. This option is available only starting from MailUp 8.2.1 or higher See "Best Practices" and "XML Structure" sections below for known restrictions, more information and examples. | ||
groupsIDs string | Mandatory - Group identifiers for each list, separated by semicolons. You can specify multiple groups for each list as well, separated by commas. Example: | ||
importType integer | Mandatory - Import type.
Any empty field is ignored if importType is equal to 1,2 or 3
| mobileInputType integer | Mandatory - Mobile number input type.
(See Any empty field overwrites the value on MailUp if importType is equal to 4, 5 or 6
|
mobileInputType integer | Mandatory - Mobile number input type.
(See "XML Structure" section below for more information and examples.) | ||
asPending boolean | optional Mandatory - Import recipients as If "pending" when set to true.true" it subscribes (or unsubscribes, if "asOptOut=true") also the recipients that were pending in specified MailUp list before import. Please note that the name of this parameter is misleading, see table in Best Practices for details (Default = false) | ||
ConfirmEmail boolean | optional - Sends a confirmation request email when set to true. The system will automatically create the confirmation email based on a default template Mandatory - If "true" sets subscription status of specified recipients as "pending" and sends them a confirmation email. Status change to "pending" and email sending applies to either brand new recipients or to recipients that were already subscribed or pending to the specified list before import. See table in Best Practices for details. | ||
asOptOut boolean | optional Mandatory - Imports recipients as "unsubscribed" when set to "true. (Default = false) | forceOptIn boolean | optional - Imports recipients as "subscribed" when set to true. This will re-subscribe recipients that have previously unsubscribed", regardless if they were previously subscribed into specified MailUp list. If you want to cancel subscription (i.e. unsubscribe) also for the recipients that were previously pending, you should set both "asOptOut=true" and "asPending=true". See table in Best Practices for details. (Default = false) |
forceOptIn boolean | optional - Replace existing groups when set to true. The system will automatically remove previously subscribed groups and keep only the groups specified in the groupsIDs parameter.(Default = false) |
Note |
---|
An HTTP 500 Error is returned if optional parameters are included in the request with an empty value (Ex: |
Tip | ||
---|---|---|
| ||
|
Lists and Groups
...
Mandatory - If "true" itenables change of subscription status even if a recipient was "unsubscribed" before import. It can be used to force "subscribed" or "pending" status for previously unsubscribed recipients, please note that this status change does not apply when recipient was automatically unsubscribed due to hard bounce or complaints feedback loop. See table in Best Practices for details. (Default = false) | |
replaceGroups boolean | Mandatory - Replace existing groups when set to "true". The system will automatically remove previously subscribed groups and keep only the groups specified in the groupsIDs parameter.(Default = false) |
Note | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The following table shows the most common combinations for the parameters that manage subscription status of imported recipients that are already present on MailUp
|
Tip | ||
---|---|---|
| ||
|
Lists and Groups
You must specify either listIDs
or listsGUIDs
parameters. If you specify both fields, then the number of items in each parameter must match, and you must use semicolons to delineate empty values. We've provided examples below to help with understanding how to work with these parameters.
Add recipients to a single list (no groups)
In this example , we specify both the listsIDs
and the listsGUIDs
parametersvalues are provided for both listsIDs
and listsGUIDs
parameters (mandatory fields). There are no groups, so we include an empty groupsIDs
tag.
Code Block | ||||
---|---|---|---|---|
| ||||
<ws:listsIDs>1</ws:listsIDs> <ws:listsGUIDs>66af9900-7dd7-4cca-9125-beadaf3a3a59;0e591119-xxxx-yyyy-zzzz-6ac75384b564<beadaf3a3a59</ws:listsGUIDs> <ws:groupsIDs></ws:groupsIDs> |
Add recipients to a single list (single group)
In this example, we specify both the example values are provided for both listsIDs
and the listsGUIDs
parameters listsGUIDs
parameters (mandatory fields), and since there is a single group we include it in the groupsIDs
parameter.
Code Block | ||||
---|---|---|---|---|
| ||||
<ws:listsIDs>1</ws:listsIDs> <ws:listsGUIDs>66af9900-7dd7-4cca-9125-beadaf3a3a59;0e591119-xxxx-yyyy-zzzz-6ac75384b564<beadaf3a3a59</ws:listsGUIDs> <ws:groupsIDs>22</ws:groupsIDs> |
Add recipients to a single list (multiple groups)
In this example , we specify only the listsGUIDs
parametervalues are provided for both listsIDs
and listsGUIDs
parameters (mandatory fields). There are multiple groups for this list, so we separate them with a comma in the groupsIDs
parameter.
Code Block | ||||
---|---|---|---|---|
| ||||
<ws:listsIDs>1</ws:listsIDs> <ws:listsGUIDs>66af9900-7dd7-4cca-9125-beadaf3a3a59;0e591119-xxxx-yyyy-zzzz-6ac75384b564<beadaf3a3a59</ws:listsGUIDs> <ws:groupsIDs>22,23</ws:groupsIDs> |
Add recipients to multiple lists (no groups)
In this example, we specify both the example values are provided for both listsIDs
and the listsGUIDs
parameters (mandatory fields). Each Each of the parameters must have the same number of elements (separated by semi-colons), so since there are no groups for either list, we include a single semi-colon in the groupsIDs
parameter to denote that there are two elements.
Code Block | ||||
---|---|---|---|---|
| ||||
<ws:listsIDs>1;2</ws:listsIDs> <ws:listsGUIDs>66af9900-7dd7-4cca-9125-beadaf3a3a59;0e591119-xxxx-yyyy-zzzz-6ac75384b564</ws:listsGUIDs> <ws:groupsIDs>;</ws:groupsIDs> |
Add recipients to multiple lists (one group per list)
In this example, we specify both the example values are provided for both listsIDs
and the listsGUIDs
parameters (mandatory fields). Each Each of the parameters must have the same number of elements (separated by semi-colons). In this case, we are also specifying group 22 for list 1, and group 13 for list 2.
Code Block | ||||
---|---|---|---|---|
| ||||
<ws:listsIDs>1;2</ws:listsIDs> <ws:listsGUIDs>66af9900-7dd7-4cca-9125-beadaf3a3a59;0e591119-xxxx-yyyy-zzzz-6ac75384b564</ws:listsGUIDs> <ws:groupsIDs>22;13</ws:groupsIDs> |
Add recipients to multiple lists (multiple groups)
In this example, we specify both the example values are provided for both listsIDs
and the listsGUIDs
parameters (mandatory fields). The The first list (ID=1) has two groups (22,23), so we use a comma to separate them in the first element. We then use a semi-colon to denote the second element, since the groupsIDs, listsIDs and listsGUIDs parameters must all have the same number of elements
...
The XML structure for each recipient needs to be consistent for all subscribers, and include empty tags for required values that are empty. When specifying the phone number for a recipient, the structure of your XML must match the mobileInputType
parameter, where either the entire phone number is represented in a single attribute, or the prefix and number are represented in separate attributes.
For example, if the mobileInputType
parameter is set to 1
,use the following XML structure:
Code Block | ||
---|---|---|
| ||
<!--Option 1: number and prefix in a single field (use mobileInputType=1)--> <subscriber email="user@myprovider.com" Prefix="" Number="+0018889624587" Name=""> |
If the mobileInputType
parameter is set to 2
, use the following XML structure:
Code Block | ||
---|---|---|
| ||
<!--Option 2: number and prefix in separate fields (use mobileInputType=2)--> <subscriber email="user@myprovider.com" Prefix="+001" Number="8889624587" Name=""> |
In case you also need to specify personal data fields an example is provided below
Note |
---|
|
Code Block | ||||
---|---|---|---|---|
| ||||
<subscribers> <subscriber email="mike@example.com" Prefix="" Number="" Name=""> <campo1>Mike</campo1> <campo2>Brown</campo2> <campo3>Example Company</campo3> <campo4>Los Angeles</campo4> <campo5> </campo5> <campo6>90125</campo6> <campo7>CA</campo7> <campo8>US</campo8> <campo9>555 Some Street</campo9> <campo10></campo10> <campo11>555-123-1234</campo11> </subscriber> <!-- repeat for each recipient to import --> </subscribers> |
You can use 0
and 1
in place of true
and false for boolean parameter values.
Note | ||
---|---|---|
| ||
All field values are handled as strings, character '|' (pipe) is not allowed and may lead to "-402" error codes |
...
Code Block | ||||
---|---|---|---|---|
| ||||
<?php class MailUpWsImport { protected $ns = "http://ws.mailupnet.it/"; //replace <console host name> with the host name of your console protected $WSDLUrl = "http://<console host name>/services/WSMailUpImport.asmx?WSDL"; protected $headers = array("User" => "user", "Password" => "password"); protected $rCode; private $soapClient; private $xmlResponse; protected $domResult; function __construct() { $this->header = new SOAPHeader($this->ns, "Authentication", $this->headers); $this->soapClient = new SoapClient($this->WSDLUrl,array("trace" => 1,"exceptions" => 0)); $this->soapClient->__setSoapHeaders($this->header); } function __destruct() { unset($this->soapClient); } //... public function startImportProcesses($processData) { try { echo $processData."<br/><br/>"; $this->soapClient->StartImportProcesses($processData); } catch (SoapFault $soapFault) { var_dump($soapFault); } } //... } $WsImport = new MailUpWsImport(); $xmlData = <<<EOT <subscribers><subscriber email="test@example.com" Prefix="+39" Number="3351234567" Name="Test"> <campo1>Luigi</campo1><campo2>Rossi</campo2><campo3>Rossi consulting</campo3><campo4>Parma2</campo4><campo5>PR</campo5> <campo6>43102</campo6><campo7></campo7><campo8>ITA</campo8><campo9>Via Garibaldi, 1</campo9><campo10>0521123456</campo10> <campo11>0521123457</campo11></subscriber></subscribers> EOT; $startImportProcessData = array( "listsIDs" => "4", "listsGUIDs" => "3c5cb08c-f0b5-4bd6-9c2a-b687ecdac8b4", "xmlDoc" => $xmlData, "groupsIDs" => "22", "importType" => "3", "mobileInputType" => "2", "asPending" => '0', "ConfirmEmail" => "0", "asOptOut" => "0", "forceOptIn" => "0", "replaceGroups" => "0" ); $WsImport->startImportProcesses($startImportProcessData); ?> |
C#
Code Block | ||
---|---|---|
| ||
WSMailUpImport toTest = new WSMailUpImport(); Authentication auth = new Authentication(); auth.User = tbLoginUserImport.Text; auth.Password = tbLoginPasswordImport.Text; auth.encType = string.Empty; toTest.AuthenticationValue = auth; string xmlString = "<subscribers><subscriber email=\"mike@example.com\" Prefix=\"\" Number=\"\" Name=\"\"><campo1>Mike</campo1><campo2>Brown</campo2><campo3>Example Company</campo3><campo4>Los Angeles</campo4><campo5></campo5><campo6>90125</campo6><campo7>CA</campo7><campo8>US</campo8><campo9>555 Some Street</campo9><campo10></campo10><campo11>555-123-1234</campo11></subscriber></subscribers>"; string myListId = "8"; string myListGuid = "CC9C4CBD-567B-4248-B56F-7C8364F11C5"; string myGroupsIDs = "45"; int importType = 3; int mobileInputType = 2; bool asPending = false; bool ConfirmEmail = false; bool asOptOut = false; bool forceOptIn = false; bool replaceGroups = false; string retVal = toTest.StartImportProcesses(myListId ,myListGuid, xmlString, myGroupsIDs, importType, mobileInputType, asPending , ConfirmEmail, asOptOut, forceOptIn, replaceGroups); |
...