API Call Query String of Date Range | Community
Skip to main content
KIMBERLYREA
Community Advisor
Community Advisor
March 15, 2024
Question

API Call Query String of Date Range

  • March 15, 2024
  • 1 reply
  • 1006 views

 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.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Level 5
March 15, 2024

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.