Hey, @sPandhare
Can you share a specific example? One that includes the specific property you are searching for? First Name, for example?
Your formatting doesn’t look up-to-date, as HAPI keys are no longer in use.
Here’s one way you could approach it.
I have 5 contacts who have J in their first names — AJ, Jeff, Aaja, Jimmy, and Jaycee. Here’s how I structured my Search API request using Postman:
{
"filterGroups": [
{
"filters": [
{
"propertyName": "firstname",
"operator": "CONTAINS_TOKEN",
"value": "*j*"
}
]
}
],
"limit": 20,
"properties": [
"firstname",
"lastname",
"email"
]
}
Response
{
"total": 5,
"results": [
{
"id": "301",
"properties": {
"createdate": "2022-07-08T04:15:03.373Z",
"email": "jaycee@testerrr.com",
"firstname": "Jaycee",
"hs_object_id": "301",
"lastmodifieddate": "2023-09-28T02:19:46.849Z",
"lastname": null
},
"createdAt": "2022-07-08T04:15:03.373Z",
"updatedAt": "2023-09-28T02:19:46.849Z",
"archived": false
},
{
"id": "1801",
"properties": {
"createdate": "2023-06-02T17:08:49.120Z",
"email": "jimmy@jimmypestopizzeria.com",
"firstname": "Jimmy",
"hs_object_id": "1801",
"lastmodifieddate": "2023-10-27T22:35:49.162Z",
"lastname": "Pesto"
},
"createdAt": "2023-06-02T17:08:49.120Z",
"updatedAt": "2023-10-27T22:35:49.162Z",
"archived": false
},
{
"id": "1901",
"properties": {
"createdate": "2023-11-16T20:26:57.570Z",
"email": "jeff@testerrr.com",
"firstname": "Jeff",
"hs_object_id": "1901",
"lastmodifieddate": "2023-11-16T20:27:27.693Z",
"lastname": "Jeff"
},
"createdAt": "2023-11-16T20:26:57.570Z",
"updatedAt": "2023-11-16T20:27:27.693Z",
"archived": false
},
{
"id": "1951",
"properties": {
"createdate": "2023-11-16T20:27:13.733Z",
"email": "aaja@testerrr.com",
"firstname": "Aaja",
"hs_object_id": "1951",
"lastmodifieddate": "2023-11-16T20:27:48.102Z",
"lastname": "Aaja"
},
"createdAt": "2023-11-16T20:27:13.733Z",
"updatedAt": "2023-11-16T20:27:48.102Z",
"archived": false
},
{
"id": "1902",
"properties": {
"createdate": "2023-11-16T20:27:39.415Z",
"email": "aj@testerrr.com",
"firstname": "AJ",
"hs_object_id": "1902",
"lastmodifieddate": "2023-11-16T20:28:07.743Z",
"lastname": "AJJJ"
},
"createdAt": "2023-11-16T20:27:39.415Z",
"updatedAt": "2023-11-16T20:28:07.743Z",
"archived": false
}
]
}
You could use a different property in your filter group to search with, and you can specify what properties are returned in the request to suit your needs.
Have fun building! — Jaycee