APIs & Integrations

sanjay1001
Member

Issue in create polling on hubspot apis

Hello ,

Please anyone can help me to sort the issue of how we do polling on hubspot because i have seen that on API guidelines of hubspot and also tested the apis that it has provided , most of the apis cannot contains any ‘param’ that poll either updated or newly created record according to two timestamps .

Thanks & Regards
Sanjay

0 Upvotes
5 Replies 5
sanjay1001
Member

Issue in create polling on hubspot apis

Thanks @dadams for your help .

0 Upvotes
sanjay1001
Member

Issue in create polling on hubspot apis

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Issue in create polling on hubspot apis

Any endpoints will work the same with with either hapikey= or access_token=, so you can use either form of authentication.

The GET /contacts/v1/lists/recently_updated/contacts/recent endpoint returns any contacts updated in the last 30 days, starting with the most recently updated records, and there isn’t a way to limit how far back the endpoint itself will go. If you’re checking for new records at midnight each day, you’d need to page backwards through the contacts until you get a "time-offset" in the response that is before midnight the previous night, at which point you’d have all of the contacts updated in the last 24 hours.

You can find more details for using the recently updated endpoint here:
http://developers.hubspot.com/docs/faq/how-do-i-use-vidoffset-and-timeoffset

0 Upvotes
sanjay1001
Member

Issue in create polling on hubspot apis

Hi @dadams,

Thanks for the reply .

Suppose we got all the contacts via hubspot API : https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=demo
and for polling i have fixed the api call at every midnight by the use of API , https://api.hubapi.com/contacts/v1/lists/recently_updated/contacts/recent?hapikey=demo

the let me know , the polled data which we got from 'http://developers.hubspot.com/docs/methods/contacts/get_recently_updated_contacts
1 . Is it contains all contact records including that we saved into first time also ?
2 . Is it contains only those contact records from the last record that we had inserted into DB.
if yes , then OK
and if no , then what parameter shall i pass with API url that we will get only recent record from the last record of DB.

Thanks
Sanjay

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Issue in create polling on hubspot apis

Hi @sanjay1001

What objects are you trying to poll for? How you poll for new items is going to depend on what objects you’re looking at.

For Contacts, Companies, and Deals, there are specific endpoints that get recently created items. The endpoints start with the most recently created items, and you’d need to page backwards (as details on the documentation pages) till you reach the last time you polled for updates.

Get recently updated and created contacts | Contacts API

GET /contacts/v1/lists/recently_updated/contacts/recent - For a given portal, return all contacts that have been recently updated or created. A paginated list of contacts will be returned to you, with a maximum of 100 contacts per page, as specified...



Other objects (such as blog posts and other COS content) support filtering by the created property. This request would return all blog posts created this year:
https://api.hubapi.com/content/api/v2/blog-posts?created__gt=1451624400000&hapikey=demo

Keep in mind that most of our endpoints have a limit to the number of items they’ll return in a single response, so you may need to page through the results even with endpoints that support filters.

0 Upvotes