APIs & Integrations

Athul_C
Teilnehmer/-in

CRM API v3 - Sort based on the modified date

lösung

Hi Hubspot team,

I was working around Hubspot API v3, and I have requirement of sorting contacts based on modified date.So is there any solution for the same.

Thanks 

Atul

0 Upvotes
1 Akzeptierte Lösung
Willson
Lösung
HubSpot Employee
HubSpot Employee

CRM API v3 - Sort based on the modified date

lösung

Hi @Athul_C 

 

When working with our v3 APIs, you can work specifically with our CRM Search API in order to Sort results by properties.

 

As an example, we can use the following request:

curl https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=YOUR_HUBSPOT_API_KEY \
  --request POST \
  --header "Content-Type: application/json" \
  --data '{
    "sorts": [
      {
        "propertyName": "lastmodifieddate",
        "direction": "DESCENDING"
      }
    ]
  }'

This would then fetch your Contacts and sort them according to the lastmodifieddate timestamp, in this particular case, those created most recently.

 

I hope this helps!

Product Manager @ HubSpot

Lösung in ursprünglichem Beitrag anzeigen

6 Antworten
vikram-mit
Teilnehmer/-in

CRM API v3 - Sort based on the modified date

lösung

how do i do it with regular object api like https://api.hubapi.com/crm/v3/objects/companies   say i want to sort by lastmodifieddate ?

dennisedson
HubSpot-Produktteam
HubSpot-Produktteam

CRM API v3 - Sort based on the modified date

lösung

@vikram-mit , this is only available for the search endpoint

0 Upvotes
DGodoy
Teilnehmer/-in

CRM API v3 - Sort based on the modified date

lösung

Hi, how can i get the results sorted using python? Thanks in advance!

0 Upvotes
Willson
Lösung
HubSpot Employee
HubSpot Employee

CRM API v3 - Sort based on the modified date

lösung

Hi @Athul_C 

 

When working with our v3 APIs, you can work specifically with our CRM Search API in order to Sort results by properties.

 

As an example, we can use the following request:

curl https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=YOUR_HUBSPOT_API_KEY \
  --request POST \
  --header "Content-Type: application/json" \
  --data '{
    "sorts": [
      {
        "propertyName": "lastmodifieddate",
        "direction": "DESCENDING"
      }
    ]
  }'

This would then fetch your Contacts and sort them according to the lastmodifieddate timestamp, in this particular case, those created most recently.

 

I hope this helps!

Product Manager @ HubSpot
kawyns1
Teilnehmer/-in

CRM API v3 - Sort based on the modified date

lösung

Hi @Willson ,

I am try to retrieve all the tickets data from a certain date -> basically filtering out the data since the lastmodifieddate. However, this is giving all my ticket records instead of just only the ones from the last modified date.

 

Any help / advice is appreciated, thank you.

0 Upvotes
Athul_C
Teilnehmer/-in

CRM API v3 - Sort based on the modified date

lösung

Hi willson,

Thank you for the quick response.This made my day.Smiley (fröhlich)

Regards

Athul

0 Upvotes