API Destination - morenagit/wikiTest GitHub Wiki
A destination represents the closest available parking to the location provided by the driver.
Returns the closest available parking to the driver’s current destination.
- Resource URI: /companies/:name/parkings
- HTTP Req type: GET
- Res Content Type: application/json
Parameter | Type | Description |
---|---|---|
lat | String | Latitude of driver's destination |
long | String | Longitude of driver's destination |
Parameter | Type | Description |
---|---|---|
access | Boolean | Indicates if the parking must be accessible |
indoor | Boolean | Indicates if the parking must be indoor or outdoor |
maxDistance | String | Indicates the maximum distance of the parking from the user’s destination (in meters). |
HTTP Res Code | Structure | Description |
---|---|---|
200 OK |
|
Returns the closest available parking and its distance from the user’s destination. |
404 Not found |
|
No available parkings can be found |
GET /api/destination/43.13937/13.068800
{
"code": "200",
"status": "success",
"message": "Resource successfully retrieved",
"content": {
"_id": "5e2494d62681366ecc4d3398",
"id": 4,
"address": "Madonna delle Carceri",
"city": "Camerino",
"company": "Company2",
"handicap": false,
"indoor": false,
"isApproved": true,
"isFree": true,
"isUsable": true,
"location": {
"type": "Point",
"coordinates": [
13.068391,
43.13942
]
},
"plate": null,
"price": 2,
"distance": 33.685
}
}