Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

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".

...

Note

An HTTP 500 Error is returned if optional parameters are included in the request with an empty value (Ex: <asOptOut /> or <asOptOut></asOptOut>)

Tip
titleBest practices
  1. Method call fails when another import process is running. You can use GetProcessDetails method to check if a previously started process is still running
  2. Method response contains either a global ReturnCode or a specific ReturnCode for each import process that has been started by this method. Call is successful only when all ReturnCodes are equal to "0"
  3. There is not a known size limit for xmlDoc field: it has been successfully tested with 1.2 million characters (in this case return value is quite immediate but the whole import process could take several minutes and other import requests will be denied during this period)
  4. When using cloud services it can happen that your application must respect a size limit in API calls that is lower than the size of the XML that you would pass as xmlDoc parameter. In this case you can split your import data, call several times NewImportProccess with smaller recipient lists and then use StartImportProcesses to sequentially start all previously created import processes.

Lists and Groups

You must specify at least one of the 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.

...

Code Block
languagehtml/xml
linenumberstrue
<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 listsIDs and the listsGUIDs parameters. Each of the parameters must have the same number of elements (separated by semi-colons). In this case, we are specifying group 22 for list 1, and group 13 for list 2.

Code Block
languagehtml/xml
linenumberstrue
<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>

...