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:
{ "municipalityIneCode":50297, "name":"abcd", "parkingId":1, "address":"abc", "postalCode":1, "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] ] ] } }
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 (municipalityIneCode, parkingId, freeCapacity, totalCapacity)
[ { "municipalityIneCode":50297, "parkingId":1, "freeCapacity":6, "totalCapacity":5 } ]
*** = Required field**
-
municipalityIneCode (integer): identifier of the municipality where the event is generated according to INE
-
parkingId (integer): parking identifier
-
freeCapacity (integer): free parking spaces
-
totalCapacity (integer): total parking capacity
Obtain information about parkings in a municipality
-
Method: GET
-
URL: {baseUrl}/v1/parking/{municipalityIneCode}
-
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/{municipalityIneCode}/{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/{municipalityIneCode}/{parkingId}