leadSelector is not working for campaigns in getMultipleLeads call

Anonymous
Not applicable

leadSelector is not working for campaigns in getMultipleLeads call

Hi

The lead selector is not working in PHP and gives the error:
[SOAP-ENV:Client] 20110 - Bad parameter

$params->leadSelector = new stdClass;
$params->leadSelector->staticListName = "My List";

Can you please provide me the code of how to pass this paramenter to the request.

Thanks
 
Tags (1)
3 REPLIES 3
Anonymous
Not applicable

Re: leadSelector is not working for campaigns in getMultipleLeads call

if your list is inside a program, you should use the program name as a prefix like so -

prog name.listname

if not, the following should work -

  public function testListName()

  {

       $params = new paramsGetMultipleLeads();

      

       $leadSel = new StaticListSelector();

       $leadSel->staticListName = "TESTList1";

       $leadSelSoap = new SoapVar($leadSel, SOAP_ENC_OBJECT, get_class($leadSel), "http://www.marketo.com/mktows/");

       $params->leadSelector = $leadSelSoap;

       $params->batchSize = 100;

       $attrs = null;

       $attrs = array();

       $attrs = array("Id", "Email", "FirstName", "LastName");

       $aryOAttrs = new ArrayOfString();

       $aryOAttrs->stringItem = $attrs;

       $params->includeAttributes = $aryOAttrs;

  

       $authHdr = apiClientUtil::getAuthenticationHeader(self::$wsUser, null, null, $params, __METHOD__);

       $client = $this->getSoapClient();

       $success = $client->__soapCall('getMultipleLeads', array($params), null, $authHdr);

       $result = $success->result;

       testLog("Return count: " . $result->returnCount . ", remaining count: " . $result->remainingCount);

       if (empty($result->returnCount)) {

              $this->fail("Bad return count '".$result->returnCount."'");

       }

  }

Anonymous
Not applicable

Re: leadSelector is not working for campaigns in getMultipleLeads call

Thanks Raj, it worked very well.

Can you please tell me the API which can fetch the names of all the Lead Lists from Marketo.

Thanks
Anonymous
Not applicable

Re: leadSelector is not working for campaigns in getMultipleLeads call

Hi Ahmed,

There is no API that allows for retrieval of all lead lists.