Request Timeout - Marketo Rest API with batchSize 1

Anonymous
Not applicable
I am sending a get request to the Get Multiple Leads by List ID rest api with a list id that contains a large number of leads. I only need the first record for validation so I am setting the batchSize to 1. However the request times out most of the times.

Is there a way to validate my request without marketo trying to fetch all the records? I just need to check if my request is valid.
Tags (1)
4 REPLIES 4
Anonymous
Not applicable
I am still seeing the timeout error after removing the batchSize parameter
Anonymous
Not applicable
If you make this same call without specifying the batchSize parameter, do you still receive the request timeout error?
Anonymous
Not applicable
Hi Kenny,

Thanks for looking into this. We do not set any client-side connection timeout. Here is the java code we use to make the api call. Please note that we are using batchSize=1.

URL url = new URL("https://<marketo url>/rest/v1/list/<list id>/leads.json?access_token=<access token>&batchSize=1&fields=<comma separated fields>");
urlConn = (HttpsURLConnection) url.openConnection();
urlConn.setRequestMethod("GET");
urlConn.setAllowUserInteraction(false);
urlConn.setDoOutput(true);
urlConn.setRequestProperty("Content-type", "application/json");
urlConn.setRequestProperty("accept", "application/json");
int responseCode = urlConn.getResponseCode();

 
Kenny_Elkington
Marketo Employee
Hi Anil,

Are you setting a client-side connection timeout?  Can you provided a (redacted) copy of the exact call which you're making?  How many records are available in your target list?