-
-
Save atymic/1104ae32c2bfee6604e1eb6cf68c4989 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use HubSpot\Client\Crm\Contacts\Model\Filter; | |
use HubSpot\Client\Crm\Contacts\Model\FilterGroup; | |
use HubSpot\Client\Crm\Contacts\Model\PublicObjectSearchRequest; | |
$intMobileFilter = (new Filter()) | |
->setOperator('EQ') | |
->setPropertyName('hs_searchable_calculated_international_mobile_number') | |
->setValue('61476647930'); | |
$intPhoneFilter = (new Filter()) | |
->setOperator('EQ') | |
->setPropertyName('hs_searchable_calculated_international_phone_number') | |
->setValue('61476647930'); | |
$intMobileFilterGroup = (new FilterGroup())->setFilters([$intMobileFilter]); | |
$intPhoneFilterGroup = (new FilterGroup())->setFilters([$intPhoneFilter]); | |
$searchRequest = (new PublicObjectSearchRequest()) | |
->setFilterGroups([ | |
$intMobileFilterGroup, | |
$intPhoneFilterGroup, | |
]) | |
->setProperties(['hs_object_id']); | |
$contactsPage = $client->crm()->contacts()->searchApi()->doSearch($searchRequest); | |
$contactId = $contactsPage->getResults(); // Empty Array, no results |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment