This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Activities in Marketo



Overview

The following operations allow you to work with activities. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with activities, see Sample configuration.

OperationDescription
getActivityTypesRetrieves meta data about activity types.
getPagingTokenRetrieves a token for a given date.
getLeadActivitiesRetrieves lead activities for the requested activity types.
getLeadChangesRetrieves changed data value for leads.
getDeletedLeadsRetrieves a list of leads that were deleted.

Operation Details

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

Get Activity Types

The getActivityTypes operation retrieves meta data about activity types.

getActivityTypes
<marketo.getActivityTypes/>
Sample request

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

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

http://developers.marketo.com/documentation/rest/get-activity-types/

Get Paging Token

The getPagingToken operation retrieves a token for a given date.

getPagingToken
<marketo.getPagingToken>
    <sinceDatetime>{$ctx:sinceDatetime}</sinceDatetime>
</marketo.getPagingToken>
Properties
  • sinceDatetime: DateTime to retrieve page token.
Sample Request

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

Sample request for getPagingToken
{
    "marketoInstanceURL":"https://Abc-def-029.mktorest.com",
    "clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
    "clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",
    "sinceDatetime":"2015-03-04"
}
Related Marketo documentation

http://developers.marketo.com/documentation/rest/get-paging-token/

Get Lead Activities

The  getLeadActivities operation retrieves lead activities for the requested activity types.

getLeadActivities
<marketo.getLeadActivities>
    <listId>{$ctx:listId}</listId>
    <activityTypeIds>{$ctx:activityTypeIds}</activityTypeIds>
    <batchSize>{$ctx:batchSize}</batchSize>
    <nextPageToken>{$ctx:nextPageToken}</nextPageToken>
</marketo.getLeadActivities>
properties
  • activityTypeIds: Comma separated list of activity type ids.

  • nextPageToken : Used to paginate through large result sets.

  • listId : The Marketo list id.

  • batchSize : The number of records to be returned in a single call.

Sample Request

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

Sample request for getLeadActivities
{
    "marketoInstanceURL":"https://Abc-def-029.mktorest.com",
    "clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
    "clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",  
 	"activityTypeIds":"12,13",
  	"nextPageToken":"F5AGXQGUR6VT65MWYEZSMN745PSPGH7EIPW3FEP2TTUEL7MOIYFA====",
  	"listId":"4",
  	"batchSize":"3"
}
Related Marketo documentation

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

Get Lead Changes

The getLeadChanges retrieves change data value for leads.

getLeadChanges
<marketo.getLeadChanges>
    <listId>{$ctx:listId}</listId>
    <fields>{$ctx:fields}</fields>
    <batchSize>{$ctx:batchSize}</batchSize>
    <nextPageToken>{$ctx:nextPageToken}</nextPageToken>
</marketo.getLeadChanges>
properties
  • nextPageToken: Token from getPagingToken call.

  • fields : Comma separated list of field names.

  • listId : The Marketo list id.

  • batchSize : The number of records to be returned in a single call.

Sample request 

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

Sample request for getLeadChanges
{
    "marketoInstanceURL":"https://Abc-def-029.mktorest.com",
    "clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
    "clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",  
 	"nextPageToken": "F5AGXQGUR6VT65MWYEZSMN745PW3UFSYANODKG22OL42A4HTH2MA====",
  	"fields":"firstName",
  	"listId":"4",
  	"batchSize":"2"
}
Related Marketo documentation

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

Get Deleted Leads

The getDeletedLeads retrieves a list of leads that were deleted.

getDeletedLeads
<marketo.getDeletedLeads>
        <batchSize>{$ctx:batchSize}</batchSize>
        <nextPageToken>{$ctx:nextPageToken}</nextPageToken>
</marketo.getDeletedLeads>
properties
  • nextPageToken: Used to paginate through large result sets.

  • batchSize : The number of records to be returned in a single call.

Sample request 

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

Sample request for getDeletedLeads
{
    "marketoInstanceURL":"https://Abc-def-029.mktorest.com",
    "clientSecret":"Vgo6rzIiJyXXXXXXXP3Zr56tK2hv8fJd",
    "clientId":"01f22a42-0f05-4e7f-b675-550b6XXXXXXX1",  
 	"nextPageToken": "F5AGXQGUR6VT65MWYEZSMN745PW3UFSYANODKG22OL42A4HTH2MA====",
  	"batchSize":"2"
}
Related Marketo documentation

http://developers.marketo.com/documentation/rest/get-deleted-leads/

Sample Configuration

Following is a sample proxy service that illustrates how to connect to Marketo with the init operation and use the getDeletedLeads operation. The sample request for this proxy can be found in  getDeletedLeads sample request. You can use this sample as a template for using other operations in this category.

Sample proxy
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="getDeletedLeads"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
    <target>
        <inSequence>
            <property name="marketoInstanceURL" expression="json-eval($.marketoInstanceURL)"/>
            <property name="clientId" expression="json-eval($.clientId)"/>
            <property name="clientSecret" expression="json-eval($.clientSecret)"/>
            <property name="batchSize" expression="json-eval($.batchSize)"/>
            <property name="nextPageToken" expression="json-eval($.nextPageToken)"/>
            <marketo.init>
                <marketoInstanceURL>{$ctx:marketoInstanceURL}</marketoInstanceURL>
                <clientId>{$ctx:clientId}</clientId>
                <clientSecret>{$ctx:clientSecret}</clientSecret>
            </marketo.init>
            <marketo.getDeletedLeads>
                <batchSize>{$ctx:batchSize}</batchSize>
                <nextPageToken>{$ctx:nextPageToken}</nextPageToken>
            </marketo.getDeletedLeads>

            <respond/>
        </inSequence>
        <outSequence>
            <log/>
            <send/>
        </outSequence>
    </target>
    <description/>
</proxy>