If your API supports start and end dates in the request URL, you can use the below settings to have those dynamically updated by the date selection in the report itself. There are a variety of formats to work with different requirements of the source API.
Note - if the API does not support date fields/ranges as part of the request for data, you will not be able to use these. If you are unsure if your API supports these, please consult the appropriate API documentation for what is allowed in a request call to their service.
To use the dynamic dates feature, find the place in your Source URL where the start/end dates would be defined, and instead of hardcoding the dates, add the placeholder string instead.
Modified URL with placeholders:
The modified URL is then placed into the Source URL field of the main configuration and Data Studio then should pass the date range parameters used for the report/report object into those fields dynamically update the request.
Do make sure the date format matches what the API web service is expecting. For example, if the date is expected to be YYYY-MM-DD, then you would use #sdate# and #edate#. Here are all the available formats for both start dates and end dates:
|Date Type and format||Placeholder text to use|
|Start date requiring y-m-d format||#sdate#|
|Start date requiring ymd format||#sdate_ymd#|
|Start date requiring unix timestamp format||#sdate_u#|
|End date requiring y-m-d format||#edate#|
|End date requiring ymd format||#edate_ymd#|
|End date requiring unix timestamp format||#edate_u#|