I've gone through the API example code, but have not seen a way to page through many results when using getMultipleLeads(). Presumably this is handled with streamPosition, but the WSDL defines that field as being of type "string". What have I missed?
I see a startPosition field for the getLeadActivity() and getLeadChanges() methods, but surely getMultipleLeads() also has this capability.
I'm using C#, so examples in .NET are ideal, but I'll take what I can get. Thank you!
There seems to be more to it; capturing the previous loop's result.newStartPosition value and including it in the following call's parameters, the result.remainingCount value is not reduced. Can you see what I'm missing?
public IEnumerable<Activity> GetActivities(int leadId)
ParamsGetLeadActivity parameters = new ParamsGetLeadActivity();
Aha, thank you. I went through the block of links but didn't see the attachment at the end. Unfortunately, it gives no additional information about paging beyond your reply on Friday (though the typos are amusing).
I found and removed a complication: I was reading tasks' activities in nested loops. The tasks are actually paging OK, but not activities. I've swapped the process to spool leads in their entirety before looping through them again to read activities - and that's where the real problem is.
Checking the IDs returned, it looks like paging is working for activities, but imperfectly: the second page has the same results as the first, and the third page returned has the second page of actual results. This is the case even if I manually specify startPosition.offset: I get the same results for task #2041892 if offset is 0 or 100. The pattern holds if I use a batch size of 50 or 20: the second page repeats the first, and subsequent pages proceed from there.
That's easily fixed, I simply track which page number I'm on and don't return the second. getMultipleLeads does not seem to have this problem, just getLeadActivity so far.
Unfortunately, the .Net layer wrapping a WSDL is opaque; it's really quite complex to get to the raw XML. Here's a typical request for getMultipleLeads: