APIs & Integrations

Not applicable

Get recently updated and created contacts returns semi-empty result | Contacts API

SOLVE

I am using this API endpoint and for some reason after paging through the data I sometimes get a response that has its "has-more" property as true but the contacts list is empty and both the vid-offset and time-offset are 0.

Any idea why this happens? I am using the "has-more" to decide if I should fetch the next page but I can't fetch with those values for the next page.

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Get recently updated and created contacts returns semi-empty result | Contacts API

SOLVE

Hi @cegadmin,

Is it possible that you're updating contacts while still pulling recently updated records? Since the endpoint returns a list of records by last modified date (rather than a log of all updates), any subsequent changes to records that have already been pulled could invalidate the vid-offset value and cause this behavior.

If you're looking for a log of all changes to contacts, you could also use this endpoint and just change tickets to contacts. For example: https://api.hubapi.com/crm-objects/v1/change-log/contacts?hapikey=demo.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
1 Reply 1
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Get recently updated and created contacts returns semi-empty result | Contacts API

SOLVE

Hi @cegadmin,

Is it possible that you're updating contacts while still pulling recently updated records? Since the endpoint returns a list of records by last modified date (rather than a log of all updates), any subsequent changes to records that have already been pulled could invalidate the vid-offset value and cause this behavior.

If you're looking for a log of all changes to contacts, you could also use this endpoint and just change tickets to contacts. For example: https://api.hubapi.com/crm-objects/v1/change-log/contacts?hapikey=demo.

Isaac Takushi

Associate Certification Manager
0 Upvotes