APIs & Integrations

Bisina
Member

API call to Search by last modified date in Tickets

Hi all,

 

I am trying to create a search API call to filter tickets by the last modified date [hs_lastmodifieddate]. I am passing the time converted to milliseconds. The codebase is in python.

 

datetime_string = '2020-10-02T08:50:00.000'
converted = datetime.strptime(datetime_string, '%Y-%m-%dT%H:%M:%S.%f')
check_time = int(converted.timestamp() * 1000)
print(check_time)

 

data_tickets_time = json.dumps({
"properties": [ "hs_lastmodifieddate", "hs_object_id" , "subject" ],
"filterGroups": [{
"filters": [{
"propertyName": "hs_lastmodifieddate",
"operator": "GTE",
"value": check_time
}]
}]
})

 

The Issue is that this filter returns all the records not just the records specified as GTE (Greater the or equal to) the given time. I wanted to return records that are created at or after the given time.

 

Thank in advance, Any help in this matter is highly appreciated.

 

 

 

 

0 Upvotes
1 Reply 1
devpriyamishra
Participant

API call to Search by last modified date in Tickets

Hii @Bisina 

 

It could be because of HubSpot understands the date/time converted into midnight.. Can you try that adding into your code??
Also if you want can try sorting the tickets based on last modfied property using same API.. See if this works?

I will try this on my end too.

Thanks!

0 Upvotes