HubSpot / hubspot-php

HubSpot PHP API Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HubSpot Contacts Search API Broken?

thomaslanenh opened this issue · comments

Trying to use a search for FilterGroup but getting back the following error from my code:

{"status":"error","message":"Invalid input JSON on line 1, column 80: Cannot construct instance of com.hubspot.inboundd (truncated...)
in /nas/content/live/teal/wp-content/plugins/TOSync/vendor/hubspot/api-client/codegen/Crm/Contacts/Api/SearchApi.php:151`

This is what i'm sending in:

`
$filter = new \HubSpot\Client\Crm\Contacts\Model\Filter();
$filter
->setOperator('EQ')
->setPropertyName('email')
->setValue($email);

    // Creates the Filter Group in HubSpot
    $filterGroup = new \HubSpot\Client\Crm\Contacts\Model\FilterGroup();
    $filterGroup->setFilters([$filter]);

    // Prepares the Search Request in HubSpot
    $searchRequest = new \HubSpot\Client\Crm\Contacts\Model\PublicObjectSearchRequest();
    $searchRequest->setFilterGroups([$filterGroup]);

    $contactsPage = $hubSpot->crm()->contacts()->searchApi()->doSearch($searchRequest);
    $contactsPage = json_decode($contactsPage);

`

This was working, but even within the HubSpot API documentation attempting to do a test isn't working either, producing the following error:

`HTTP 400

{
"status": "error",
"message": "Invalid input JSON on line 1, column 114: Cannot construct instance of com.hubspot.inbounddb.publicobject.core.v3.search.Filter, problem: value and values are mutually exclusive",
}`

Any idea what's up?

commented

Hi @thomaslanenh
Could you check this SDK please?
it is workable example but for this SDK