I have some issues with the extraction of lead activities. I want to get every "PushLeadToSales" activities of every client. So I called the service with a request looking like this :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mkt="http://www.marketo.com/mktows/">
<soapenv:Header>
<mkt:AuthenticationHeader>
...
</mkt:AuthenticationHeader>
</soapenv:Header>
<soapenv:Body>
<mkt:paramsGetLeadChanges>
<activityFilter>
<includeTypes>
<activityType>PushLeadToSales</activityType>
</includeTypes>
</activityFilter>
</mkt:paramsGetLeadChanges>
</soapenv:Body>
</soapenv:Envelope>
It returns me the first 1000 activities :
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://www.marketo.com/mktows/">
<SOAP-ENV:Body>
<ns1:successGetLeadChanges>
<result>
<returnCount>1000</returnCount>
<remainingCount>5774</remainingCount>
<newStartPosition>
<offset>1000</offset>
</newStartPosition>
<leadChangeRecordList>
So I assume that sending the same request with the startPosition set to 1000 would send me the next page. So I sent :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mkt="http://www.marketo.com/mktows/">
<soapenv:Header>
<mkt:AuthenticationHeader>
...
</mkt:AuthenticationHeader>
</soapenv:Header>
<soapenv:Body>
<mkt:paramsGetLeadChanges>
<startPosition>
<offset>1000</offset>
</startPosition>
<activityFilter>
<includeTypes>
<activityType>PushLeadToSales</activityType>
</includeTypes>
</activityFilter>
</mkt:paramsGetLeadChanges>
</soapenv:Body>
</soapenv:Envelope>
But I received :
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://www.marketo.com/mktows/">
<SOAP-ENV:Body>
<ns1:successGetLeadChanges>
<result>
<returnCount>0</returnCount>
<remainingCount>-998</remainingCount>
<newStartPosition>
<latestCreatedAt xsi:nil="true"/>
<oldestCreatedAt>2013-12-12T21:32:43+00:00</oldestCreatedAt>
<activityCreatedAt>2013-12-12T21:32:43+00:00</activityCreatedAt>
<offset>1000</offset>
</newStartPosition>
<leadChangeRecordList xsi:nil="true"/>
</result>
</ns1:successGetLeadChanges>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
How a return count of 0 is possible when the remaining was 5774? And how a remaining of -998 is possible at all?
If I do the same thing, but without filtering on attributes I got something similar. On the first request I receive 1000 activities, with a remaining of 2638351. On the second call, with the offset set to 1000, I still receive 1000 activities, but with a remaining of 8473. If I try with the offset set to 2000, I still receive 1000 activities, but the remaining is 7473.
Can anybody explains this?