CRM Search failing for double quotes not returning correct result set

Highlighted
New Contributor

Hi Team,

 

When I am using double quotes in CRM Search it is not returning correct result. Please find my details below -

Scenario-1: "propertyName": "deal_unique_id" i have used double quotes, didn't return correct result
----------------------------------------------------------------------------------------------------
Deal Search Input
{
"filterGroups": [
{
"filters": [
{
"propertyName": "oracle_account_number",
"operator": "EQ",
"value": "110192"
},
{
"propertyName": "enterprise_site_id",
"operator": "EQ",
"value": "114795"
},
{
"propertyName": "deal_unique_id",
"operator": "EQ",
"value": "114795-226--Sof-Tray Classic Sheets (0.035\\\")"
}
]
}
]
}
Deal Search Output
{
"total": 0,
"results": []
}

Scenario-2: I haven't used double quotes, did return correct result
------------------------------------------------------------------
Deal Search Input
{
"filterGroups": [
{
"filters": [
{
"propertyName": "oracle_account_number",
"operator": "EQ",
"value": "110192"
},
{
"propertyName": "enterprise_site_id",
"operator": "EQ",
"value": "114795"
}
]
}
]
}
Deal Search Output
{
"total": 1,
"results": [
{
"id": "2741226816",
"properties": {
"amount": null,
"closedate": null,
"createdate": "2020-07-31T21:00:04.034Z",
"dealname": "Sku:114795-226--Sof-Tray Classic Sheets (0.035\")",
"dealstage": null,
"hs_lastmodifieddate": "2020-07-31T21:00:11.900Z",
"hs_object_id": "2741226816",
"pipeline": null
},
"createdAt": "2020-07-31T21:00:04.034Z",
"updatedAt": "2020-07-31T21:00:11.900Z",
"archived": false
}
]
}

0 Upvotes
4 Replies 4
Highlighted
HubSpot Moderator

Hey @tanmay,

 

In order for me to further troubleshoot this, could you share with me the portal ID in question?

 

Additiionally, when comparing the POST body of scenario 1:

{
"filterGroups": [
{
"filters": [
{
"propertyName": "oracle_account_number",
"operator": "EQ",
"value": "110192"
},
{
"propertyName": "enterprise_site_id",
"operator": "EQ",
"value": "114795"
},
{
"propertyName": "deal_unique_id",
"operator": "EQ",
"value": "114795-226--Sof-Tray Classic Sheets (0.035\\\")"
}
]
}
]
}

and POST body of scenario 2 

{
"filterGroups": [
{
"filters": [
{
"propertyName": "oracle_account_number",
"operator": "EQ",
"value": "110192"
},
{
"propertyName": "enterprise_site_id",
"operator": "EQ",
"value": "114795"
}
]
}
]
}

I'm not seeing deal_unqiue_id used on scenario 2, hence by not using double quotes do you mean that you remove the search filter entirely? Or am I missing something here?

0 Upvotes
Highlighted
New Contributor

Secend scenerio i didn't use deal_unique_id becase i just wanted to show, whithout using deal_unique_id search result returning values.  

0 Upvotes
Highlighted
HubSpot Moderator

Hey @tanmay

 

When I add this portion to the POST body:

{
"propertyName": "deal_unique_id",
"operator": "EQ",
"value": "114795-226--Sof-Tray Classic Sheets (0.035\\\")"
}

 

I'm also seeing a 400 error. 

 

When looking at the full error message:

 

message:"Api[name=crm-search, subPath=/crm-search/search] Failed to process your request. Error code was '400'. Error message was:\n{"status":"error","message":"Unknown Contacts Search API failure: [400] {\"status\":\"400\",\"message\":\"Unable to execute query. Property deal_unique_id could not be found.\",\"errorType\":\"INVALID_PROPERTY\",\"errorTokens\":{\"PROPERTY\":[\"deal_unique_id\"]},\"correlationId\":\"cfdef886-67af-4025-8c9a-546e76b93d15\"}","correlationId":"cfdef886-67af-4025-8c9a-546e76b93d15"}",

 

It seems to suggest that property `deal_unique_id` doesn't exist. 

 

As such, to further check on this, I used the CRM API | Properties 

GET /crm/v3/properties/contacts

 

and I wasn't able to locate property `deal_unique_id`. 

 

Since property `deal_unique_id` doesn't exist, it is expected that the search endpoint throw the 400 property not found error.

0 Upvotes
Highlighted
New Contributor

Hi Wendy,

I am using CRM search (https://developers.hubspot.com/docs/api/crm/search) and method = POST.

Please find my screen shot .

 

  1. I have created a product.
  2. I am searching the same product but returning 0 result.
  • Product created - 

ProductCreate.JPG

  • Product search returning 0 result -
  • ProductSearch.JPG
0 Upvotes