AnsweredAssumed Answered

LastUpdatedDate actually CreatedDate in getMultipleLeads LeadSelector?

Question asked by 9ab16155f21350527835406584939c869f13573e on Jan 15, 2014
Latest reply on Jan 17, 2014 by 22662

I'm using the getMultipleLeads API to keep all Marketo leads in sync with an external database.  I'm using the java SOAP library with a LastUpdatedAtLeadSelector to gather all leads in a specified timerange.  However, I noticed this selector actually uses the CreatedDate and not the LastUpdated date of the records.  For instance, if I set the oldestUpdatedAt date to 2011/11/21 and the latestUpdatedAt date to 2011/11/23 I get back a record created on 2011/11/21 but most recently updated on 2013/11/15, far outside the given range.  

Does this mean that I can only use this API to get newly created leads but not to see any leads that have been modified since the last sync?  If so, what is the recommended method to sync updates?  I'm also working with the getLeadChanges API with the "ChangeDataValue" ActivityType.  However that seems to give back a ton of fields I don't care about since there is no filtering capability.  Do I just need to slog through all those updates to find the ones I care about?

Here's my code to configure the LeadSelector:

     LastUpdateAtSelector leadSelector = new LastUpdateAtSelector();
             //set timeframe
             DatatypeFactory factory = DatatypeFactory.newInstance();
             GregorianCalendar sinceGC = new GregorianCalendar();
             XMLGregorianCalendar since = factory.newXMLGregorianCalendar(sinceGC);
             GregorianCalendar untilGC = new GregorianCalendar();
             JAXBElement<XMLGregorianCalendar> until = objectFactory.createLastUpdateAtSelectorLatestUpdatedAt(factory.newXMLGregorianCalendar(untilGC));