White Papers
Abstract
This artcile explains how the dates should be configured in a Datalink REST connector configuration. It also explains how the connector can error-out when dates are not configured correctly.
Content
To reference date elements that change regularly, you can use these date variables:
- {M} – month as a single digit (1, 2, …)
- {MM} – month as two digits (01, 02, …)
- {MMM} – three‑letter month abbreviation (Jan, Feb, …)
- {CY} – two‑digit calendar year (assumes a “20” prefix)
- {CYYY} – four‑digit calendar year (2012, 2013, 2014)
However, Dynamic date arguments such as {DD} are not supported.

If we provide a fixed date query argument, the REST connector returns the error {"messages":{"to":["Not a valid datetime."]}} when the end‑date parameter is set to an invalid date. However, this issue won’t be generated on the Datalink side because there’s no date‑validation logic to verify whether a valid date was entered there.
According to the Engineering team, the connector will continue to function even if the “to” date is set to the 31st for a month that only has 30 or 28 days. If date validation is being applied on the customer’s side applications, that’s where the error would appear.

When we execute the REST query in Postman (or a similar api tool) using fixed date parameters for a month that is invalid, the error appears as follows:

The problem occurs when users combine the {CYYY} and {MM} variables with a fixed date number. The connector cannot retrieve records if the fixed day does not match the month’s actual last day.
Specifically, the connector fails whenever the to date is not a valid calendar date for that month. For instance, a request containing Feb 31 triggers a 400 – Bad Request response, while a valid date such as Feb 28 works correctly.
When configuring date arguments for a REST connector, below are the key points to be noted:
- The API requires a real end‑of‑month date (e.g., 2024‑02‑29 or 2024‑04‑30). Non‑existent dates like February 30 or April 31 are rejected as invalid datetime values.
- To retrieve an entire month’s data, set the to parameter to the start of the following month (e.g., 2024‑03‑01T00:00:00Z) so that all usage up to the last second of the previous month is captured.
Was this topic helpful?
Document Information
Modified date:
06 May 2026
UID
ibm17270366