Use Case

Partial batch acceptance: valid and invalid items

A System Integrator (SI) submits a batch where some measurements are valid and some are not (for example, a detector code that does not exist, or a reserved field set to a non-null value). 

The service processes all items independently, accepts the valid ones, and returns HTTP 207 with per-item rejection details for the invalid ones. 

The SI can then retry only the rejected items.

The endpoint is:

POST
https://api.ptvgroup.tech/dataprovider/ingestion/v1/detectors/data/ingest

Path parameter 

Not applicable.

Query parameters 

No query parameters are needed.

Example of request

The endpoint is:

https://api.ptvgroup.tech/dataprovider/ingestion/v1/detectors/data/ingest

Host: api.ptvgroup.tech

Authorization: apiKey YOUR_API_KEY

Accept: application/json compressed (gzip)

Example of payload

{
 "measurements": [
   {
     "detectorCode": "DET-001",
     "measureTypeCode": "SPEED",
     "timestampFrom": "2026-06-25T10:00:00Z",
     "timestampTo": "2026-06-25T10:05:00Z",
     "value": 52.5,
     "quality": 0.93
   },
   {
     "detectorCode": "DET-UNKNOWN",
     "measureTypeCode": "SPEED",
     "timestampFrom": "2026-06-25T10:00:00Z",
     "timestampTo": "2026-06-25T10:05:00Z",
     "value": 48.0,
     "quality": 0.89
   },
   {
     "detectorCode": "DET-002",
     "measureTypeCode": "FLOW",
     "timestampFrom": "2026-06-25T10:00:00Z",
     "timestampTo": "2026-06-25T10:05:00Z",
     "value": 1100.0,
     "quality": 0.95
   },
   {
     "detectorCode": "DET-003",
     "measureTypeCode": "SPEED",
     "timestampFrom": "2026-06-25T10:00:00Z",
     "timestampTo": "2026-06-25T10:05:00Z",
     "value": 60.0,
     "linkId": "LINK-99"
   }
 ]
}

The payload must be compressed (gzip) before to be sent.

In the payload you can recognize four items associated to four detectors.

Some infomation are optional, for example the information about quality of the value, that is specified to express the reliability of the measure.

The mandatory information are:

  • detectorCode
  • measureTypeCode
  • timestampFrom
  • timestampTo
  • value

 

Response

HTTP 207 - Multi-Status. The details for each state are provided in the body of the response.

{
 "accepted": 2,
 "rejected": 2,
 "rejections": [
   {
     "index": 1,
     "error": {
       "description": "Detector does not exist for the product instance.",
       "errorCode": "UNKNOWN_DETECTOR",
       "parameter": "measurements[1].detectorCode"
     }
   },
   {
     "index": 3,
     "error": {
       "description": "Reserved field must be null.",
       "errorCode": "RESERVED_FIELD",
       "parameter": "measurements[3].linkId"
     }
   }
 ]
}

Two items has been accepted, the item 0 and the item 2.

Two items has been considered invalid and rejected, the item 1 and the item 3.

  • Item 1: detectorCode value is set to "DET-UNKNOWN", and it is not present in the product instance.
  • Item 3: linkId is set to "LINK-99", therefore is not null.

Now the SI can build a new payload based on a correct version of the items 1 and 3, and repeat the cycle.