AI-generated Key Takeaways
-
Report queries use the
date_rangefield to specify the dates for data inclusion, with several predefined relative date options available. -
The default
date_rangewhen none is specified isCUSTOM, requiring the setting ofstart_dateandend_dateparameters. -
Custom date ranges are specified using separate
year,month, anddayparameters for both the start and end dates in API requests.
Relative date ranges
Report queries have a date_range field for specifying the dates for which to include
data in the report. The following values can be specified for date_range:
TODAYYESTERDAYMONTH_TO_DATEYEAR_TO_DATELAST_7_DAYSLAST_30_DAYSCUSTOM
Note that the default date range if none is specified is CUSTOM.
Custom date ranges
When date_range is set to CUSTOM or is
unspecified, you must set start_date and end_date to
the (inclusive) start and end dates of the report range.
In your API request's query parameters, the start date parameters will look like this:
startDate.year=2021&startDate.month=3&startDate.day=1
Similarly, the end date parameters will look like this:
endDate.year=2021&endDate.month=3&endDate.day=3