0

I'm using the Five9 API to look up CRM contact records. No matter what criteria I put in, the code returns all of the the records in my CRM (well, the first 1000 records).

This is my code:

$crmFieldCriterion = array(
    array(
        'field' => 'number1',
        'value' => '9045551212'
    )
);

$crmLookupCriteria = array (
    'contactIdField' => 'number1', 
    'criteria' => $crmFieldCriterion
); 

$contactsLookupResult = $five9->getContactRecords($crmLookupCriteria);
print_r($contactsLookupResult);

Here's a link to the documentation: https://webapps.five9.com/assets/files/for_customers/documentation/apis/config-webservices-api-reference-guide.pdf

Relevant information is on pages 166, 69, and 70 (in that order).

I've also tested the $crmFieldCriterion a non-dimensional array with the same result.

$crmFieldCriterion = array(
    'field' => 'number1',
    'value' => '9045551212'
);

1 Answers1

1

Nevermind...I got it. I wasn't putting the $crmLookupCriteria into it's own array as a value of the lookupCriteria parameter.

Should be:

$crmFieldCriterion = array(
    array(
        'field' => 'number1',
        'value' => '9045551212'
    )
);

$crmLookupCriteria = array (
    'contactIdField' => 'number1',
    'criteria' => $crmFieldCriterion
);

$lookupCriteria = array(
    'lookupCriteria' => $crmLookupCriteria
);

$contactsLookupResult = $five9->getContactRecords($lookupCriteria);
print_r($contactsLookupResult);