-
Notifications
You must be signed in to change notification settings - Fork 0
3. APIs
Returns a complete list of all venues sorted alphabetically, or by proximity to the user's current latitude and longitude.
Endpoint: GET /venues/
Request Parameters
Key | Location | Type | Description |
---|---|---|---|
lat |
URL Parameter | Float | User's latitude (optional) |
lon |
URL Parameter | Float | User's longitude (optional) |
Response Codes
Code | Description |
---|---|
200 OK |
Success |
400 Bad Request |
Invalid Parameters |
Returns
If no URL parameters, list will sorted alphabetically, otherwise sorted by user's proximity.
Key | Location | Type | Description |
---|---|---|---|
data |
JSON | List of all venues | Data associated with each venue |
url |
JSON | String | Self-identifying URL |
Example
curl -X GET https://api.OUR_SERVER/venues/?lat=42.29&lon=-83.72
{
"data": [
{
"name": "Michigan's Adventure",
"description": "...",
"image_url": "/media/fjdkfjda.jpg",
"lat": 43.34,
"lon": -86.28
},
{
"name": "Disney World",
"description": "...",
"image_url": "/media/fjdafdak.jpg",
"lat": 28.38,
"lon": -81.56
},
...
],
"url": "/api/venues/"
}
Returns a complete list of all destinations for a specified venue sorted alphabetically, or by proximity to the user's current latitude and longitude.
Endpoint: GET /venues/:id/destinations
Request Parameters
Key | Location | Type | Description |
---|---|---|---|
lat |
URL Parameter | Float | User's latitude (optional) |
lon |
URL Parameter | Float | User's longitude (optional) |
Response Codes
Code | Description |
---|---|
200 OK |
Success |
400 Bad Request |
Invalid Parameters |
404 Not Found |
Invalid Specified Venue ID |
Returns
If no URL parameters, list will sorted alphabetically, otherwise sorted by user's proximity.
Key | Location | Type | Description |
---|---|---|---|
data |
JSON | List of all destinations | Data associated with each venue |
url |
JSON | String | Self-identifying URL |
Example
curl -X GET https://api.OUR_SERVER/api/venues/152/destinations?lat=42.29&lon=-83.72
{
"data": [
{
"name": "Mine Ride",
"description": "...",
"image_url": "/media/fjdkfjda.jpg",
"lat": 43.34,
"lon": -86.28
},
{
"name": "Blue Streak",
"description": "...",
"image_url": "/media/fjdafdak.jpg",
"lat": 28.38,
"lon": -81.56
},
...
],
"url": "/api/venues/152/destinations"
}
Returns a list of coordinates from a users location, to a specified destination.
Endpoint: GET /venues/:id/destinations/:id/directions
Request Parameters
Key | Location | Type | Description |
---|---|---|---|
lat |
URL Parameter | Float | User's latitude |
lon |
URL Parameter | Float | User's longitude |
Response Codes
Code | Description |
---|---|
200 OK |
Success |
400 Bad Request |
Invalid Parameters |
404 Not Found |
Invalid Specified Venue / Destination ID |
Returns
Key | Location | Type | Description |
---|---|---|---|
data |
JSON | List of coordinates | Waypoints directions to destination |
url |
JSON | String | Self-identifying URL |
time_estimate |
JSON | String | Estimated time to walk to destination (in minutes) |
distance |
JSON | String | Distance from users current location to destination (in miles) |
Example
curl -X GET https://api.OUR_SERVER/api/venues/152/destinations/72/directions?lat=42.29&lon=-83.72
{
"data": [
{
"lat": 43.34,
"lon": -86.28
},
{
"lat": 28.38,
"lon": -81.56
},
{
"lat": 28.38,
"lon": -82.56
},
...
],
"url": "/api/venues/152/destinations",
"time_estimate": 23,
"distance": 2.6
}