Versions Compared

Key

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

Table of contents

Table of Contents
maxLevel3
excludeTable of contents

Overview

...

...

Version information

Version : v1

URI scheme

Host : schemas.mobileticket.se
BasePath : /api/v1
Schemes : HTTPS

...

No Format
POST /ticket

Description

Issue tickets from supplied manifest. The manifest should come from the
product server for a matching participant id. Manifests from an unknown
participants, expired manifest or with an illegal signature will be
rejected.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Body

...

Manifest to issue tickets from

...

manifestCall

Responses

...

HTTP Code

...

Description

...

Schema

...

201

...

No Format
location

(string) : URL of created ticket bundle.

...

ticketIssueResponse

...

400

...

Manifest is invalid or from unknown participant

...

No Content

...

401

...

Unauthorised

...

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
GET /ticket

Description

Get all issued tickets that meets the requirements specified by the
parameters. Which parameters you can filter on are described below.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Query

...

Filter on active tickets

...

boolean

...

Query

...

Filter on participant ID requesting the ticket

...

integer (int64)

...

Query

...

Filter on refundable tickets

...

boolean

...

Query

...

Filter on refunded tickets

...

boolean

...

Query

...

Filter on request ID

...

string

...

Query

...

Filter on travellers ID

...

string

Responses

HTTP Code

Description

Schema

200

Successful operation, return list of tickets. If filter doesn't
produce any matches an empty array will be returned.

< ticket > array

401

Unauthorised

No Content

Produces

No Format
application/json

Tags

  • ticket
Example
Code Block
languagebash
titleRequest
collapsetrue
curl --verbose -X GET \
     --header "Content-Type: application/json" \
     --header "X-BoB-AuthToken: eyJhbGciOiJFUz.eyJib2JBdXRoWiI6ICJ" \
     https://ticket.bob.example.com/api/v1/ticket?refundable=true&travellerId=trav123
Code Block
languagejs
titleResponse 200
collapsetrue
[ {
  "ticketId" : "91864",
  "issuedAt" : "20170203T123400Z",
  "ticketPayload" : "",
  "mtb" : "FBWlE0RDFTOFU0NEtZSDA2U",
  "ticketHolder" : {
    "travellerId" : "trav123",
    "travellerName" : "Per Busson"
  },
  "activeStatus" : true,
  "recoverStatus" : {
    "recovered" : false,
  },
  "refundStatus" : {
    "refunded" : false,
  },
  "refundableStatus" : {
    "refundable" : true,
    "refundableAmount" : {
      "amount" : 100.0,
      "currency" : "SEK",
      "vatAmount" : 6.0,
      "vatPercent" : 6.0
    }
  }
} ]

...

No Format
GET /ticket/{ticketId}

Description

Get data and information about ticket with specified ticket identifier,
issued by this server.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Path

...

Ticket identifier

...

string

Responses

HTTP Code

Description

Schema

200

Successful operation

ticket

401

Unauthorised

No Content

404

Ticket not found

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
GET /ticket/{ticketId}/active

Description

Get active status for ticket with specified ticket identifier.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Path

...

Ticket id

...

string

Responses

HTTP Code

Description

Schema

200

Successful operation

ticketActiveStatus

401

Unauthorised

No Content

404

Ticket not found

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
PUT /ticket/{ticketId}/active

Description

Freeze or thaw ticket with specified ticket identifier.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Path

...

Ticket identifier

...

string

...

Body

...

Set to true to thaw ticket, false to freeze. A ticket must be active to be able
to use it.

...

ticketActiveStatus

Responses

HTTP Code

Description

Schema

200

Successful operation, ticket is now inactive

No Content

401

Unauthorised

No Content

404

Ticket not found

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
GET /ticket/{ticketId}/event

Description

Get all ticket events for specified ticket identifier. If no
events are available an empty list will be returned.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Path

...

Ticket identifier

...

string

Responses

HTTP Code

Description

Schema

200

Successful operation, list of all events for specified ticket identifier.

< ticketEventResult > array

401

Unauthorised

No Content

404

Ticket not found

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
GET /ticket/{ticketId}/event/{eventId}

Description

Get ticket event specified with event identifier and ticket identifier.
Note! this is the server event identifier and not the local event identfier.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Path

...

Event identifier

...

string

...

Path

...

Ticket identifier

...

string

Responses

HTTP Code

Description

Schema

200

Successful operation

ticketEventResult

401

Unauthorised

No Content

404

Ticket and event combination not found

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
GET /ticket/{ticketId}/recoverStatus

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Path

...

Ticket identifier

...

string

Responses

HTTP Code

Description

Schema

200

successful operation

recoverStatus

401

Unauthorised

No Content

404

Ticket not found

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
PUT /ticket/{ticketId}/recoverStatus

Description

Recover ticket specified with ticket identifier.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Path

...

Ticket id

...

string

Responses

HTTP Code

Description

Schema

200

Successful operation, ticket recovered

No Content

400

Ticket could not be recovered

No Content

401

Unauthorised

No Content

404

Ticket not found

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
GET /ticket/{ticketId}/recoverableStatus

Description

Get information if ticket specified with ticket identifier is
recoverable. If ticket is refundable also supply information
about recoverable amount and VAT.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Path

...

Ticket identifier

...

string

Responses

HTTP Code

Description

Schema

200

successful operation

recoverableStatus

401

Unauthorised

No Content

404

Ticket not found

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
GET /ticket/{ticketId}/refundStatus

Description

Get information if ticket specified with ticket identifier has
been refunded or not. If ticket was refunded also supply information
about refunded amount and VAT.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Path

...

Ticket id

...

string

Responses

HTTP Code

Description

Schema

200

Successful operation

refundStatus

401

Unauthorised

No Content

404

Ticket not found

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
PUT /ticket/{ticketId}/refundStatus

Description

Refund ticket specified with ticket identifier.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Path

...

Ticket id

...

string

Responses

HTTP Code

Description

Schema

200

Successful operation, ticket was refunded

No Content

400

Ticket could not be refunded

No Content

401

Unauthorised

No Content

404

Ticket not found

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
GET /ticket/{ticketId}/refundableStatus

Description

Get information if ticket specified with ticket identifier is
refundable. If ticket is refundable also supply information
about refundable amount and VAT.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Path

...

Ticket id

...

string

Responses

HTTP Code

Description

Schema

200

successful operation

refundableStatus

401

Unauthorised

No Content

404

Ticket not found

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
PUT /ticket/{ticketId}/revoke

Description

Set the ticket specified with ticket identifier in revoked state.
When a ticket is in revoked state it can.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Path

...

Ticket identifier

...

string

Responses

HTTP Code

Description

Schema

200

Successful operation, ticket in revoved state.

No Content

401

Unauthorised

No Content

404

Ticket not found

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
POST /ticketbundle

Description

Create a new ticket bundle containing that is a subset of another ticket bundle.
The tickets are specified in the request payload as a list of ticket identfiers.

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Body

...

List of ticket identifiers of tickets to be included in ticket bundle

...

ticketBundleRequest

Responses

...

HTTP Code

...

Description

...

Schema

...

201

...

No Format
location

(string) : URL of created ticket bundle.

...

ticketBundle

...

400

...

All the ticket didn't come from the same ticket bundle

...

No Content

...

401

...

Unauthorised

...

No Content

Produces

No Format
application/json

Tags

  • ticket

...

No Format
GET /ticketbundle/{ticketBundleId}

Description

Get ticket bundle specified by the ticket bundle identifier

Parameters

...

Type

...

Name

...

Description

...

Schema

...

Header

...

JWT authentication token

...

string

...

Path

...

Ticket bundle id

...

string

Responses

HTTP Code

Description

Schema

200

Successful operation

ticketBundle

401

Unauthorised

No Content

404

Ticket bundle not found

No Content

Produces

No Format
application/json

Tags

  • ticket

...

Device Reference, unique reference for device that creates device signed tickets

...

Name

...

Description

...

Schema

...

Device identifier

...

string (base64url)

...

Participant identifier

...

integer (int64)

...

Fare information, amount, currency and VAT

...

Name

...

Description

...

Schema

...

Fare cost excluding VAT

...

number (float)

...

Currency code (ISO 4217)

...

string

...

VAT amount

...

number (float)

...

VAT percent

...

number (float)

...

Geographical position (WGS84 decimal)

...

Name

...

Description

...

Schema

...

Altitude

...

number (double)

...

Latitude

...

number (double)

...

Longitude

...

number (double)

...

Manifest with parameter to be used for issuing tickets

...

Name

...

Description

...

Schema

...

Booking identifier from Booking API

...

string

...

Set to true to return MTB when tickets are issued

...

boolean

...

Signed manifest with MTB template

...

string (base64url)

...

ID of ticket in recover state to be recovered in operation

...

string

...

Request identifier allocated by manifest requestor

...

string

...

Request start of validity set in the future (must be within the validity time of the manifest). Time stamp in ISO 8601 format.

...

string (date-time)

...

Traveller to register as ticket holder

...

ticketHolder

...

MTB reference

...

Name

...

Description

...

Schema

...

MTB issuer signature

...

string (base64url)

...

Participant identifier

...

integer (int64)

...

Recover status

...

Name

...

Description

...

Schema

...

True if ticket is in recovered state

...

boolean

...

Fare recovered

...

fare

...

Tells if ticket is recoverable and amount recoverable

...

Name

...

Description

...

Schema

...

Is ticket recoverable

...

boolean

...

Recovereable fare

...

fare

...

Refund status

...

Name

...

Description

...

Schema

...

True if ticket is in refunded state

...

boolean

...

Fare refunded

...

fare

...

Tells if ticket is refundable and amount refundable

...

Name

...

Description

...

Schema

...

Is ticket refundable

...

boolean

...

Refundable fare

...

fare

...

Ticket data and status

...

Name

...

Description

...

Schema

...

Ticket active status

...

ticketActiveStatus

...

Time stamp in ISO 8601 format

...

string (date-time)

...

Signed MTB container

...

string (base64url)

...

Ticket recover status

...

recoverStatus

...

Ticket refund status

...

refundStatus

...

Ticket refundable status

...

refundableStatus

...

Ticket holder

...

ticketHolder

...

Unique identifier for ticket

...

string

...

Ticket payload as base64url encoded JSON

...

string (base64url)

...

True if ticket is active and ready to use, otherwise false.

Type : boolean

...

A group of tickets. All tickets must come from the same manifest
used to issue the tickets.

...

Name

...

Description

...

Schema

...

Unique manifest identifier for issued tickets

...

string

...

Signed MTB container

...

string (base64url)

...

Unique settlement identifier for tickets in bundle

...

string

...

Unique ticket bundle identifier

...

string

...

Array of identifiers to tickets in bundle

...

< string > array

...

List of ticket identifiers of tickets to be included in ticket bundle

...

Name

...

Description

...

Schema

...

List ticket identifiers

...

< string > array

...

Ticket event data from inspection or validator device

...

Name

...

Description

...

Schema

...

Device Reference, unique reference for device that creates device signed tickets

...

deviceReference

...

Event identifier (allocated at event creation)

...

string

...

Reason for failure/success

...

string

...

0 = success
1 = other failure
2 = failed spatial constraints
3 = failed time constraints
4 = failed device header conditions
5 = failed issuer signature validation
6 = failed device signature validation
7 = failed blacklist check
8 = failed passback check
9 = failed fraud check

...

integer

...

Type of event, inspection or validation

...

enum (inspection, validation)

...

Geographical position (WGS84 decimal)

...

geoPosition

...

Event identifier (allocated at validation/inspection)

...

string

...

Mode of transport. Ex. bus, train or tram.

...

string

...

MTB reference

...

mtbReference

...

Date of the operating day

...

string (date)

...

Service information

...

service

...

Stop area information

...

stopArea

...

Unique identifier for ticket

...

string

...

Time stamp in ISO 8601 format

...

string (date-time)

...

validator

...

Zone information

...

zone

...

Name

...

Description

...

Schema

...

Block identifier

...

string

...

Participant identifier associated with service, trip and block

...

integer (int64)

...

Service identifier

...

string

...

Trip identifier

...

string

...

Name

...

Description

...

Schema

...

Identifier for next stop area

...

string

...

Participant identifier associated with stop area

...

integer (int64)

...

Identifier for current stop area

...

string

...

Name

...

Description

...

Schema

...

Where is validator mounted (vehicle, platform, camel)

...

string

...

More specific location information (e.g., door)

...

string

...

What validator originated the event

...

string

...

Name

...

Description

...

Schema

...

Participant identifier associated with zone

...

integer (int64)

...

Zone identifier

...

string

...

The result of a ticket inspection or validation operation registration

...

Name

...

Description

...

Schema

...

ticketEvent

...

Message to be presented to inspector when registering an inspection event

...

string

...

Message to be presented to passenger when registering an inspection
or validation event.

...

string

...

Status code for inspection or validation event. This is normally the same
as the exp

...

integer (int32)

...

ticketMetadata

...

Ticket holders name and identifier

...

Name

...

Description

...

Schema

...

Unique traveller identifier

...

string

...

Display name of traveller

...

string

...

Name

...

Description

...

Schema

...

Unique settlement identifier for issued tickets

...

string

...

ticketBundle

...

Array of identifiers to issued tickets

...

< string > array

...

Metadata associated with a ticket

...

Name

...

Description

...

Schema

...

Start of ticket validity period in ISO 8601 format

...

string (date-time)

...

List of all event identifiers associated with this ticket

...

< string > array

...

URL to photo of traveller

...

Version information

For Ticket API there are three versions:

Version 1 is included in major profile 2017-1

Version 2 is included in major profile 2019-1

Version 3 is included in major profile 2020-1

See BoB major release profiles for a more detailed description of these profiles.

URI scheme

Host : schemas.mobileticket.se
BasePath : /api/v1
Schemes : HTTPS