Skip to main content
July 11, 2013
Question

leadSelector is not working for campaigns in getMultipleLeads call

  • July 11, 2013
  • 3 replies
  • 824 views
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
 
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

July 11, 2013
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), "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."'");

       }

  }

July 12, 2013
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
July 12, 2013
Hi Ahmed,

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