APIs & Integrations

jing
Participant

request url too long

SOLVE

When I am getting data from hubspot api, for example: https://api.hubapi.com/crm/v3/objects/companies. If I include all properties, an error would occur saying the 'request url too long'. Is there any parameters that can select all properties automatically instead of passing wanted properties in request url?

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

request url too long

SOLVE

Hey @jing,

 

Currently, there isn't a way to select all properties automatically and one possible way to include all properties without exceeding the request url limit, is to use the CRM API | Search.

 

In which you can control the returned properties on the POST body instead of the request url:

curl https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=YOUR_HUBSPOT_API_KEY \
  --request POST \
  --header "Content-Type: application/json" \
   --data '{
    "properties": [ "email", "state" ]
   }'

View solution in original post

2 Replies 2
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

request url too long

SOLVE

Hey @jing,

 

Currently, there isn't a way to select all properties automatically and one possible way to include all properties without exceeding the request url limit, is to use the CRM API | Search.

 

In which you can control the returned properties on the POST body instead of the request url:

curl https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=YOUR_HUBSPOT_API_KEY \
  --request POST \
  --header "Content-Type: application/json" \
   --data '{
    "properties": [ "email", "state" ]
   }'
jing
Participant

request url too long

SOLVE

Thank you so much! That is exactly what I want.

0 Upvotes