Need to update date thru API but first I'm trying to LOCATE them !
I managed to find Contacts from his email. Then use the associations.contact in Deals to find appropriate Deal, but I can only see/update the basic values : (Amount, name). But I need to reach fields our Customer created either by the Group or Properties, but can't find the way... I'm just turning round into Doc... Any help would be appreciated. Here's a dump of what I can get, but theres dozens of other fields.
Dennis, Thank you for your input. It directed me it the right direction. Althought I wasn't able to test it in PostMan, I've managed to figure it out in my code. So foro the benefit of anyone with this issue:
/* Find related contact and custom fields related to a specific contact ID */
/* Using HubSpot PHP API */
public function findDeal($contactId){
$hubSpot = \HubSpot\Factory::createWithApiKey(MY_API_KEY_HERE);
$filter = new \HubSpot\Client\Crm\Deals\Model\Filter();
$filter
->setOperator('EQ')
->setPropertyName('associations.contact')
->setValue($contactId);
$filterGroup = new \HubSpot\Client\Crm\Deals\Model\FilterGroup();
$filterGroup->setFilters([$filter]);
$searchRequest = new \HubSpot\Client\Crm\Deals\Model\PublicObjectSearchRequest();
$searchRequest->setFilterGroups([$filterGroup]);
$searchRequest->setProperties(["name", "amount_in_home_currency", "signature_date__c", "description", "pipeline", ]);
$t = $searchRequest->getProperties();
return $hubSpot->crm()->deals()->searchApi()->doSearch($searchRequest);
}
Hope this piece of code will help other as your input helped me, I'm just paying forward !
Dennis, Thank you for your input. It directed me it the right direction. Althought I wasn't able to test it in PostMan, I've managed to figure it out in my code. So foro the benefit of anyone with this issue:
/* Find related contact and custom fields related to a specific contact ID */
/* Using HubSpot PHP API */
public function findDeal($contactId){
$hubSpot = \HubSpot\Factory::createWithApiKey(MY_API_KEY_HERE);
$filter = new \HubSpot\Client\Crm\Deals\Model\Filter();
$filter
->setOperator('EQ')
->setPropertyName('associations.contact')
->setValue($contactId);
$filterGroup = new \HubSpot\Client\Crm\Deals\Model\FilterGroup();
$filterGroup->setFilters([$filter]);
$searchRequest = new \HubSpot\Client\Crm\Deals\Model\PublicObjectSearchRequest();
$searchRequest->setFilterGroups([$filterGroup]);
$searchRequest->setProperties(["name", "amount_in_home_currency", "signature_date__c", "description", "pipeline", ]);
$t = $searchRequest->getProperties();
return $hubSpot->crm()->deals()->searchApi()->doSearch($searchRequest);
}
Hope this piece of code will help other as your input helped me, I'm just paying forward !