API documentation

Current Parking Session V1

GET /api/car_driver/parking_sessions/current

Include access_token in HTTP header:

Authorization: Bearer 09ba487fc3df...

Description

This web service returns the user's current active parking_session, to be used each time the app is started.

REQUEST PARAMETERS

None.

Response

Status Code: 200 if OK

{
  "amount": "4.17",
  "currency": "RON",
  "parking_session": {
    "id": 1,
    "type": "pay_per_use",
    "state": "active",
    "start_time": "2017-09-05T08:51:56+00:00",
    "end_time":"2017-09-05T08:56:56+00:00",
    "entrance_remaining_tries":10,
    "exit_remaining_tries":10
  },
  "smart_key": {
    "id":1,
    "secured_parking_id":1,
    "name":"Secured P 1",
    "description":null,
    "is_active":null,
    "type":"session_access",
    "access_command":"205e32dc97f079cce7b312b4b7ad3a83ec451cb652c1a0cbf49627eb3112c6041f03",
    "is_online":false,
    "start_time":"2017-09-05T08:51:56+00:00",
    "end_time":"2017-09-05T08:56:56+00:00",
    "access_points": [
      {
        "access_point": {
          "module_id":2,
          "mac_address": "76:86:BB:DE:63:AD"
        }
      },
      {
        "access_point": {
          "module_id":1,
          "mac_address":"6F:FF:D3:B0:57:39"
        }
      }
    ]
  }
}

Response parameters

Parameter name Parameter type Description
amount string amount (decimal representation, 2 decimals precision) that was payed
currency string currency used for payment
parking_session object object containing information about the just created parking session
parking_session/id int db id of the parking session
parking_session/type string the type of parking session, the only possible value for now is "pay_per_use"
parking_session/state string session state, can be entering, active, exiting ...
parking_session/start_time string session start_time (iso8601 format)
parking_session/end_time string session end_time will be updated at finalize (iso8601 format)
parking_session/entrance_remaining_tries int countdown of remaining available tries with smart_key to enter the parking
parking_session/exit_remaining_tries int countdown of remaining available tries with smart_key to exit the parking
smart_key object object containing information about the entrance smart_key the same structure from GET /api/car_driver/smart_keys
smart_key/id int id of the smart_keys
smart_key/secured_parking_id int ...
smart_key/name string the name of the secured_parking
smart_key/description string description of the smart_key
smart_key/is_active boolean true if the parking is active
smart_key/type string type of the smart_key, only the 'session_access' value in this WS
smart_key/access_command string command to be sent in order to open the barrier
smart_key/is_online boolean true if the parking is "exclusively online", in which case the given access_command is unusable
smart_key/start_time string key start time
smart_key/end_time string key end time
smart_key/access_points array array of access_points associated to the smart_key
smart_key/access_points/access_point object access_point information ...

Status Code: 404 if user has no active parking_session