Documentation

1.PSS-S REST API #

This section describes the available REST API layer for the Kiunsys Parking Spot Sensors System (PSS-S).

Data Model

PSS API Data Model

Authentication

Via username and password supplied as standard Basic Auth .

Yes No

1.1.version #

Returns the current API version and other information.

Resource Information
  • Rate Limited: False
  • Response Format: JSON
  • Authentication: None
Resource URL
https://pss.kiunsys.com/ws-pss/version
Example
GET https://pss.kiunsys.com/ws-pss/version
Response
Example JSON response
 {
    API version: "1.0",
    IP address: "172.17.0.4",
    server name: "parkingsensors-api.kiunsys.com",
    server port: "80"
} 
Yes No

1.2.areas #

Returns available parking areas.
For further information about an area see the area resource definition

Resource Information
  • Rate Limited: False
  • Response Format: JSON
  • Authentication: Auhorization Token
Resource URL
https://pss.kiunsys.com/ws-pss/areas
Example
GET https://pss.kiunsys.com/ws-pss/areas
Response
Example JSON response
  {
    "error": false
    "areas": [1]
        0:  {
            "id": "1"
            "name": "Piazza Carrara, Pisa"
            "lat": "43.71710300"
            "lon": "10.39715000"
            "active": true
            "notes": null
            "creation_date": "2016-01-30T12:02:56+01:00"
        }
} 
Yes No

1.3.area #

Returns detailed data about a specific parking area.

Resource Information
  • Rate Limited: False
  • Response Format: JSON
  • Authentication: Auhorization Token
Resource Description
field name field type field description field access level
id integer parking area identifier all
name string parking area name all
lat decimal degrees parking area latitude all
lon decimal degrees parking area longitude all
active boolean parking area activation status all
notes string parking area optional notes all
creation_date ISO-8601 datetime parking area creation date all
parking_sensors PSS objects list see PSS resource definition for details all
dcus DCUs objects list see DCU resource definition for details all
Resource URL
https://pss.kiunsys.com/ws-pss/area
Parameters
Parameter Description Optional Default
area_id parking area identifier
Example
GET https://pss.kiunsys.com/ws-pss/area?area_id=1
Response
Example JSON response
  {
    "error": false,
    "area": {
        "id": "1"
        "name": "Piazza Carrara, Pisa"
        "lat": "43.71710300"
        "lon": "10.39715000"
        "active": true
        "notes": null
        "creation_date": "2016-01-30T12:02:56+01:00"

        "parking_sensors": [4]
            0:  {
                "id": "1"
                "code": "1"
                "lat": "43.71676190"
                "lon": "10.39733160"
                "mac": "0004A3A274EB"
                "status": "empty"
            }
            1:  {
                "id": "2"
                "code": "2"
                "lat": "43.71675660"
                "lon": "10.39730030"
                "mac": "0004A3A23EEB"
                "status": "empty"
            }
            2:  {
                "id": "3"
                "code": "3"
                "lat": "43.71675230"
                "lon": "10.39726770"
                "mac": "0004A38A62FF"
                "status": "empty"
            }
            3:  {
                "id": "4"
                "code": "4"
                "lat": "43.71674810"
                "lon": "10.39723370"
                "mac": "0004A3A25C58"
                "status": "occupied"
            }

        "dcus": [3]
            0:  {
                "id": "1"
                "code": "DCU050001"
                "lat": "43.71727300"
                "lon": "10.39714000"
                "active": true
                "notes": null
                "creation_date": "2016-01-30T12:02:56+01:00"
            }
            1:  {
                "id": "2"
                "code": "DCU050002"
                "lat": "43.71709200"
                "lon": "10.39733000"
                "active": true
                "notes": null
                "creation_date": "2016-01-30T12:02:56+01:00"
            }
            2:  {
                "id": "3"
                "code": "DCU050003"
                "lat": "43.71670200"
                "lon": "10.39729700"
                "active": true
                "notes": null
                "creation_date": "2016-01-30T12:02:56+01:00"
            }

    }
} 
Yes No

1.4.dcus #

Returns available DCUs in a specified parking area.
For further information about a DCU see the DCU resource definition

Resource Information
  • Rate Limited: False
  • Response Format: JSON
  • Authentication: Auhorization Token
Resource URL
https://pss.kiunsys.com/ws-pss/dcus
Parameters
Parameter Description Optional Default
area_id parking area identifier
Example
GET https://pss.kiunsys.com/ws-pss/dcus?area_id=1
Response
Example JSON response
  {
    "error": false
    "dcus": [3]
    0:  {
        "id": "1"
        "code": "DCU050001"
        "lat": "43.71727300"
        "lon": "10.39714000"
        "active": true
        "notes": null
        "setup_date": "2016-01-30T12:02:56+01:00"
    }
    1:  {
        "id": "2"
        "code": "DCU050002"
        "lat": "43.71709200"
        "lon": "10.39733000"
        "active": true
        "notes": null
        "setup_date": "2016-01-30T12:02:56+01:00"
    }
    2:  {
        "id": "3"
        "code": "DCU050003"
        "lat": "43.71670200"
        "lon": "10.39729700"
        "active": true
        "notes": null
        "setup_date": "2016-01-30T12:02:56+01:00"
    }
} 
Yes No

1.5.dcu #

Returns detailed data about a DCU, given its identifier.
Returns also the last 10 alarms detected.

Resource Information
  • Rate Limited: False
  • Response Format: JSON
  • Authentication: Auhorization Token
Resource Description
field name field type field description field access level
id integer DCU identifier all
code string DCU internal code all
lat decimal degrees DCU latitude all
lon decimal degrees DCU longitude all
active boolean DCU activation state all
notes string DCU optional notes all
setup_date ISO-8601 datetime DCU setup date administrators only
alarms alarm objects list last 10 DCU alarms administrators only
Resource URL
https://pss.kiunsys.com/ws-pss/dcu
Parameters
Parameter Description Optional Default
dcu_id DCU identifier
Example
GET https://pss.kiunsys.com/ws-pss/dcu?dcu_id=1
Response
Example JSON response
  {
    "error": false
    "dcu": {
        "id": "1"
        "code": "DCU050001"
        "lat": "43.71727300"
        "lon": "10.39714000"
        "active": true
        "notes": null
        "setup_date": "2016-01-30T12:02:56+01:00"

        "alarms": [2]
            0:  {
                    "id": "109"
                    "alarm_type": {
                        "code": "006"
                        "description": "Prolonged lack of communication"
                    }
                    "active": true
                    "detection_date": "2016-01-31T17:13:15+01:00"

                }
            1:  {
                    "id": "108"
                    "alarm_type": {
                        "code": "001"
                        "description": "Low level battery charge"
                    }
                    "active": false
                    "detection_date": "2016-01-31T17:11:53+01:00"

            }

        }
} 
Yes No

1.6.parking_sensors #

Returns available sensors in a specified parking area.
For further information about a parking sensor see the PSS resource definition

Resource Information
  • Rate Limited: False
  • Response Format: JSON
  • Authentication: Auhorization Token
Resource URL
https://pss.kiunsys.com/ws-pss/parking_sensors
Parameters
Parameter Description Optional Default
area_id parking area identifier
Example
GET https://pss.kiunsys.com/ws-pss/parking_sensors?area_id=1
Response
Example JSON response
  {
    "error": false
    "parking_sensors": [4]
    0:  {
        "id": "1"
        "code": "1"
        "lat": "43.71676190"
        "lon": "10.39733160"
        "mac": "0004A3A274EB"
        "status": 0
        "type": {
            "code": "1"
            "description": "Payment"
        }
    }
    1:  {
        "id": "2"
        "code": "2"
        "lat": "43.71675660"
        "lon": "10.39730030"
        "mac": "0004A3A23EEB"
        "status": "empty"
        "type": {
            "code": "2"
            "description": "Commercial"
        }
    }
    2:  {
        "id": "3"
        "code": "3"
        "lat": "43.71675230"
        "lon": "10.39726770"
        "mac": "0004A38A62FF"
        "status": 1
        "type": {
            "code": "3"
            "description": "Disabled"
        }
    }
    3:  {
        "id": "4"
        "code": "4"
        "lat": "43.71674810"
        "lon": "10.39723370"
        "mac": "0004A3A25C58"
        "status": 1
        "type": {
            "code": "1"
            "description": "Payment"
        }
    }
}
Yes No

1.7.parking_sensor #

Returns detailed data about a sensor, given its identifier.
Returns also the last 10 alarms detected.

Resource Information
  • Rate Limited: False
  • Response Format: JSON
  • Authentication: Auhorization Token
Resource Description
field name field type field description field access level
id integer PSS identifier all
code string PSS internal code all
lat decimal degrees PSS latitude all
lon decimal degrees PSS longitude all
mac string PSS MAC address all
status bit PSS status (0 = empty, 1 = occupied) all
type integer, string code, description all
last_measurement_date ISO-8601 datetime PSS last measurement date all
setup_date ISO-8601 datetime PSS setup date administrators only
temperature centigrade degrees PSS temperature administrators only
battery volts (V) PSS battery voltage administrators only
rssi dBm PSS received signal strenght index administrators only
lqi integer PSS link quality signal administrators only
alarms alarm objects list last 10 PSS alarms administrators only
Resource URL
https://pss.kiunsys.com/ws-pss/parking_sensor
Parameters
Parameter Description Optional Default
sensor_id parking sensor identifier
Example
GET https://pss.kiunsys.com/ws-pss/parking_sensor?sensor_id=1
Response
Example JSON response
  {
    "error": false
    "parking_sensor": {
        "id": "1"
        "code": "1"
        "lat": "43.71676190"
        "lon": "10.39733160"
        "mac": "0004A3A274EB"
        "status": 0
        "type": {
            "code": "1"
            "description": "Payment"
        }
        "setup_date": "2016-01-19T16:19:35+01:00"
        "last_measurement_date": "2016-01-22T19:47:47+01:00"
        "temperature": "18.0"
        "battery": "2.945"
        "rssi": "190"
        "lqi": "63"

        "alarms": [2]

            0:  {
                    "id": "109"
                    "alarm_type": {
                        "code": "006"
                        "description": "Prolonged lack of communication"
                    }
                    "active": true
                    "detection_date": "2016-01-30T15:21:03+01:00"

            }
            1:  {
                    "id": "108"
                    "alarm_type": {
                        "code": "001"
                        "description": "Low level battery charge"
                    }
                    "active": true
                    "detection_date": "2016-01-30T15:19:56+01:00"

            }


    }
} 
Yes No

2.PSS-S Websocket #

This section describes the available Websocket for the Kiunsys Parking Spot Sensors System (PSS-S).

Authentication

Via username and password supplied as standard Basic Auth .

Protocol

We adopt STOMP 1.2 protocol over websocket.

Yes No

2.1.status change #

Subscribe to topic /topic/statusChange to receive changes of status of the sensors in PSS.

Resource Description
field name field type field description
id integer PSS identifier
code string PSS internal code
lat decimal degrees PSS latitude
lon decimal degrees PSS longitude
mac string PSS MAC address
status bit PSS status (0 = empty, 1 = occupied)
type integer, string code, description
last_measurement_date ISO-8601 datetime PSS last measurement date
Example
CONNECT wss://pss.kiunsys.com/ws-pss/parkingEvents
SUBSCRIBE destination: /topic/statusChange
Response
Example JSON response
  {
        "id": "1"
        "code": "1"
        "lat": "43.71676190"
        "lon": "10.39733160"
        "mac": "0004A3A274EB"
        "status": 0
        "type": {
            "code": "1"
            "description": "Payment"
        }
        "setup_date": "2016-01-19T16:19:35+01:00"
        "last_measurement_date": "2016-01-22T19:47:47+01:00"       
    }
Yes No