Skip to content
This repository has been archived by the owner on Aug 25, 2020. It is now read-only.
Amy Mok edited this page Jun 11, 2019 · 4 revisions

When using validation service, the /data-ingest/validate endpoint requires a POST body. This body can only be in JSON format (Content-Type: application/json) at this point. HTTP Content-Type header is needed when sending the POST request.

JSON

The data will be an array of a single object. This can be saved in a file, and then pass to the endpoint for validation. See REST API for details on how to do a POST request with this data.

Sample JSON POST body with valid data (the response will have no errors)

[
  {
    "identifier": "5220",
    "startDateTime": {
      "startDateTime-ver": "2017-06-12 16:30:00",
      "timeConfidenceLevel": 0.5
    },
    "endDateTime": {
      "endDateTime-ver": "2021-12-31 17:00:00",
      "timeConfidenceLevel": 0.5
    },
    "beginLocation": {
      "roadName": "I-1175",
      "roadNum": "I-1175",
      "roadDirection": "northbound",
      "latitude-ver": -44.350189,
      "longitude-ver": 28.487378,
      "milepost-ver": 45.0,
      "crossStreet": "Washington"
    },
    "endLocation": {
      "latitude-ver": -44.350189,
      "longitude-ver": 28.487378,
      "milepost-ver": 54.0,
      "crossStreet": "Washington"
    },
    "wz_status": "Active",
    "totalLanes": "4",
    "openLanes": "none",
    "closedLanes": "all",
    "closedShoulders": "unknown",
    "workersPresent": true,
    "roadRestrictions": ["no-trucks", "no-parking", "permitted-oversize-loads-prohibited"],
    "description": "Lanes blocked in both directions between mm 45 - 54 from 8am - 5pm each day for road widening work. Expect delays.",
    "issuingOrganization": "CQT",
    "timestampEventCreation": "2017-06-12 16:54:00",
    "timestampEventUpdate": "2017-06-12 16:54:00"
  },
  {
    "identifier": "5222",
    "startDateTime": {
      "startDateTime-ver": "2017-06-12 16:55:00"
    },
    "endDateTime": {
      "endDateTime-ver": "2021-07-31 17:00:00"
    },
    "beginLocation": {
      "roadName": "US-0166",
      "roadDirection": "southbound",
      "latitude-est": -44.184075,
      "longitude-ver": 29.452345,
      "milepost-ver": 0.0
    },
    "endLocation": {
      "latitude-est": -44.184075,
      "longitude-est": 29.452345,
      "milepost-ver": 8.0
    },
    "closedLanes": "all",
    "description": "Look out for lane blocked between mm 0 - 8 for long-term road-widening project.",
    "issuingOrganization": "CQT",
    "timestampEventCreation": "2017-06-12 17:04:00",
    "timestampEventUpdate": "2017-06-12 17:04:00"
  }
]

Sample JSON POST body with invalid data (the response will have errors)

[
  {
    "identifier": 5220,
    "StartDateTime": {
      "startDateTime-est": "2017-06-12 16:30:00",
      "startDateTime-ver": "2017-06-12 16:30:00",
      "startDateTime-cancelled": null,
      "timeConfidenceLevel": null
    },
    "EndDateTime": {
      "endDateTime-est": "2021-12-31 17:00:00",
      "endDateTime-ver": "2021-12-31 17:00:00",
      "endDateTime-cancelled": null,
      "timeConfidenceLevel": null
    },
    "BeginLocation": {
      "roadName": "I-1175",
      "roadNum": null,
      "roadDirection": null,
      "latitude-est": -44.350189,
      "latitude-ver": -44.350189,
      "longitude-est": 28.487378,
      "longitude-ver": 28.487378,
      "milepost-est": 45.0,
      "milepost-ver": 45.0,
      "crossStreet": null
    },
    "EndLocation": {
      "roadName": "I-1175",
      "roadNum": null,
      "roadDirection": null,
      "latitude-est": -44.350189,
      "latitude-ver": -44.350189,
      "longitude-est": 28.487378,
      "longitude-ver": 28.487378,
      "milepost-est": 54.0,
      "milepost-ver": 54.0,
      "crossStreet": null
    },
    "wz-Status": null,
    "totalLanes": null,
    "openLanes": null,
    "closedLanes": null,
    "closedShoulders": null,
    "workersPresent": null,
    "RoadRestritions": null,
    "description": "Lanes blocked in both directions between mm 45 - 54 from 8am - 5pm each day for road widening work. Expect delays.",
    "issuingOrganization": "CQT",
    "timeStampCreation": "2017-06-12 16:54:00",
    "timeStampUpdate": "2017-06-12 16:54:00"
  },
  {
    "identifier": 5222,
    "StartDateTime": {
      "startDateTime-est": "2017-06-12 16:55:00",
      "startDateTime-ver": "2017-06-12 16:55:00",
      "startDateTime-cancelled": null,
      "timeConfidenceLevel": null
    },
    "EndDateTime": {
      "endDateTime-est": "2021-07-31 17:00:00",
      "endDateTime-ver": "2021-07-31 17:00:00",
      "endDateTime-cancelled": null,
      "timeConfidenceLevel": null
    },
    "BeginLocation": {
      "roadName": "US-0166",
      "roadNum": null,
      "roadDirection": null,
      "latitude-est": -44.184075,
      "latitude-ver": -44.184075,
      "longitude-est": 29.452345,
      "longitude-ver": 29.452345,
      "milepost-est": 0.0,
      "milepost-ver": 0.0,
      "crossStreet": null
    },
    "EndLocation": {
      "roadName": "US-0166",
      "roadNum": null,
      "roadDirection": null,
      "latitude-est": -44.184075,
      "latitude-ver": -44.184075,
      "longitude-est": 29.452345,
      "longitude-ver": 29.452345,
      "milepost-est": 8.0,
      "milepost-ver": 8.0,
      "crossStreet": null
    },
    "wz-Status": null,
    "totalLanes": null,
    "openLanes": null,
    "closedLanes": null,
    "closedShoulders": null,
    "workersPresent": null,
    "RoadRestritions": null,
    "description": "Look out for lane blocked between mm 0 - 8 for long-term road-widening project.",
    "issuingOrganization": "CQT",
    "timeStampCreation": "2017-06-12 17:04:00",
    "timeStampUpdate": "2017-06-12 17:04:00"
  }
]

See REST API to understand how to put together a HTTP POST request. And see Validation Output to understand the response using these inputs.