APIs & Integrations

jing
Participante

request url too long

resolver

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 Me gusta
1 Soluciones aceptada
WendyGoh
Solución
HubSpot Employee
HubSpot Employee

request url too long

resolver

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" ]
   }'

Ver la solución en mensaje original publicado

2 Respuestas 2
WendyGoh
Solución
HubSpot Employee
HubSpot Employee

request url too long

resolver

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
Participante

request url too long

resolver

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

0 Me gusta