Error 414 when reading deals with all properties

Hi,

We are receiving an error 414 (Request-URI Too Large) when using this endpoint:

GET/crm/v3/objects/deals

We are inserting the array with all the deal related properties.

We are using the python code that are in the documentation:

Example:

api_response = client.crm.deals.basic_api.get_page(limit=10, archived=False)

How we have to do to read all the deals with all of the properties without receiving this error?

Is a bit critical for us.

Thanks in advance.

Hi, @adrivid :waving_hand: Thanks for reaching out. There is definitely a character limit when including all or a significant number of an object’s properties in the request URL. Have you tried using the Search API instead? Here are the published limitations:

  • It may take a few moments for newly created or updated CRM objects to appear in search results.
  • Archived CRM objects won’t appear in any search results.
  • The search endpoints are rate limited to four requests per second.
  • A query can contain a maximum of 3,000 characters. If the body of your request exceeds 3,000 characters, a 400 error will be returned.
  • The search endpoints are limited to 10,000 total results for any given query. Attempting to page beyond 10,000 will result in a 400 error.
  • When searching for phone numbers, HubSpot uses special calculated properties to standardize the format. These properties all start with hs_searchable_calculated_*. As a part of this standardization, HubSpot only uses the area code and local number. You should refrain from including the country code in your search or filter criteria.

Have fun building! — Jaycee

Support sent me here.

Would you have a sample curl statement for this?
I have the following working, but how do I get more than just the standard properties back?

curl https://api.hubapi.com/crm/v3/objects/deals/search \
--request POST \
--header “Content-Type: application/json” \
--header “authorization: Bearer MY_BEARER_TOKEN” \
--data ‘{
“filters”:
[
{
“propertyName”:“hs_object_id”,
“operator”:“EQ”,
“value”:“22123573901”
}
]
}’

Hey @SSwafford You’ll need to include a `properties` array in your request body. Here’s an old example I have saved in Postman (you can ignore the filter groups as they were for a different test):

{
 "filterGroups": [
 {
 "filters": [
 {
 "propertyName": "dealname",
 "operator": "CONTAINS_TOKEN",
 "value": "*Bob"
 }
 ]
 }
 ],
 "properties": [
 "dealname",
 "hs_object_id"

 ]
}

You’ll just need to make sure you comma-separate each property you want returned. There isn’t a way to get it to return “all” properties, you have to specify which properties you want returned.

Have fun testing! — Jaycee

Thank you for your help @Jaycee_Lewis .

Do you have any python library to use it or we have to do ir manually?

Thanks in advance.