Re: newStreamPosition empty in getMultipleLeads response

Anonymous
Not applicable

newStreamPosition empty in getMultipleLeads response

Hi,

I am facing some issue in getMultipleLeads API. According to the documentation we can do pagination using streamPosition parameter and value assigned should be taken from last calls response  i.e. "newStreamPosition". But I am not recieving anything in "newStreamPosition". Below is my SOAP request.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header>
        <ns1:AuthenticationHeader xmlns:ns1="http://www.marketo.com/mktows/">
            <mktowsUserId>***********************************</mktowsUserId>
            <requestSignature>**************************************************</requestSignature>
            <requestTimestamp>2013-11-26T13:59:52-08:00</requestTimestamp>
        </ns1:AuthenticationHeader>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns1:paramsGetMultipleLeads xmlns:ns1="http://www.marketo.com/mktows/">
            <leadSelector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:type="ns1:LeadKeySelector">
                <keyType>IDNUM</keyType>
                <keyValues>
                    <stringItem>1</stringItem>
                    <stringItem>2</stringItem>
                    <stringItem>3</stringItem>
                    <stringItem>4</stringItem>
                    <stringItem>5</stringItem>
                    <stringItem>6</stringItem>
                    <stringItem>7</stringItem>
                </keyValues>
            </leadSelector>
            <batchSize>3</batchSize>
        </ns1:paramsGetMultipleLeads>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

My marketo instance has all of these leads. Response I got from Marketo is

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns1="http://www.marketo.com/mktows/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Header />
    <SOAP-ENV:Body>
        <ns1:successGetMultipleLeads>
            <result>
                <returnCount>3</returnCount>
                <remainingCount>4</remainingCount>
                <newStreamPosition />
                <leadRecordList>
                         3 Lead Records
                </leadRecordList>
            </result>
        </ns1:successGetMultipleLeads>
    </SOAP-ENV:Body>

<newStreamPosition> is empty. Can you check if anything wrong with my request?

Tags (1)
4 REPLIES 4
Anonymous
Not applicable

Re: newStreamPosition empty in getMultipleLeads response

Can someone please have a look in this issue?
Anonymous
Not applicable

Re: newStreamPosition empty in getMultipleLeads response

Hi Sandeep - In the above sample, you are using the LeadKeySelector.  Since the LeadKeySelector requires you to submit a list of IDs for the leads you are querying, there is no need for a streamPosition since you already know the maximum number of leads the API will return.  I recommend you set the batchSize to the # of IDs you are requesting.

When using other lead selectors like the LastUpdateAtSelector the caller may not know the # of results that may be returned.  In that case is where you will recieve a streamPosition so the caller can iterate through large result sets.
Anonymous
Not applicable

Re: newStreamPosition empty in getMultipleLeads response

I am having a similar issue when querying by email. The problem is, we have duplicates on email and I want to get all of them. If I set the batch size to the number of emails I pass in, I will always end up with a remaining count and no stream posisiton. Is there a way to get the newStreamPosition element on a getMulitpleLead request with the LeadKeySelector?
Anonymous
Not applicable

Re: newStreamPosition empty in getMultipleLeads response

I am having same problem when querying by email. Is it a bug of the API ?
Because 1 email can return more than 1 leads. So we can't sure the maximum number of leads the API will return
for one batch query. So we might miss some leads for one query.

I also meet some special emails.
I query with 2 emails, the batch size is 100.
But the response: returnCount is 2.remainingCount is 2. So I always miss those two leads.