API Reference

Parse a date

Description

Provides a simple endpoint to check whether a given date candidate parses with the provided format string. Both the date candidate and format strings are required. Returns a 200 if the date parses, or a 400 with a message if not. If the date parses, the provided format can be provided as column metadata, and the imported values parse correctly. The format string is java DateTimeFormatter style e.g. dateFormat = "MM/dd/yyyy" and candidate = "07/28/1987"

POST /api/v1/util/datetime

🚧

Required OAuth Scopes:

No OAuth scopes are required to use this endpoint.

Parameters

ParameterInTypeRequiredDescription
bodybodyDatetimeDtofalseThe representation of the datetime object to parse

Body parameter example

{
  "candidate": "string",
  "dateFormat": "string"
}

Code Samples

curl -X POST https://h.app.wdesk.com/s/wdata/prep/api/v1/util/datetime  \ 
-H 'Content-Type: application/json' \ 
-H 'Accept: application/json' \ 
-H 'Authorization: Bearer {access-token}'
http POST https://h.app.wdesk.com/s/wdata/prep/api/v1/util/datetime  \ 
Content-Type:application/json \ 
Accept:application/json \ 
Authorization:"Bearer {access-token}"
wget --method=POST "https://h.app.wdesk.com/s/wdata/prep/api/v1/util/datetime" \
 --output-document -  \ 
 --header 'Content-Type: application/json' \ 
 --header 'Accept: application/json' \ 
 --header 'Authorization: Bearer {access-token}'
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://h.app.wdesk.com/s/wdata/prep/api/v1/util/datetime', headers = headers)

print(r.json())

Returns

200 - OK

Returns a JSON object with a body property, which contains confirmation of the success.

Example Responses


{
  "body": "string",
  "code": "integer"
}