Getting error while fetching some crm object

Hi everyone,

I’m trying to fetch all data from a given list of objects using the HubSpot API. For some reason, it works for some objects but returns an error for others.

For example:

  • contacts → works correctly
  • companies, notes, deals → return the following error:
data: {
status: 'error',
message: 'There was a problem with the request.',
correlationId: '019cd930-a23a-75e2-8b23-3b6627a2278a'
}

Am I missing something here? It’s my first time working with HubSpot, so I’d appreciate any guidance on what might be going wrong.

Thanks!

Hi @RRaj21,

Welcome to the Community!

To better understand your issue here, would you mind including the body of your Request and Response?
In the meantime, I’d like to tag in some of our experts to see if they’ve dealt with something similar before!

Hi @RubenBurdin, @evaldas, @SteveHTM -- Do you have any suggestions for @RRaj21 on the above API response?
Thanks!

Sam, Community Manager

Sure, here is the request and response details:

Endpoint:
POST https://api.hubapi.com/crm/v3/objects/0-2/search
Request Body:

{
 "filterGroups": [
 {
 "filters": [
 {
 "propertyName": "lastmodifieddate",
 "operator": "GTE",
 "value": "1773121402418"
 }
 ]
 }
 ],
 "properties": [
 "about_us",
 "address",
 "address2",
 "annualrevenue",
 "city",
 "closedate",
 "country",
 "createdate",
 "days_to_close",
 "description",
 "lastmodifieddate"
 ],
 "limit": 1
}

Status code: 400

Response Body:

{
 "status": "error",
 "message": "There was a problem with the request.",
 "correlationId": "019cdb6b-d944-739a-af1a-0873266bf422"
}

I’m trying to fetch multiple objects data modified in the last X days using the search API.

This works correctly for contacts, but the same request returns 400 for the following:

 { name: "companies", objectTypeId: "0-2"},
 { name: "deals", objectTypeId: "0-3"},
 { name: "tickets", objectTypeId: "0-5"},
 { name: "products", objectTypeId: "0-7"},
 { name: "line_items", objectTypeId: "0-8"},
 { name: "calls", objectTypeId: "0-48"},
 { name: "emails", objectTypeId: "0-49"},
 { name: "meetings", objectTypeId: "0-47"},
 { name: "notes", objectTypeId: "0-4"},
 { name: "tasks", objectTypeId: "0-27"},
 { name: "order", objectTypeId: "0-123"},

Please let me know if anything else is required from my side.

Thanks!

Hi everyone,
So, the issue was the wrong filters. I found that lastmodified field only exists in the contacts and not in other objects and thats why I was getting that error.