Versions Compared

Key

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

...

Table of Contents
maxLevel3
typeflat

...

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.

OperationDescription
1Working with Leads in MarketogetLeadByIdRetrieves a lead for a given Marketo Id.
1Working with Leads in MarketogetMultipleLeadsByFilterTypeRetrieves multiple leads for given search criteria.
1Working with Leads in MarketogetMultipleLeadsByListIdRetrieves multiple leads from a list with the given list id.
1Working with Leads in MarketocreateAndUpdateLeadsCreates a new lead or Updates an existing lead.
1Working with Leads in MarketoassociateLeadAssociates a lead with a cookie value.
1Working with Leads in MarketomergeLeadMerges two leads(Losing lead with winning lead).
1Working with Leads in MarketogetLeadPartitionsRetrieves a list of lead partitions in a Marketo instance.1Working with Leads in Marketo
getMultipleLeadsByProgramIdRetrieves multiple leads from a given program id.
1Working with Leads in MarketodeleteLeadDeletes leads with the given ids.
1Working with Leads in MarketodescribeRetrieves all fields and the data type of a lead object.
1Working with Leads in MarketoimportLeadImports leads in bulk.1Working with Leads in Marketo
getImportLeadStatusRetrieves the status of lead operation from ImportLead call.
1Working with Leads in MarketogetImportFailureFileRetrieves of the failure file from a ImportLead Call.
1Working with Leads in MarketogetImportWarningFileRetrieves of the warning file from a ImportLead Call.

Operation Details

This section provides further details on the operations related to leads.

Anchor
getLeadById
getLeadById
Get Lead by Id

The getLeadById operation retrieves a lead for a given Marketo Id.

Code Block
languagexml
titlegetLeadById
<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.

Anchor
getLeadById
getLeadById
Sample request

Following is a sample REST/JSON request that can be handled by the getLeadById operation.

Code Block
languagexml
titleSample request for getLeadById
{
    "marketoInstanceURL":"https://Abc-def-029.mktorest.com",
    "clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
    "clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
  	"leadId":"11",
  	"fields":"lastName,email"
}
Related Marketo documentation

http://developers.marketo.com/documentation/rest/get-lead-by-id/

Anchor
getMultipleLeadsByFilterType
getMultipleLeadsByFilterType
Get Multiple Leads By Filter Type

The getMultipleLeadsByFilterType operation retrieves multiple leads for given search criteria.

Code Block
languagexml
titlegetMultipleLeadsByFilterType
<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
languagexml
titleSample 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"
}
Related Marketo documentation

http://developers.marketo.com/documentation/rest/get-multiple-leads-by-filter-type/

Anchor
getMultipleLeadsByListId
getMultipleLeadsByListId
Get Multiple Leads by List Id

The  getMultipleLeadsByListId operation retrieves multiple leads from a given list id.

Code Block
languagexml
titlegetMultipleLeadsByListId
<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
languagexml
titleSample 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===="
}
Related Marketo documentation

http://developers.marketo.com/documentation/rest/get-multiple-leads-by-list-id/

Anchor
createAndUpdateLeads
createAndUpdateLeads
Create and Update Leads

The  createAndUpdateLeads creates a new lead or updates an existing lead. 

Code Block
languagexml
titlecreateAndUpdateLeads
<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
languagexml
titleSample 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"
      }
   ]
}
Related Marketo documentation

http://developers.marketo.com/documentation/rest/createupdate-leads/

Anchor
associateLead
associateLead
Associate Lead

The associateLead operation associates a lead with a cookie value.

Code Block
languagexml
titleassociateLead
<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
languagexml
titleSample 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"
}
Related Marketo documentation

Anchor
mergeLead
mergeLead
Merge Lead

The mergeLead operation merges two leads(merges losing lead with winning lead).

Code Block
languagexml
titlemergeLead
<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
languagexml
titleSample request for mergeLead
{
    "marketoInstanceURL":"https://Abc-def-029.mktorest.com",
    "clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
    "clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
  	"wLeadId":"388",
 	"lLeadId":"387"
}
Related Marketo documentation

Anchor
getLeadPartitions
getLeadPartitions
Get Lead Partitions

The getLeadPartitions operation retrieves a list of lead partitions in a Marketo instance.

Code Block
languagexml
titlegetLeadPartitions
<marketo.getLeadPartitions/>
Sample request

Following is a sample REST/JSON request that can be handled by the getLeadPartitions operation.

Code Block
languagexml
titleSample request for getLeadPartitions
{
    "marketoInstanceURL":"https://Abc-def-029.mktorest.com",
    "clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
    "clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1"
}
Related Marketo documentation

Anchor
getMultipleLeadsByProgramId
getMultipleLeadsByProgramId
getMultipleLeadsByProgramId

The getMultipleLeadsByProgramId operation retrieves multiple leads from a given program id.

Code Block
languagexml
titlegetMultipleLeadsByProgramId
<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
languagexml
titleSample 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===="
}
Related Marketo documentation

Anchor
deleteLead
deleteLead
Delete Lead

The deleteLead operation deletes leads with the given ids.

Code Block
languagexml
titledeleteLead
<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
languagexml
titleSample request for deleteLead
{
    "marketoInstanceURL":"https://Abc-def-029.mktorest.com",
    "clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
    "clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
    "leadIds":"390,392,398"
}
Related Marketo documentation

Anchor
describe
describe
Describe

The describe operation retrieves all fields and the data type of a lead object.

Code Block
languagexml
titledescribe
<marketo.describe/>
Sample request

Following is a sample REST/JSON request that can be handled by the describe operation.

Code Block
languagexml
titleSample request for describe
{
    "marketoInstanceURL":"https://Abc-def-029.mktorest.com",
    "clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
    "clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1"
}
Related Marketo documentation

Anchor
importLead
importLead
Import Lead

The importLead operation imports leads in bulk.

Code Block
languagexml
titleimportLead
<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.

Anchor
importLead
importLead
Sample request

Following is a sample REST/JSON request that can be handled by the importLead operation.

Code Block
languagexml
titleSample 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
Related Marketo documentation

http://developers.marketo.com/documentation/rest/import-lead/

Anchor
getImportLeadStatus
getImportLeadStatus
Get Import Lead Status

The getImportLeadStatus operation retrieves the status of lead operation from ImportLead API call.

Code Block
languagexml
titlegetImportLeadStatus
<marketo.getImportLeadStatus>
    <batchId>{$ctx:batchId}</batchId>
</marketo.getImportLeadStatus>
properties
  • batchId: Batch id returned from importLead call.
Anchor
getImportLeadStatus
getImportLeadStatus
Sample request

Following is a sample REST/JSON request that can be handled by the getImportLeadStatus operation.

Code Block
languagexml
titleSample request for getImportLeadStatus
{
    "marketoInstanceURL":"https://Abc-def-029.mktorest.com",
    "clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
    "clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
    "batchId":"7"
}
Related Marketo documentation

http://developers.marketo.com/documentation/rest/get-import-lead-status/

Anchor
getImportFailureFile
getImportFailureFile
Get Import Failure File

The getImportFailureFile operation retrieves of the failure file from a ImportLead Call.

Code Block
languagexml
titlegetImportFailureFile
<marketo.getImportFailureFile>
                <batchId>{$ctx:batchId}</batchId>
</marketo.getImportFailureFile>
properties
  • batchId: Batch id returned from importLead call.

Anchor
getImportFailureFile
getImportFailureFile
Sample request

Following is a sample REST/JSON request that can be handled by the getImportFailureFile operation.

Code Block
languagexml
titleSample request for getImportFailureFile
{
    "marketoInstanceURL":"https://Abc-def-029.mktorest.com",
    "clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
    "clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
    "batchId":"30"
}
Related Marketo documentation

http://developers.marketo.com/documentation/rest/get-import-failure-file/

Anchor
getImportWarningFile
getImportWarningFile
Get Import Warning File

The getImportWarningFile operation retrieves of the failure file from a ImportLead Call.

Code Block
languagexml
titlegetImportWarningFile
<marketo.getImportWarningFile>
                <batchId>{$ctx:batchId}</batchId>
</marketo.getImportWarningFile>
properties
  • batchId: Batch id returned from importLead call.

Anchor
getImportWarningFile
getImportWarningFile
Sample request

Following is a sample REST/JSON request that can be handled by the getImportWarningFile operation.

Code Block
languagexml
titleSample request for getImportWarningFile
{
    "marketoInstanceURL":"https://Abc-def-029.mktorest.com",
    "clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
    "clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
    "batchId":"30"
}
Related Marketo documentation

http://developers.marketo.com/documentation/rest/get-import-warning-file/

Anchor
sampleProxyLeads
sampleProxyLeads
Sample Configuration

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

...