API Destination - morenagit/wikiTest GitHub Wiki

Destination

A destination represents the closest available parking to the location provided by the driver.

GET /destination

Description

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

Path parameters

Parameter Type Description
lat String Latitude of driver's destination
long String Longitude of driver's destination

Query parameters

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).

Response Body

HTTP Res Code Structure Description
200 OK
  • Content
  • Message
  • Code
Returns the closest available parking and its distance from the user’s destination.
404 Not found
  • Message
  • Code
No available parkings can be found

Example

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
    }
}
⚠️ **GitHub.com Fallback** ⚠️