Lead activities paging

Anonymous
Not applicable

Lead activities paging

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?

 
Tags (1)
5 REPLIES 5
Anonymous
Not applicable

Re: Lead activities paging

Emmanuel,
Please log a support ticket - we'd like to investigate this

Raj
Anonymous
Not applicable

Re: Lead activities paging

I got this message when I try :

Thank you for reaching out to Marketo Customer Support.

 

You are currently logged in through an instance that does not have rights to access the Marketo Support Portal.
Anonymous
Not applicable

Re: Lead activities paging

Hi  Emmanuel,

Please log a support per Raj as well but my understanding is that product is aware of the incorrect/inconsistent remaining count but they have in the past recommended to ignore the actual remainingCount value if greater than zero and iterate until remaining count = 0.

You may want to specify the batch size as well on each call (i.e. 200).

Anonymous
Not applicable

Re: Lead activities paging

Thanks for you answer Angelo. I'm not sure what you're advising me to do. My current remiaining count is -998, which is not = to 0 and even less greater then 0. Anyway, the offset returned is 1000, the same thing I sent, so I can't continue to iterate even if I'm avoiding the remaining count.

Specifying the batch size doesn't change anything.

Just for curiosity, what is the technology used to develop the web services? I know that the web site is built with php but is the api too?

Emmanuel
Anonymous
Not applicable

Re: Lead activities paging

That does seem odd behavior... yes, please log a ticket.  

I don't have insight into how services were built.