Re: Getting "Request Expired" Error during GetMultipleLeads

Anonymous
Not applicable
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
Anonymous
Not applicable
That solved my problem.

Thank you guys!
Anonymous
Not applicable
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.
Kenny_Elkington
Marketo Employee
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.
Anonymous
Not applicable
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);