API | Dates in the API

#Enterprise

Updated over a week ago

Epoch Date Formatting

Our most recommended date formatting is Epoch Date formatting.

In a date field, you can enter the date in the following format: "\/Date(epoch date)\/"

For example, in a TouchPoint Update POST:

"ResponseCreatedDate": "\/Date(1571411927090)\/",
"ResponseCreatedDateAsString": "10/21/2019",
"ProgramID": 100,
"DraftSavedOn": "\/Date(1571411927090)\/",

The following button will take you to an Epoch converter to convert your dates.

Note: You will want to use the timestamp in milliseconds, otherwise you may get an incorrect date when the enrollment is added into ETO.

JSON Formatting

You may see JSON formatting for dates within the Swagger API platform 

The JSON dates look like this:

ResponseCreatedDate”: “2019-10-22T13:47:05.492Z”

Note: Although the Swagger API page produces some dates like this, within your own uploads/POST it is recommended to use EPOCH as a better ETO conversion.

Did this answer your question?