...
...
Overview
The following operations allow you to work with leads. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with leads, see Sample configuration.
Operation Details
This section provides further details on the operations related to leads.
Get Lead by IdThe getLeadById
operation retrieves a lead for a given Marketo Id.
Code Block |
---|
language | xml |
---|
title | getLeadById |
---|
|
<marketo.getLeadById>
<leadId>{$ctx:leadId}</leadId>
<fields>{$ctx:fields}</fields>
</marketo.getLeadById> |
properties
leadId
: The Marketo Id of the lead.
fields
: List of fields to be returned in response.
Sample requestFollowing is a sample REST/JSON request that can be handled by the getLeadById
operation.
Code Block |
---|
language | xml |
---|
title | Sample request for getLeadById |
---|
|
{
"marketoInstanceURL":"https://Abc-def-029.mktorest.com",
"clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
"clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
"leadId":"11",
"fields":"lastName,email"
} |
http://developers.marketo.com/documentation/rest/get-lead-by-id/
Anchor |
---|
| getMultipleLeadsByFilterType |
---|
| getMultipleLeadsByFilterType |
---|
|
Get Multiple Leads By Filter TypeThe getMultipleLeadsByFilterType
operation retrieves multiple leads for given search criteria.
Code Block |
---|
language | xml |
---|
title | getMultipleLeadsByFilterType |
---|
|
<marketo.getMultipleLeadsByFilterType>
<filterType>{$ctx:filterType}</filterType>
<filterValues>{$ctx:filterValues}</filterValues>
<fields>{$ctx:fields}</fields>
<batchSize>{$ctx:batchSize}</batchSize>
<nextPageToken>{$ctx:nextPageToken}</nextPageToken>
</marketo.getMultipleLeadsByFilterType> |
properties
filterType
: Filter type to retrieve the leads.
filterValues
: Comma separated list of filter values.
fields
: Comma separated list of fields to be returned in response.
batchSize
: The number of lead records to be returned in a single call.
nextPageToken
: Used to paginate through large result sets.
Sample Request
Following is a sample REST/JSON request that can be handled by the getMultipleLeadsByFilterType
operation.
Code Block |
---|
language | xml |
---|
title | Sample request for getMultipleLeadsByFilterType |
---|
|
{
"marketoInstanceURL":"https://Abc-def-029.mktorest.com",
"clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
"clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
"filterType":"id",
"filterValues":"387,390,393,398,399",
"fields":"lastName,firstName",
"batchSize":"3"
} |
http://developers.marketo.com/documentation/rest/get-multiple-leads-by-filter-type/
Anchor |
---|
| getMultipleLeadsByListId |
---|
| getMultipleLeadsByListId |
---|
|
Get Multiple Leads by List IdThe getMultipleLeadsByListId
operation retrieves multiple leads from a given list id.
Code Block |
---|
language | xml |
---|
title | getMultipleLeadsByListId |
---|
|
<marketo.getMultipleLeadsByListId>
<listId>{$ctx:listId}</listId>
<fields>{$ctx:fields}</fields>
<batchSize>{$ctx:batchSize}</batchSize>
<nextPageToken>{$ctx:nextPageToken}</nextPageToken>
</marketo.getMultipleLeadsByListId> |
properties
listId
: ID of the list.
fields
: List of fields to be returned in response.
batchSize
: The number of lead records to be returned in a single call.
nextPageToken
: Used to paginate through large result sets.
Sample Request
Following is a sample REST/JSON request that can be handled by the getMultipleLeadsByListId
operation.
Code Block |
---|
language | xml |
---|
title | Sample request for getMultipleLeadsByListId |
---|
|
{
"marketoInstanceURL":"https://Abc-def-029.mktorest.com",
"clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
"clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
"listId":"3",
"fields":"lastName",
"batchSize":"1",
"nextPageToken": "PS5VL5WD4UOWGOUCJR6VY7JQOZTXMC7UO74OEIV2HN4NCJZW32AA===="
} |
http://developers.marketo.com/documentation/rest/get-multiple-leads-by-list-id/
Anchor |
---|
| createAndUpdateLeads |
---|
| createAndUpdateLeads |
---|
|
Create and Update LeadsThe createAndUpdateLeads
creates a new lead or updates an existing lead.
Code Block |
---|
language | xml |
---|
title | createAndUpdateLeads |
---|
|
<marketo.createAndUpdateLeads>
<input>{$ctx:input}</input>
<action>{$ctx:action}</action>
<lookupField>{$ctx:lookupField}</lookupField>
<asyncProcessing>{$ctx:asyncProcessing}</asyncProcessing>
<partitionName>{$ctx:partitionName}</partitionName>
</marketo.createAndUpdateLeads> |
properties
input
: Array of lead records to create or update.
action
: The action need to be taken with this call.Possible values(createOnly,updateOnly,createOrUpdate(default request),createDuplicate)
lookupField
: Attribute to find the duplicate.
asyncProcessing
: Used to specify post processing when calling the creating/updating leads.
partitionName
: Lead partition name.
Sample request
Following is a sample REST/JSON request that can be handled by the createAndUpdateLeads
operation.
Code Block |
---|
language | xml |
---|
title | Sample request for createAndUpdateLeads |
---|
|
{
"marketoInstanceURL":"https://Abc-def-029.mktorest.com",
"clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
"clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
"action":"updateOnly",
"lookupField":"email",
"partitionName":"default",
"asyncProcessing":"true",
"input":[
{
"email":"con-5@gmail.com",
"firstName":"con-1",
"postalCode":"04828"
},
{
"email":"con-4@gmail.com",
"firstName":"con-2",
"postalCode":"04828"
},
{
"email":"con-3@gmail.com",
"firstName":"con-3",
"postalCode":"04828"
}
]
} |
http://developers.marketo.com/documentation/rest/createupdate-leads/
Anchor |
---|
| associateLead |
---|
| associateLead |
---|
|
Associate LeadThe associateLead
operation associates a lead with a cookie value.
Code Block |
---|
language | xml |
---|
title | associateLead |
---|
|
<marketo.associateLead>
<leadId>{$ctx:leadId}</leadId>
<cookie>{$ctx:cookie}</cookie>
</marketo.associateLead> |
properties
leadId: The Marketo Id of the lead.
cookie: Cookie value of lead.
Sample request
Following is a sample REST/JSON request that can be handled by the associateLead
operation.
Code Block |
---|
language | xml |
---|
title | Sample request for associateLead |
---|
|
{
"marketoInstanceURL":"https://Abc-def-029.mktorest.com",
"clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
"clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
"leadId":"392",
"cookie":"id:287-GTJ-838%26token:_mch-marketo.com-1396310362214-46169"
} |
Merge LeadThe mergeLead
operation merges two leads(merges losing lead with winning lead).
Code Block |
---|
language | xml |
---|
title | mergeLead |
---|
|
<marketo.mergeLead>
<wLeadId>{$ctx:wLeadId}</wLeadId>
<lLeadId>{$ctx:lLeadId}</lLeadId>
<mergeInCRM>{$ctx:mergeInCRM}</mergeInCRM>
</marketo.mergeLead> |
properties
wLeadId: The Marketo Id of the winning lead.
lLeadId: The Marketo Id of the lead(losing) to be merged.
mergeInCRM: Set to true to merge in CRM.
Sample request
Following is a sample REST/JSON request that can be handled by the mergeLead
operation.
Code Block |
---|
language | xml |
---|
title | Sample request for mergeLead |
---|
|
{
"marketoInstanceURL":"https://Abc-def-029.mktorest.com",
"clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
"clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
"wLeadId":"388",
"lLeadId":"387"
} |
Anchor |
---|
| getLeadPartitions |
---|
| getLeadPartitions |
---|
|
Get Lead PartitionsThe getLeadPartitions
operation retrieves a list of lead partitions in a Marketo instance.
Code Block |
---|
language | xml |
---|
title | getLeadPartitions |
---|
|
<marketo.getLeadPartitions/> |
Sample request
Following is a sample REST/JSON request that can be handled by the getLeadPartitions
operation.
Code Block |
---|
language | xml |
---|
title | Sample request for getLeadPartitions |
---|
|
{
"marketoInstanceURL":"https://Abc-def-029.mktorest.com",
"clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
"clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1"
} |
Anchor |
---|
| getMultipleLeadsByProgramId |
---|
| getMultipleLeadsByProgramId |
---|
|
getMultipleLeadsByProgramIdThe getMultipleLeadsByProgramId
operation retrieves multiple leads from a given program id.
Code Block |
---|
language | xml |
---|
title | getMultipleLeadsByProgramId |
---|
|
<marketo.getMultipleLeadsByProgramId>
<programId>{$ctx:programId}</programId>
<fields>{$ctx:fields}</fields>
<batchSize>{$ctx:batchSize}</batchSize>
<nextPageToken>{$ctx:nextPageToken}</nextPageToken>
</marketo.getMultipleLeadsByProgramId> |
properties
programId: The Marketo Id of the program.
fields: List of fields to be returned in response.
batchSize
: The number of lead records to be returned in a single call.
nextPageToken
: Used to paginate through large result sets.
Sample request
Following is a sample REST/JSON request that can be handled by the getMultipleLeadsByProgramId
operation.
Code Block |
---|
language | xml |
---|
title | Sample request for getMultipleLeadsByProgramId |
---|
|
{
"marketoInstanceURL":"https://Abc-def-029.mktorest.com",
"clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
"clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
"programId":"1003",
"fields":"lastName,email",
"batchSize":"5",
"nextPageToken": "PS5VL5WD4UOWGOUCJR6VY7JQOZTXMC7UO74OEIV2HN4NCJZW32AA===="
} |
Delete LeadThe deleteLead
operation deletes leads with the given ids.
Code Block |
---|
language | xml |
---|
title | deleteLead |
---|
|
<marketo.deleteLead>
<leadIds>{$ctx:leadIds}</leadIds>
</marketo.deleteLead> |
properties
leadIds: Comma separated list of leads ids.
Sample request
Following is a sample REST/JSON request that can be handled by the deleteLead
operation.
Code Block |
---|
language | xml |
---|
title | Sample request for deleteLead |
---|
|
{
"marketoInstanceURL":"https://Abc-def-029.mktorest.com",
"clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
"clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
"leadIds":"390,392,398"
} |
DescribeThe describe
operation retrieves all fields and the data type of a lead object.
Code Block |
---|
|
<marketo.describe/> |
Sample request
Following is a sample REST/JSON request that can be handled by the describe
operation.
Code Block |
---|
language | xml |
---|
title | Sample request for describe |
---|
|
{
"marketoInstanceURL":"https://Abc-def-029.mktorest.com",
"clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
"clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1"
} |
Import LeadThe importLead
operation imports leads in bulk.
Code Block |
---|
language | xml |
---|
title | importLead |
---|
|
<marketo.import>
<marketoInstanceURL>{$url:marketoInstanceURL}</marketoInstanceURL>
<accessToken>{$url:accessToken}</accessToken>
<format>{$url:format}</format>
<lookupField>{$url:lookupField}</lookupField>
<listId>{$url:listId}</listId>
<partitionName>{$url:partitionName}</partitionName>
</marketo.import> |
properties
marketoInstanceURL
: Your marketo instance URL.
accessToken
: Valid access_token.
format
: Format of the file to be imported.
listId
: Marketo Id of the list.
lookupField
: Attribute to find the duplicate.
partitionName
: Lead partition name.
Sample requestFollowing is a sample REST/JSON request that can be handled by the importLead
operation.
Code Block |
---|
language | xml |
---|
title | Sample request for importLead |
---|
|
curl -i -F format=csv -F file=@leads.csv -F access_token=919340b7-2e08-427d-a3cc-67e34b5647bd:sj https://Abc-def-029.mktorest.com/bulk/v1/leads.json |
http://developers.marketo.com/documentation/rest/import-lead/
Anchor |
---|
| getImportLeadStatus |
---|
| getImportLeadStatus |
---|
|
Get Import Lead StatusThe getImportLeadStatus operation retrieves the status of lead operation from ImportLead API call.
Code Block |
---|
language | xml |
---|
title | getImportLeadStatus |
---|
|
<marketo.getImportLeadStatus>
<batchId>{$ctx:batchId}</batchId>
</marketo.getImportLeadStatus> |
properties
batchId: Batch id returned from importLead call.
Anchor |
---|
| getImportLeadStatus |
---|
| getImportLeadStatus |
---|
|
Sample requestFollowing is a sample REST/JSON request that can be handled by the getImportLeadStatus operation.
Code Block |
---|
language | xml |
---|
title | Sample request for getImportLeadStatus |
---|
|
{
"marketoInstanceURL":"https://Abc-def-029.mktorest.com",
"clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
"clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
"batchId":"7"
} |
http://developers.marketo.com/documentation/rest/get-import-lead-status/
Anchor |
---|
| getImportFailureFile |
---|
| getImportFailureFile |
---|
|
Get Import Failure FileThe getImportFailureFile
operation retrieves of the failure file from a ImportLead Call.
Code Block |
---|
language | xml |
---|
title | getImportFailureFile |
---|
|
<marketo.getImportFailureFile>
<batchId>{$ctx:batchId}</batchId>
</marketo.getImportFailureFile> |
properties
batchId
: Batch id returned from importLead call.
Anchor |
---|
| getImportFailureFile |
---|
| getImportFailureFile |
---|
|
Sample requestFollowing is a sample REST/JSON request that can be handled by the getImportFailureFile
operation.
Code Block |
---|
language | xml |
---|
title | Sample request for getImportFailureFile |
---|
|
{
"marketoInstanceURL":"https://Abc-def-029.mktorest.com",
"clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
"clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
"batchId":"30"
} |
http://developers.marketo.com/documentation/rest/get-import-failure-file/
Anchor |
---|
| getImportWarningFile |
---|
| getImportWarningFile |
---|
|
Get Import Warning FileThe getImportWarningFile
operation retrieves of the failure file from a ImportLead Call.
Code Block |
---|
language | xml |
---|
title | getImportWarningFile |
---|
|
<marketo.getImportWarningFile>
<batchId>{$ctx:batchId}</batchId>
</marketo.getImportWarningFile> |
properties
batchId
: Batch id returned from importLead call.
Anchor |
---|
| getImportWarningFile |
---|
| getImportWarningFile |
---|
|
Sample requestFollowing is a sample REST/JSON request that can be handled by the getImportWarningFile
operation.
Code Block |
---|
language | xml |
---|
title | Sample request for getImportWarningFile |
---|
|
{
"marketoInstanceURL":"https://Abc-def-029.mktorest.com",
"clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
"clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
"batchId":"30"
} |
http://developers.marketo.com/documentation/rest/get-import-warning-file/
Anchor |
---|
| sampleProxyLeads |
---|
| sampleProxyLeads |
---|
|
Sample ConfigurationFollowing is a sample proxy service that illustrates how to connect to Marketo with the init operation and use the getLeadById
operation. The sample request for this proxy can be found in getLeadById sample request. You can use this sample as a template for using other operations in this category.
...