Re: Using the API, how do I get details for activities?

Anonymous
Not applicable

Using the API, how do I get details for activities?

I've been collecting activities with getLeadChanges() for several weeks, and I've seen that many come through with no details (the activityAttributes collection has no record with an attrName of "Details").  I assumed this was normal, not all activities are that complex, right?

This includes the "Send Email", "Email Delivered", and "Change Data Value" activity types.  However, the business users have shown me screen shots where activities of these types do have details.  Is there some extra step I need to reliably get details when calling getLeadChanges()?

The types that do have details (for me, anyway) are "Email Bounced", "Email Bounced Soft", and a small fraction of "Unsubscribe Email" activities.

Tags (1)
7 REPLIES 7
Anonymous
Not applicable

Re: Using the API, how do I get details for activities?

getLeadActivity would be a suitable option.


The WSDL defines Send Email" and "Email Delivered" among others:

<xs:simpleType name="ActivityType">
<xs:restriction base="xs:string">
<xs:enumeration value="VisitWebpage"/>
<xs:enumeration value="FillOutForm"/>
<xs:enumeration value="ClickLink"/>
<xs:enumeration value="SendEmail"/>
<xs:enumeration value="EmailDelivered"/>
<xs:enumeration value="EmailBounced"/>
<xs:enumeration value="UnsubscribeEmail"/>
<xs:enumeration value="OpenEmail"/>
<xs:enumeration value="ClickEmail"/>
<xs:enumeration value="NewLead"/>
<xs:enumeration value="ChangeDataValue"/>
<xs:enumeration value="LeadAssigned"/>
<xs:enumeration value="NewSFDCOpprtnty"/>
<xs:enumeration value="Wait"/>
<xs:enumeration value="RunSubflow"/>
<xs:enumeration value="RemoveFromFlow"/>
<xs:enumeration value="PushLeadToSales"/>
<xs:enumeration value="CreateTask"/>
<xs:enumeration value="ConvertLead"/>
<xs:enumeration value="ChangeScore"/>
<xs:enumeration value="ChangeOwner"/>
<xs:enumeration value="AddToList"/>
<xs:enumeration value="RemoveFromList"/>
<xs:enumeration value="SFDCActivity"/>
<xs:enumeration value="EmailBouncedSoft"/>
<xs:enumeration value="PushLeadUpdatesToSales"/>
<xs:enumeration value="DeleteLeadFromSales"/>
<xs:enumeration value="SFDCActivityUpdated"/>
<xs:enumeration value="SFDCMergeLeads"/>
<xs:enumeration value="MergeLeads"/>
<xs:enumeration value="ResolveConflicts"/>
<xs:enumeration value="AssocWithOpprtntyInSales"/>
<xs:enumeration value="DissocFromOpprtntyInSales"/>
<xs:enumeration value="UpdateOpprtntyInSales"/>
<xs:enumeration value="DeleteLead"/>
<xs:enumeration value="SendAlert"/>
<xs:enumeration value="SendSalesEmail"/>
<xs:enumeration value="OpenSalesEmail"/>
<xs:enumeration value="ClickSalesEmail"/>
<xs:enumeration value="AddtoSFDCCampaign"/>
<xs:enumeration value="RemoveFromSFDCCampaign"/>
<xs:enumeration value="ChangeStatusInSFDCCampaign"/>
<xs:enumeration value="ReceiveSalesEmail"/>
<xs:enumeration value="InterestingMoment"/>
<xs:enumeration value="RequestCampaign"/>
<xs:enumeration value="SalesEmailBounced"/>
<xs:enumeration value="ChangeLeadPartition"/>
<xs:enumeration value="ChangeRevenueStage"/>
<xs:enumeration value="ChangeRevenueStageManually"/>
<xs:enumeration value="ComputeDataValue"/>
<xs:enumeration value="ChangeStatusInProgression"/>
<xs:enumeration value="ChangeFieldInProgram"/>
<xs:enumeration value="EnrichWithDatacom"/>
<xs:enumeration value="ChangeSegment"/>
<xs:enumeration value="ResolveRuleset"/>
<xs:enumeration value="SmartCampaignTest"/>
<xs:enumeration value="SmartCampaignTestTrigger"/>
 
Anonymous
Not applicable

Re: Using the API, how do I get details for activities?

That lets me get the details for a specific activity.  I have about 400K of these each week, and the API does not support such a volume.
Anonymous
Not applicable

Re: Using the API, how do I get details for activities?

You can have multiple ActivityType attributes for getLeadActivity.
 
The API allows to read the records in batches. There are two articles to help you reading them all:
 
Example SOAP API Call - getLeadActivity
 
SOAP API Calls returning multiple records - reading the next batch
 
Anonymous
Not applicable

Re: Using the API, how do I get details for activities?

Yes, I can include multiple acitivity types in getLeadActivity().  As described in my first message and the title of this discussion, the issue is that I'm not getting any activity details.  Also, getLeadActivity() retrieves activities for a specific lead; even if there is a way to get activity details via that method, we're generating tens of thousands of activities every day, for tens of thousands of leads, and the API cannot handle that volume.

I'm aware of the process to retrieve additional records when an API call returns more then the batch size.

Anonymous
Not applicable

Re: Using the API, how do I get details for activities?

Jon,

Can you post a specific SOAP request that did not return the expected details? Please inculde the complete XML.

Agha Ahsan
Principle Engneer
Anonymous
Not applicable

Re: Using the API, how do I get details for activities?

Sure, though unfortunately this forum software mangles the formatting:

POST https://na-g.marketo.com/soap/mktows/2_0 HTTP/1.1
Content-Type: text/xml; charset=utf-8
VsDebuggerCausalityData: uIDPoyanvLAYudhGlgB9JkfwNYAAAAAA3Sbo86rS3keQOLK59UCHsQXWCUjoaVxJjcMjRX0WIGEACQAA
SOAPAction: "http://www.marketo.com/mktows/getLeadChanges"
Host: na-g.marketo.com
Content-Length: 1494
Expect: 100-continue
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
 
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:AuthenticationHeader xmlns:h="http://www.marketo.com/mktows/" xmlns="http://www.marketo.com/mktows/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<mktowsUserId xmlns="">volusion1_XXX</mktowsUserId>
<requestSignature xmlns="">XXX</requestSignature>
<requestTimestamp xmlns="">2013-04-04T17:00:08.082Z</requestTimestamp>
</h:AuthenticationHeader>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<paramsGetLeadChanges xmlns="http://www.marketo.com/mktows/">
<startPosition xmlns="">
<activityCreatedAt>2013-04-04T10:59:57.8196127-05:00</activityCreatedAt>
<offset xsi:nil="true"/>
</startPosition>
<activityFilter xmlns="">
<includeTypes>
<activityType>ChangeStatusInProgression</activityType>
<activityType>ClickEmail</activityType>
<activityType>ClickLink</activityType>
<activityType>EmailBounced</activityType>
<activityType>EmailBouncedSoft</activityType>
<activityType>EmailDelivered</activityType>
<activityType>FillOutForm</activityType>
<activityType>OpenEmail</activityType>
<activityType>SendAlert</activityType>
<activityType>SendEmail</activityType>
<activityType>UnsubscribeEmail</activityType>
<activityType>VisitWebpage</activityType>
</includeTypes>
</activityFilter>
<batchSize xmlns="">500</batchSize>
</paramsGetLeadChanges>
</s:Body>
</s:Envelope>
 
I have a ticket open on this issue now, too.  I'll post back here if that produces an answer.

Anonymous
Not applicable

Re: Using the API, how do I get details for activities?

K, they were able to recommend one helpful element: lead IDs can be found in the mktPersonId field, in addition to (sometimes) attribute details.