.. _SystemIntegration_HandlingParkings: ######## Parkings ######## Get parking state for all parkings ********************************** Returns the current occupancy state and count of all parkings and parking zones. See :ref:`parking and parking zones ` for more info. **URL parameters** * **hostIp**: ip address of the API host. .. http:get:: https://{hostIp}:7081/zonecounting/state **Example request**: .. sourcecode:: http GET /zonecounting/state HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "Parkings": { "Parking0": { "OccupancyState": 0, "Capacity": 150, "Occupancy": 2, "Zones": { "Zone0": { "OccupancyState": 0, "Capacity": 50, "Occupancy": 2 }, "Zone1": { "OccupancyState": 0, "Capacity": 50, "Occupancy": 0 }, "Zone2": { "OccupancyState": 0, "Capacity": 50, "Occupancy": 0 } } }} } :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) :>json array logs: dictionary with parkings and parking zones. See :ref:`parking and parking zones ` for more info. Get parking state for a specific parking **************************************** Returns the current occupancy state and count of a specific parking and its parking zones. See :ref:`parking and parking zones ` for more info. **URL parameters** * **hostIp**: ip address of the API host. * **parkingName**: name of the parking as defined in ALIOT .. http:get:: https://{hostIp}:7081/zonecounting/parking/{parkingName}/state **Example request**: .. sourcecode:: http GET /zonecounting/parking/Parking0/state HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "Parking0": { "OccupancyState": 0, "Capacity": 150, "Occupancy": 0, "Zones": { "Zone0": { "OccupancyState": 0, "Capacity": 50, "Occupancy": 0 }, "Zone1": { "OccupancyState": 0, "Capacity": 50, "Occupancy": 0 }, "Zone2": { "OccupancyState": 0, "Capacity": 50, "Occupancy": 0 } }} } :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) :>json array parkingstate: See :ref:`parking and parking zones ` for more info. Reset the occupancy of a specific parking ***************************************** Resets the occupancy of a parking. This will reset the occupancy of parking zones of the parking. See :ref:`parking and parking zones ` for more info. **URL parameters** * **hostIp**: ip address of the API host. * **parkingName**: name of the parking as defined in ALIOT .. http:put:: https://{hostIp}:7081/zonecounting/parking/{parkingName}/reset-occupancy **Example request**: .. sourcecode:: http PUT /zonecounting/parking/Parking0/reset-occupancy HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) Update the occupancy state of a specific parking ************************************************ Updates the occupancy state of a parking. This will update the occupancy state of the parking zones of the parking and thus the parking itself. See :ref:`parking and parking zones ` for more info. **URL parameters** * **hostIp**: ip address of the API host. * **parkingName**: name of the parking as defined in ALIOT * **occupancyState**: (integer) See :ref:`occupancy state ` for possible values. .. http:put:: https://{hostIp}:7081/zonecounting/parking/{parkingName}/update-state?newState={occupancyState} **Example request**: .. sourcecode:: http PUT /zonecounting/parking/Parking0/update-state?newState=2 HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) Get parking logs for all parkings ********************************** Returns ALL the parking logs created in a certain time period. see :ref:`parking logs ` for more info. **URL parameters** * **hostIp**: ip address of the API host. * **fromUtc**: earliest utc time of logs that need to be retrieved * **toUtc** : latest utc time of logs that need to be retrieved .. http:get:: https://{hostIp}:7081/zonecounting/logs **Example request**: .. sourcecode:: http GET /zonecounting/logs?fromUtc=2024-03-03T11%3A19%3A59.000Z&toUtc=2024-03-06T12%3A19%3A59.000Z HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "Logs": [{ "Id": "fa91f529-2529-4b87-b98a-3dcbc810514b", "ParkingName": "Parking0", "TimeCreatedUtc": "2024-03-04T14:08:08.9701182Z", "OccupancyState": 0, "Occupancy": 48, "ThresholdFree": 2, "Capacity": 150 }, { "Id": "dfb65650-2c1c-435b-a179-871e85f5edb1", "ParkingName": "Parking0", "TimeCreatedUtc": "2024-03-05T10:41:25.2041251Z", "OccupancyState": 0, "Occupancy": 49, "ThresholdFree": 0, "Capacity": 50 }] } :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) :>json array logs: array with logs. See :ref:`parking logs ` for more info. Get parking logs for a specific parking **************************************** Returns the parking logs for a parking created in a certain time period. see :ref:`parking logs ` for more info **URL parameters** * **hostIp**: ip address of the API host. * **parkingName**: name of the parking as defined in ALIOT * **fromUtc**: earliest utc time of logs that need to be retrieved * **toUtc** : latest utc time of logs that need to be retrieved .. http:get:: https://{hostIp}:7081/zonecounting/parkings/{parkingName}/logs **Example request**: .. sourcecode:: http GET /zonecounting/parking/Parking0/logs?fromUtc=2024-03-03T11%3A19%3A59.000Z&toUtc=2024-03-06T12%3A19%3A59.000Z HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "Logs": [{ "Id": "fa91f529-2529-4b87-b98a-3dcbc810514b", "ParkingName": "Parking0", "TimeCreatedUtc": "2024-03-04T14:08:08.9701182Z", "OccupancyState": 0, "Occupancy": 48, "ThresholdFree": 2, "Capacity": 150 }, { "Id": "dfb65650-2c1c-435b-a179-871e85f5edb1", "ParkingName": "Parking0", "TimeCreatedUtc": "2024-03-05T10:41:25.2041251Z", "OccupancyState": 0, "Occupancy": 49, "ThresholdFree": 0, "Capacity": 50 }] } :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) :>json array logs: array with logs. See :ref:`parking logs ` for more info.