Import (IMPORT.SVC)

Introduction

This provides bulk import access for contacts. Contacts are imported from an FTP site from a CSV file. The CSV file should have a header row defining what data each column contains. See example below.

Sample CSV File
							
Email,Firstname,LastName
rsmith@gmail.com,Richard,Smith

The service provides the following options:

  • ExecuteFtpImport: This combines the update and add operations into one service call
  • GetImportStatus: Update contact records

Example Service: http://newsletter.ie/wcf/Import.svc

EXECUTEFTPIMPORT

Download file and import contact list.

Parameters
Parameter Description Type
Token String returned from login request. String
Import Request Import Request Object Object
 
Import Data: Import Information Object
- Name: Import name must not be > 16 characters long. Should only contain characters a-z and 0 to 9. String
- Description: Import description String
- QuoteChar: Quote character if specified in file. Default: " String
- ClearCrossXRef: Clear previous records imported String
- ExecuteImport: Execute the import when ready String
 
FTPConfiguration: FTP site login details Object
- FTPSite: FTP Address String
- FTPUser: FTP User Name String
- FTPPwd: FTP Password String
- FTPSecure: Secure FTP (SFTP). Default is False. Bool
- FTPFileName: CSV Filename String
- DeleteFileAfterImport: Delete CSV File after import. Default is false. Bool.
 
ImportMap Mapping between CSV file and email system. This maps the CSV file heading to internal field name in email system Array
- FromField: Column heading in CSV file String
- ToField: The field in the email system String
Sample
							
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<ExecuteFTPImport xmlns="http://wcf.spinnakerpro.net/1.0">
<Token>e6a043f5-35fd-42da-8378-3f2921c33e9a</Token>
<Import xmlns:a="urn:spinnakerpro.com" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:ImportDefinition>
<a:ClearCrossXRef>false</a:ClearCrossXRef>
<a:Description>My Descrption1</a:Description>
<a:ExecuteImport>true</a:ExecuteImport>
<a:FTPConfiguration xmlns:b="http://schemas.datacontract.org/2004/07/NT.WCF.Service.ReqRes.Import">
<b:DeleteFileAfterImport>false</b:DeleteFileAfterImport>
<b:FTPFileEncoding i:nil="true"/>
<b:FTPFileName>subscribers.txt</b:FTPFileName>
<b:FTPPwd>xxxxxx</b:FTPPwd>
<b:FTPSecure>false</b:FTPSecure>
<b:FTPSite>ftp.xxxxx.net</b:FTPSite>
<b:FTPUser>xxxxxxx</b:FTPUser>
</a:FTPConfiguration>
<a:FieldMap>
<a:ImportFieldMap>
<a:FromField>fn</a:FromField>
<a:ToField>firstname</a:ToField>
<a:ToMacro i:nil="true"/>
</a:ImportFieldMap>
<a:ImportFieldMap>
<a:FromField>ln</a:FromField>
<a:ToField>lastname</a:ToField>
<a:ToMacro i:nil="true"/>
</a:ImportFieldMap>
<a:ImportFieldMap>
<a:FromField>email</a:FromField>
<a:ToField>personalemail</a:ToField>
<a:ToMacro i:nil="true"/>
</a:ImportFieldMap>
</a:FieldMap>
<a:ImportName>MyImport2</a:ImportName>
<a:MapDefinition i:nil="true"/>
<a:QuoteChar>"</a:QuoteChar>
<a:Status>Waiting</a:Status>
</a:ImportDefinition>
<a:Options i:nil="true"/>
</Import>
</ExecuteFTPImport>
</s:Body>
</s:Envelope>
Output
  • UpdResponse (object)
    • Result (object see determine the success or failure of a service call)
    • ImportId (int) Import Id.

GETIMPORTSTATUS

Used to check if import has finished.

Parameters
Parameter Description Type
Token String returned from login request String
• ImportId ID of import to check Int
Sample
							
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetImportStatus xmlns="http://wcf.spinnakerpro.net/1.0">
<Token>e6a043f5-35fd-42da-8378-3f2921c33e9a</Token>
<ImportId>17</ImportId>
</GetImportStatus>
</s:Body>
</s:Envelope>
Output
  • GetImportStatusResponse (object)
    • Result (object - determine the success or failure of a service call)
    • Status (string) these status correlate to the status as seen when import is checked by logging in to the UI.

Is this something you could use?