// Create Request ParamsGetMultipleLeads request = new ParamsGetMultipleLeads(); // Request Using LastUpdateAtSelector //////////////////////////////////////////////////////// LastUpdateAtSelector leadSelector = new LastUpdateAtSelector(); GregorianCalendar since = new GregorianCalendar(); since.set(2014, Calendar.MAY, 12); DatatypeFactory factory = null; try { factory = DatatypeFactory.newInstance(); } catch (DatatypeConfigurationException e) { LOG.error("Could not create DatatypeFactory", e); } leadSelector.setOldestUpdatedAt(factory.newXMLGregorianCalendar(since)); request.setLeadSelector(leadSelector); ArrayOfString attributes = new ArrayOfString(); attributes.getStringItems().add("Email"); attributes.getStringItems().add("PersonContactId"); request.setIncludeAttributes(attributes);It appears that the last updated at selector is what's causing an issue here, but it also looks like using that is the only way to fetch all leads. If I set the LastUpdateAtSelector to a few days ago everything works, but when I set it to something like May 2014 so I can get all my leads, it doesn't work.
leadSelector.setOldestUpdatedAt(factory.newXMLGregorianCalendar(since));
Hi Jep,
Thanks for the info. I'm now trying to split up batches by using both sinceLatest and sinceOldest with a 1 day span. I will then try to parallelize this by getting leads from each day in batches, then combining all those into 1 big list to deduplicate everything. However, I'm getting unexpected results.
I'm also looking for an automated solution that I can keep running so ideally I'm not going to do any manual export since that would be hard to do continuously. We need batch deduplicaton because it looks like there are some platform bugs that cause our webhooks to fail. We try to deduplicate leads in real time as duplicates are created, but the API has some bugs that cause this to fail some small percentage of the time.
A few questions:
1. What date is the LastUpdateAtSelector selector using? I'd expect it to use the updated date that I see in the Marketo UI. However, for something like this:
sinceOldest.set(2014, Calendar.AUGUST, 1);
sinceLatest.set(2014, Calendar.AUGUST, 2);
I get leads with dates such as the following:
Created:
Apr 8, 2014 11:01 PM
Updated:
Dec 21, 2014 10:36 PM
Created:
Apr 8, 2014 11:00 PM
Updated:
Aug 12, 2014 9:30 PM
Created:
Aug 11, 2014 8:37 PM
Updated:
Aug 11, 2014 9:24 PM
What's going on here? The filter is definitely working in that it filters out a few leads at once and some dates return nothing, but the dates on the leads themselves don't make sense.
2. Is there a limit to how many concurrent connections the API can handle at once? For example, if we've had Marketo running for 500 days, could I make 500 requests at once? I seem to be hitting some limits now but it's really trial and error.
Thanks for all your help!