These endpoints are use case methods that have the aim of creating, getting information or removing a parking.
Create parking
-
Method: POST
-
URL: {baseUrl}/v1/parking
-
Body:
[ { "cityIne": 50297, "parkingName": "Parking Plaza España", "parkingId": 1, "address": "C. del Coso, 45", "cp": 50003, "observations": "Primera planta solo plazas reservadas", "accessConditions": "Altura máxima 2,10 m", "capacity": 168, "free": 23, "geometry": { "type": "Polygon", "coordinates": [ [ [-0.880468,41.652120], [-0.880676,41.652234], [-0.880306,41.652211], [-0.880575,41.652344], [-0.880676,41.652234], [-0.880468,41.652120] ] ] }, "timestamp": "2022-03-07T12:31:00", "timetable": { "exceptions":"Excepto fútbol", "days":[ { "day":"J", "timeRanges":[ { "startTime":"08:00:00", "endTime":"17:00:00" }, { "startTime":"18:00:00", "endTime":"22:00:00" }, { "startTime":"22:30:00", "endTime":"23:55:00" } ] }, { "day":"D", "timeRanges":[ { "startTime":"08:00:00", "endTime":"22:00:00" } ] } ] } } ]
(*)= Required field
-
(*)cityIne: Identifier of the municipality where the event is generated according to the INE.
-
cityName: City in which the car park is located.
-
(*)parkingName: Parking name.
-
(*)parkingId: Parking Identifier.
-
address: Parking address.
-
(*)cp: Parking postal code.
-
observations: Additional parking information.
-
accessConditions: Special parking access conditions.
-
free: Free parking spaces.
-
capacity: Parking capacity.
-
timestamp: Date of last update of the parking information.
-
(*)Timetable: Parking hours of operation by day of the week.
-
(*)geometry: Geospatial parking information.
Update of a parking
The event is the main part of this data ingestion API. This event will update the information regarding to parkings.
-
Method: PUT
-
URL: {baseUrl}/v1/parking
-
Updates the data of a parking (cityIne, parkingId, free, capacity, timestamp)
[ { "cityIne":50297, "parkingId":1, "free":58, "capacity":168, "timestamp":"2022-03-07T12:31:00" } ]
(*)= Required field
· (*)cityIne: Identifier of the municipality where the event is generated according to the INE.
· (*)parkingId: Parking Identifier.
· free: Free parking spaces.
· capacity: Parking capacity.
· (*)timestamp: Date of last update of the parking information.
Obtain information about parkings in a municipality
-
Method: GET
-
URL: {baseUrl}/v1/parking/{cityIne}
-
Response:
[ { "municipalityIneCode": 50297, "name": "abcd", "parkingId": "99", "postalCode": 1, "address": "abc", "timetable": "abc", "totalCapacity": 0, "geoJsonAddress": { "type": "Polygon", "coordinates":[ [ [-0.864299,41.646176],[-0.864162,41.646250], [-0.864135,41.646412],[-0.864408,41.646432], [-0.864453,41.646200],[-0.864299,41.646176] ] ] } }, { "municipalityIneCode": 50297, "name": "abcd", "parkingId": "1", "postalCode": 1, "address": "abc", "timetable": "abc", "totalCapacity": 5, "freeCapacity": 4, "geoJsonAddress": { "type": "Polygon", "coordinates":[ [ [-0.864299,41.646176],[-0.864162,41.646250], [-0.864135,41.646412],[-0.864408,41.646432], [-0.864453,41.646200],[-0.864299,41.646176] ] ] } } ]
Obtain information about a parking
-
Method: GET
-
URL: {baseUrl}/v1/parking/{cityIne}/{parkingId}
-
Response:
[ { "municipalityIneCode": 50297, "name": "abcd", "parkingId": "1", "postalCode": 1, "address": "abc", "timetable": "abc", "totalCapacity": 0, "geoJsonAddress": { "type": "Polygon", "coordinates":[ [ [-0.864299,41.646176],[-0.864162,41.646250], [-0.864135,41.646412],[-0.864408,41.646432], [-0.864453,41.646200],[-0.864299,41.646176] ] ] } } ]
Delete parking
-
Method: DEL
-
URL: {baseUrl}/v1/parking/{cityIne}/{parkingId}