importToList

This function lets you import a list of leads into an existing Static List in Marketo, similar to the import list function in the Marketo UI.

Import Format: These values are identical to the structure of a CSV used in a list import.

Example:

Email

First

Last

joe@company.com Joe Smith
mary@company.com Mary Rodgers
wanda@megacorp.com Wanda Williams

Note: displayName values should be used in the importFileHeader rather than the name values.

Dynamic Email Content: Optionally, you can pass values on a per lead basis that act as replacements for My Tokens in an email.

Email

First

Last

{{my.specialToken}}

{{my.otherToken}}

joe@company.com Joe Smith Fish Blue
mary@company.com Mary Rodgers Chicken Brown
wanda@megacorp.com Wanda Williams Veggie Hazel

Important: If you add in tokens for the leads, you must specify the Smart Campaign that will use them. The next time the specified Smart Campaign runs, it will use the values from your list, instead of the normal My Token values. After that single Campaign runs, the tokens will be discarded.

NOTE: importToList can take time to complete, particularly for large lists. If you plan to use the newly imported list in other API calls, you should use importToListStatus to check that the operation is complete.

Request

Field Name

Required/Optional

Description

programName Required Name of the program containing the static list
campaignName Optional If using My Token overrides, this is the name of the campaign where those tokens will be used. The campaign must be within the program specified.
listName Required Name of the static list in Marketo which leads will be added to
importFileHeader Required Column headers for the leads to be imported, including lead attribute and my token names.
importFileRows->stringItem Required Comma separated values, with one row per lead
importListMode Required Valid options: UPSERTLEADS and LISTONLY

UPSERTLEADS to create or update leads and add them to a static list

LISTONLY to add existing leads to a static list, skipping new leads. Note: Add to List activities are not logged for leads added using this mode.

clearList Optional If true the static list is cleared before the import. If false leads are appended.

Request XML

Response XML

Sample Code – PHP

Sample Code – Java

Sample Code – Ruby