v3 API search company , deals, contacts, tickets

I’m using /crm/v3/objects/{object}/search this search v3 API for searching companies, deals, contacts, and tickets.

curl https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=YOUR_HUBSPOT_API_KEY \
 --request POST \
 --header "Content-Type: application/json" \
 --data '{
 "query" : "ick"
 }'

I’m looking for results on property containing a particular letter(s)/word(s),
Now It returns results only matching with start with the initial letters.
E.g.: Contact Name:- John Wick.
Now getting results on Joh, Wic, Jo, and Wi these search keys.
but result should get on ohn, hn, ick these types of search keys.

Hey, @sPandhare :waving_hand: 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

Jaycee, specifying properties doesnt seem to limit the response only to those properties. Can you help how to request a limited set of properties?

Hello @Jaycee_Lewis
great, thanks!