Create an Import Definition
This page contains information about creating an import definition.
You can create an import definition to move information from your system or development environment to Marketing Cloud
This example demonstrates creating an ImportDefinition object. Use the example as an example to create your own API call. You must create the FileTransferActivity in Marketing Cloud. Supply only the parameters to change when updating an ImportDefinition object.
Sample .NET Code
Output
Sample .NET Code - Create an Import Definition using Manual Mapping
Create and Perform an Import Definition
Use the DataFormattingLocale property to specify how dates are formatted in import data. The Marketing Cloud application uses this information to ensure the data is interpreted correctly when it is being loaded. For example, you can use DateFormattingLocale to determine whether '01-09-2010' means January 9th, 2010 or September 1st, 2010. If no LocaleCode is supplied, the call defaults to "en-US".
This sample code shows how to set the value for DateFormattingLocale for Create and Update methods:
Sample Java Code (Axis 1.4)
This sample code creates an import definition and associates it with a specific data extension.
Sample PHP Code
Create an Import Definition
Sample Ruby on Rails Code
SOAP Request For Import Definiton Creation
The envelope below infers mapping from column headings:
The envelope below maps fields via ordinals:
SOAP Response For Import Definiton Creation
The API returns a response like this for inferred field mappings:
How to Start the Import Definition
After starting the import definition, the system returns "TaskResultID," capture the "TaskResultID" and check against the system to verify if import is completed or not.