Getting "Request Expired" Error during GetMultipleLeads

Highlighted
Anonymous
Not applicable

Getting "Request Expired" Error during GetMultipleLeads

I am trying to retrieve 230K leads from Marketo via SOAP. After getting like 20K leads or so, I receive an error "Request Expired".

How can I avoid it? What is causing it?

Thanks,
Kiryl
Tags (1)
4 REPLIES 4
Highlighted
Anonymous
Not applicable

Re: Getting "Request Expired" Error during GetMultipleLeads

The server signature and server timestamp used for SOAP authentication have a lifespan of 15 minutes.

Trying to retrieve all 230k leads in one go is likely to exceed that time. I can almost anticipate you are receiving SOAP error 20016.

The solution is simple: place the XML call within a loop so each time it receives a XML response with remainingCount greater than zero and a newStreamPosition, keep looping to get fresh timestamp and signature.

In most programming languages you can either use

remainingCount = 1;

while (remainingCount >= 1){
    // your code goes here
   // evaluate remainingCount from XML response
}
 
or 
 
do {
     statement(s)
} while (remainingCount >= 1);

Highlighted
Marketo Employee

Re: Getting "Request Expired" Error during GetMultipleLeads

To expand on what Breno said, you should limit your call to a batchSize of 1000 or less, and then use the paging method that Breno provided to retrieve the next set of leads.
Highlighted
Anonymous
Not applicable

Re: Getting "Request Expired" Error during GetMultipleLeads

I already doing most of what you guys mentioned. Except I am not resetting requestTimestamp and requestSignature in the loop itself. @bgomes: Did I understand this correctly? I am trying this now. Will re-post here if this solved the issue.
Highlighted
Anonymous
Not applicable

Re: Getting "Request Expired" Error during GetMultipleLeads

That solved my problem.

Thank you guys!