When I post a payload to the Backend API I get an unexpected response indicating that an invalid value was specified for the date field.
{
"type": "INVALID_VALUE",
"title": "Invalid value specified.",
"detail": "Invalid option \"Jan 01 2024\" for field 'ticket_date'.",
"see": "https://resources.journeyapps.com/v4/api/errors/INVALID_VALUE"
}
What format should I use when posting dates to the Backend API?
Here are the two requirements for date
and datetime
:
date |
A date in the format YYYY-MM-DD, as defined by the ISO 8601 specification. Example: “2016-02-27”. |
Any valid date according to the ISO 8601 specification. Any time or timezone components will be stripped. The YYYY-MM-DD format is recommended. Example: “2016-02-27” |
datetime |
A date and time in the format YYYY-MM-DDTHH:MM:SSZ, as defined by the ISO 8601 specification. Note that the time is specified in the UTC/GMT timezone. Example: “2016-02-22T14:00:53Z”. |
Any valid date and time according to the ISO 8601 specification. The YYYY-MM-DDTHH:MM:SSZ format is recommended. Example: “2016-02-22T14:00:53Z”. |
For more information, please see the Field Representation guide on the JourneyApps documentation.