Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

BoB Inspection API provides a subset of the following services:

inspectTicket

services provided by BoB Validation API and is used for transmitting events resulting from ticket inspection.

inspectTicket

Inspect ticket by Ticket ID. If an eventResult is not provided, the result of the inspection is not known and the server is requested to perform online validation. In this case, the entire MTB should always be submitted via a query parameter.


Code Block
languagebash
titleExample request
linenumberstrue
collapsetrue
curl --verbose -X POST --data @- \
     --header "Content-Type: application/json" \
     --header "X-BoB-AuthToken: REDACTED_JWT" \
     https://inspection.bob.example.com/api/v1/inspection/57e53ddd731adf5bf07d2c12 <<JSON
{
    "ticketEvent": {
         "time": "2016-11-07T13:49:33.638462Z",
         "eventType": "inspection",
         "eventResult": 0,
         "localEventId": "b920d3e2-b1a4-4157-8bfd-c36c2de1fedb",
         "ticketId": "57e53ddd731adf5bf07d2c12",
         "mtbReference": {
             "pid": "1",
             "issuerSignature": "tYo2V_Sg9hYNXt9bJ7cyD3L7bUev35uMA2bZ2ykHuWh8NRQD2TbI6C7uWed4ia3Bm2lEa4d3pYVJfUAef39dKA"
         },
         "modeOfTransport": "bus",
         "service": {
             "pid": 1,
             "serviceId": "40",
             "tripId": "42",
             "blockId": "1"
         },
         "zone": {
             "pid": 1,
             "zoneId": "802"
         }
    }
}
JSON

...

Code Block
titleExample response
linenumberstrue
collapsetrue
Location: https://ticketing.bob.example.com/api/v1/ticket/57e53ddd731adf5bf07d2c12/event/2

reportInspections

Already performed inspections may be submitted in batch via reportInspections. The entire batch must accepted/rejected – there's no status reporting on individual events.


Code Block
languagebash
titleExample request
linenumberstrue
collapsetrue
curl --verbose -X POST --data @- \
     --header "Content-Type: application/json" \
     --header "X-BoB-AuthToken: REDACTED_JWT" \
     https://inspection.bob.example.com/api/v1/inspection <<JSON
[
    {
        "time": "2016-11-07T13:49:33.638462Z"
        "eventType": "inspection",
        "eventResult": 0,
        "localEventId": "b920d3e2-b1a4-4157-8bfd-c36c2de1fedb",
        "ticketId": "57e53ddd731adf5bf07d2c12"
    }
]
JSON

...