Re: How to access a specific Lead's activity log via REST API?

Jeff_Barfield
Level 1

How to access a specific Lead's activity log via REST API?

Hello,

I'm looking to complete what seems like it should be a fairly simple task but I'm at my wits end in terms of getting it across the line. 

On my site I have a simple Marketo form that users need to fill out before they can view my full catalog of products. Once the user completes the form they can browse the products and the page views for each product are tracked in that lead's activity log. What I would like to do is capture all products that were viewed (page views) within 3 hours of the form completion.  

As I understand it, I should be able to lookup the lead using the email supplied on the form and pull a list of 'Visit web Page' activities within that time window but I can't seem to figure out how these two pieces of information are related.

Any help on this would be greatly appreciated, I've been searching for 2 days and cannot seem to find a clear answer for this particular situation.

Thank you,

3 REPLIES 3
Amit_Jain
Level 8 - Community Advisor

Re: How to access a specific Lead's activity log via REST API?

There is no REST API end point available to pull the activity data for specific lead. In my opinion you have to create a external database to export the lead activities (this will return the data with Lead ID) and lead data with email address and lead ID. Once you have this data set, you can directly lookup this data to find the page visit activities for a specific email address. Let me know if this makes sense.

SanfordWhiteman
Level 10 - Community Moderator

Re: How to access a specific Lead's activity log via REST API?

There is no REST API end point available to pull the activity data for specific lead.

Sure there is. The Get Activities endpoint can be filtered by Lead ID.

The problem here isn't a lack of endpoint but the chatty (paginated) and slow nature of the API.

SanfordWhiteman
Level 10 - Community Moderator

Re: How to access a specific Lead's activity log via REST API?

I should be able to lookup the lead using the email supplied on the form and pull a list of 'Visit web Page' activities within that time window but I can't seem to figure out how these two pieces of information are related.

You're surely leaving many things out. It's important to state what you're trying to accomplish on a business level -- sometimes more important than getting into technical concepts because you may have an XY problem.

The Filled Out Form activity and the Visit Web Page activity are linked by the Lead ID. In Marketo, the Email Address is not a primary key. It's merely a lookup key through which you can get (one of) the Lead IDs with that address.

How are you getting the lead's email address into a process that will use the API?

Why does that process not know the Lead's ID?