src/Api/LeadApi.php
public function show($email)
    {
        $url = $this->client->url . '/rest/v1/leads.json';
        $queryParams = [
            'filterType' => 'email',
            'filterValues' => $email
        ];
        $response = parent::get($url, $queryParams);
        if ($response->success) {
            if (count($response->result) > 0) {
                return $response->result[0];
            } else {
                throw new LeadDoesNotExistException('Lead does not exist with email ' . $email);
            }
        } else {
            throw new MarketoApiException('Error retrieving lead: ' . $response->errors[0]->message);
        }
    }
public function show($email)
    {
        $url = $this->client->url . '/rest/v1/leads.json';
        $queryParams = [
            'filterType' => 'email',
            'filterValues' => $email
        ];
        $response = parent::get($url, $queryParams);
        if ($response->success) {
            if (count($response->result) > 0) {
                return $response->result[0];
            } else {
                throw new LeadDoesNotExistException('Lead does not exist with email ' . $email);
            }
        } else {
            throw new MarketoApiException('Error retrieving lead: ' . $response->errors[0]->message);
        }
    }
public function show ( $ email ) { $ url = $ this -> client -> url . '/rest/v1/leads.json' ; $ queryParams = [ 'filterType' => 'email' , 'filterValues' => $ email ] ; $ response = parent :: get ( $ url , $ queryParams ) ; if ( $ response -> success ) { if ( count ( $ response -> result ) > 0 ) { return $ response -> result [ 0 ] ; } else { throw new LeadDoesNotExistException ( 'Lead does not exist with email ' . $ email ) ; } } else { throw new MarketoApiException ( 'Error retrieving lead: ' . $ response -> errors [ 0 ] -> message ) ; } }
Get a lead by email address

@param string $email
@return \stdClass
@throws LeadDoesNotExistException
@throws MarketoApiException
Get a lead by email address