I have a requirement, where I want to know the count of leads in List.
I see API methods which can give me batch of Leads, but what I am interested in the total count in the list.
When you pull the leads from the list using Get Multiple Leads by List Id » Marketo Developers just do a count on the returned arrays (arrays = leads) using whichever language you choose to use.
Thank you for the response.
Assume if I have 1M leads in a List.
And Marketo API call will give me only 300 leads per call… so I need to make ~ 333 calls to get the total lead counts.
But what I am interested over here is to just know the count in the list.
A way to simulate this, if you are very thorough in making sure to catch both adds and deletes, is to create a special "resource lead" that holds metadata for the list. Then you can have a score field on the resource lead that stores, as closely as possible, the number of leads currently in the list. Update the resource lead itself via webhook.
No, I don't want to do that.
Should be there some simple way of doing this.
I just need to know the count in my static lists.
You should open an Idea.
The API is really lacking in aggregate actions (such as the count you want here). As the API consumer, you essentially are limited to following cursors/checkpoints, from which (in your own separate database) you can create tables on which you can perform aggregate actions.
Retrieving data ...