APIs & Integrations

Not applicable

Can't issue cURL command on Contacts when count is specified

Hi,

I am able to authorize the OAUTH connection fine, and also use the cURL command in order to get the defaulted amount of 20 contacts. However, when i append the &count=100 or &count=5, or any type of amount then my cURL does not work within the command line. It is weird because I can get the specified amount of results that I want if I place the URL within a browser where it will show my specified amount of results right in the browser page perfectly. Its only when I issue the exact URL within my command line where the request seems to just hang as it never returns back. Here is my command:

curl -H "Authorization: Bearer xxxx-xxxxx-xxxxx-xxxxxx" https://api.hubapi.com/contacts/v1/lists/all/contacts/recent?hapikey=xxxx-xxxxx-xxxxx-xxxxxx&count=5

Also just to clarify we have over a thousand records that are within the Hubspot App, but don't know as to why the command hangs only in command line when the amount is specified?

Any help will be appreciated!!! Thanks.

0 Upvotes
3 Replies 3
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Can't issue cURL command on Contacts when count is specified

Hi @Bryson_Watabu,

Are you referring to the 'Get timeline event types' endpoint listed below? That endpoint (and the entire Timeline API) is related to creating/managing custom timeline events. The forum post you linked to appears to be about pulling a contact's entire timeline, which isn't currently possible.

0 Upvotes
Not applicable

Can't issue cURL command on Contacts when count is specified

Hi Derek,

I got the curl command to work now, however I am experiencing data pulling issues when trying to "Get All Timeline Event Types". Here is the request curl command that I am using:

curl -o json-data/timeline-event-type.json -H "Authorization: Bearer "+bearer https://api.hubapi.com/integrations/v1/53332/timeline/event-types?hapikey=3da0a0b9-b8cf-403f-8139-25...

The returned JSON response is:
{"status":"error","message":"UserId not provided in request","correlationId":"5d16b428-e548-4106-bd29-b263d2836a67","requestId":"50ca607669586de229ee94b13d6db44b"}

It is saying that it requires a userId, but according to this developer forum article it says that HubSpot does not currently support getting Event timelines by userId:

How To Get Contact's Timeline Events via API?]

Are there any solutions? Any help will be appreciated.
Thanks!

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Can't issue cURL command on Contacts when count is specified

Hi @Bryson_Watabu,

& is used in unix systems to tell the shell to evaluate the previous command int he background. Wrapping the URL in single quotes should do the trick.

0 Upvotes