APIs & Integrations

amorrell
Member

REST call to retrieve changed records from a given date

SOLVE

I'm trying to retrieve contact records from hub spot which have been changed from a given date. It looks like the modified date is a large integer value. What format is that please?

Also interested to know whether there is a way to run a query to retrieve contacts changed from a date I can supply.

It appears that the result set is limited by a max of 100 records,presumably to keep the json response inside a limit.

1 Accepted solution
Willson
Solution
HubSpot Employee
HubSpot Employee

REST call to retrieve changed records from a given date

SOLVE

Hey @amorrell 

 

This timestamp will be UNIX timestamp in milliseconds. For the searching of contacts, this can be done by using our new CRM Search endpoint, take a look here: https://developers.hubspot.com/docs/api/crm/search

 

With this endpoint, you can define search parameters such as:

{
    "filterGroups":[
      {
        "filters":[
          {
            "propertyName": "lastmodifieddate",
            "operator": "GTE",
            "value": "1588546800000" (May 4th, 2020 12:00 AM)
          }
        ]
      }
    ]
  }

I hope this helps!

Product Manager @ HubSpot

View solution in original post

2 Replies 2
Willson
Solution
HubSpot Employee
HubSpot Employee

REST call to retrieve changed records from a given date

SOLVE

Hey @amorrell 

 

This timestamp will be UNIX timestamp in milliseconds. For the searching of contacts, this can be done by using our new CRM Search endpoint, take a look here: https://developers.hubspot.com/docs/api/crm/search

 

With this endpoint, you can define search parameters such as:

{
    "filterGroups":[
      {
        "filters":[
          {
            "propertyName": "lastmodifieddate",
            "operator": "GTE",
            "value": "1588546800000" (May 4th, 2020 12:00 AM)
          }
        ]
      }
    ]
  }

I hope this helps!

Product Manager @ HubSpot
amorrell
Member

REST call to retrieve changed records from a given date

SOLVE

I'm now looking to build integration from our own application into HubSpot and can do this with the hapikey approach but now want to implement OAuth2. For the purpose that we have there is NO connected user as we run the REST calls from a thread on a server.

I'm stuggling to work out what we need to build to get the initial token as most of the documentation seems to assume I'm integrating a browser based application.

Ideally if I have the values required to make a call via SOAP UI I can work it all out from there. I have the client id and client secret but not sure what I need for the redirect_uri or code parameters. Can you help?

0 Upvotes