Skip to content

Adventures API

Andrew Maclean edited this page Jun 24, 2024 · 15 revisions

This section describes the actions you can take on Adventures with the Sunday Peak API.

Get Top Level Adventures

Top Level Adventures are any adventures that do not have a parent zone. This API is meant to fetch all the adventures to display on the map when no zone is selected. The response will be a geoJSON object with a list of adventures that fall into this category.

This API doesn't require an auth token because it is meant to be able to be used without loggin in to either the website or the app. All data regarding any users is restricted from this call.

Endpoint

https://api.sundaypeak.com/adventures/all?type=<AdventureType>

Content-Type: application/json
HTTP Method: GET

The <AdventureType> variable is one of enum AdventureType

Response

{
  data: {
    adventures: {
      <AdventureType>: {
        lines: GeoJSON-Object
        points: GeoJSON-Object
      }
    }
  },
  status_code: Int
  timestamp: Int
}
Key Type Description
lines GeoJSON-Object all the features in the adventures collection who's geo data consists of a path
points GeoJSON-Object all the features who's geo data are just a coordinate pair

Get Adventures by Distance

This API gets adventures ordered by distance from a specified lat and lng. In the root adventure view, the closest adventures to the current center point of the screen will be populated with this call. The response will be a list of abridged adventures that fall into this category.

This API doesn't require an auth token because it is meant to be able to be used without logging in to either the website or the app. All data regarding any users is restricted from this call.

Endpoint

https://api.sundaypeak.com/adventures/distance?adventure_type=<AdventureType>&coordinates_lat=<Lat>&coordinates_lng=<Lng>&count=<Count>

Content-Type: application/json
HTTP Method: GET

The <AdventureType> variable is one of enum AdventureType
The <Lat> variable is a floating point number representing coordinate latitude
The <Lng> variable is a floating point number representing coordinate longitude
The <Count> variable is an Int determining the amount of adventures returned

TODO: Change adventure_type above to just type. adventure_type is redundant

Response

{
  data: {
    adventures: ShortAdventure[]
  },
  status_code: Int
  timestamp: Int
}
Key Type Description
adventures ShortAdventure an abridged version of the adventure object for when many adventures are requested

Clone this wiki locally