Expand my Community achievements bar.

Latest Community Ideas Review is Out: Discover What’s New and What to Expect!

API Call Query String of Date Range

Avatar

Level 9

 I'm doing an API call of Hours data and I'm not sure how to filter a certain date range in the queue string.  Does anyone know how I would filter that? I want Hours logged this year or at least Hour Entry Date greater than Jan 1 2024.

KIMBERLYREA_0-1710507630315.png

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Level 6

https://github.com/Workfront/workfront-api-constants/blob/master/src/constants.ts keyed me into a bunch of stuff, like the OR:x:condition syntax and the _Mod expression modifiers and things like "between" for date ranges.  The Adobe documentation then added more color to it.

I'm not fully following your desired boolean expression, though.  It may be helpful to write out the boolean as something like this first:

(DATE >= 2023-01-01 AND DATE <= 2023-07-01) OR (DATE >= 2024-01-01)

From there, you can figure out how to do this in the API:

hour/search?entryDate_Mod=between?entryDate=2023-01-01&entryDate_Range=2023-07-01&OR:1:entryDate_Mod=gte&OR:1:entryDate=2024-01-01

Note that the API syntax does not support all types of boolean conditions that you can write out.