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".
...
public string StartImportProcesses(string listsIDs, string listsGUIDs, string xmlDoc, string groupsIDs, int importType, int mobileInputType, bool asPending, bool ConfirmEmail, bool asOptOut, bool forceOptIn, bool replaceGroups)
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) are written in in blue.
...
Code examples
Ruby Example
Code Block | ||
---|---|---|
| ||
# Refer to https://mailup.atlassian.net/wiki/display/mailupapi/MailUp+RubyGem for gem information. require 'mailup' m = MailUp::Import.new('username', 'password', 'console_url') m.start_import_processes(:idListlistsIDs => 123456"1;2;3, :listGuidlistsGUIDs => 123456"abc123;def456;ghi789, :xmlDoc => "XML_STRING", ...) # => <?xml version=\"1.0\" encoding=\"windows-1252\" ?><mailupMessage><mailupBody><ReturnCode>0</ReturnCode><processes>...</processes></mailupBody></mailupMessage> |
PHP Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?php // The sample code described herein is provided on an "as is" basis, without warranty of any kind. // MailUp shall not be liable for any direct, indirect or consequential damages or costs of any type arising out of any action taken by you or others related to the sample code. 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); ?> |
...