APIs & Integrations

CTIKD
Participant

Search API for Contacts return Bad Request

SOLVE

Just created a new test instance and the search API for contacts is returning 400 Bad Request. The exact same query works in my other test instance (tested with Postman only changing the API key value).  I am using a filter with a custom field. The custom field exists in the new instance as it does in the old one.

 

Is there something I need to configure in HubSpot to allow the Contacts search API to work?

0 Upvotes
2 Accepted solutions
tominal
Solution
Guide | Partner
Guide | Partner

Search API for Contacts return Bad Request

SOLVE

Permissions don't apply to the API key if you generated it from the dev instance. What about the internal property name? The internal name of the property you're targeting could have a little "_" at the end if you accidentally hit your space bar when creating it on the dev instance. If both internal names from both HubSpot portals match I'm not sure what it could be without seeing your requests.

Also, the "dev instance" you're talking about is a HubSpot portal generated via a HubSpot App test account right?

Hope that helps.


Thomas Johnson
Community Champion


Kahu Software LLC
A Texan HubSpot consulting firm
https://kahusoftware.com

View solution in original post

CTIKD
Solution
Participant

Search API for Contacts return Bad Request

SOLVE

Thanks for your help. I found where the internal field name could be found (click on the "</>" in Edit property) for the custom field that gets searched and it was not what it should be, and I cannot update it. I will have to change some fields and probably re-load my test data.

View solution in original post

7 Replies 7
CTIKD
Participant

Search API for Contacts return Bad Request

SOLVE

Yes. You do have to rename the property to something else before deleting to the property recycle bin if you want to use the same name.

CTIKD
Solution
Participant

Search API for Contacts return Bad Request

SOLVE

Thanks for your help. I found where the internal field name could be found (click on the "</>" in Edit property) for the custom field that gets searched and it was not what it should be, and I cannot update it. I will have to change some fields and probably re-load my test data.

tominal
Guide | Partner
Guide | Partner

Search API for Contacts return Bad Request

SOLVE

You could delete the property and re-add it. During the creation process you can specify the internal name there.


Thomas Johnson
Community Champion


Kahu Software LLC
A Texan HubSpot consulting firm
https://kahusoftware.com
CTIKD
Participant

Search API for Contacts return Bad Request

SOLVE

API key is correct as it is working with the Company search with a similar query to /crm/v3/objects/companies/search

The HubSpot dev instance is the same as another I have where both Contact and Company search queries are working.

Could this be a permissions issue to use Contact search in my new test instance?

0 Upvotes
tominal
Solution
Guide | Partner
Guide | Partner

Search API for Contacts return Bad Request

SOLVE

Permissions don't apply to the API key if you generated it from the dev instance. What about the internal property name? The internal name of the property you're targeting could have a little "_" at the end if you accidentally hit your space bar when creating it on the dev instance. If both internal names from both HubSpot portals match I'm not sure what it could be without seeing your requests.

Also, the "dev instance" you're talking about is a HubSpot portal generated via a HubSpot App test account right?

Hope that helps.


Thomas Johnson
Community Champion


Kahu Software LLC
A Texan HubSpot consulting firm
https://kahusoftware.com
tominal
Guide | Partner
Guide | Partner

Search API for Contacts return Bad Request

SOLVE

Without more information, if you're using the API key then I would double check that it's correct. Also, if you're turning your request in Postman into code, be careful of those filterGroups. They are arrays of objects and then there are filter arrays of objects.


Thomas Johnson
Community Champion


Kahu Software LLC
A Texan HubSpot consulting firm
https://kahusoftware.com
CTIKD
Participant

Search API for Contacts return Bad Request

SOLVE

For reference I am using the CRM Search API : CRM API | Search (hubspot.com)

 

0 Upvotes