Back to top

Wheelmate API

The Wheelmate App API is designed specifically for the purposes of Wheelmate app.

API Version: 1.0.47

Authentication

The Wheelmate API requires an API key in order to access its REST endpoints (over HTTP). The API key is unique per client platform (iOS, Android, …) and must be provided in a special HTTP header in each HTTP request to the API.

Example:

X-WHEELMATE-API-KEY: tJD9ppZbAsY1Q+rTiLSKi54wif1TUVw4

The API key should be configurable in client apps, and may differ between different backend environments.

API Root

Wheelmate API Root

This resource offers the initial entry point for using the API. It is recommended to follow the url-link values or ‘Location’ header where applicable to retrieve resources, instead of constructing your own URLs, to keep your client decoupled from implementation details.

A ‘Link’ object has the following attributes:

  • rel - The link identifier

  • href - The URL to the resource

Entry point
GET/api

Example URI

GET https://wheelmate-api.azurewebsites.net/api
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "links": [
    {
      "rel": "self",
      "href": "/api"
    },
    {
      "rel": "geoobjects",
      "href": "/api/geoobjects"
    }
  ]
}

Status API

Returns a 200 OK HTTP status code when the endpoint is healthy (checking also database connectivity).

Health check
GET/api/status

Example URI

GET https://wheelmate-api.azurewebsites.net/api/status
Response  200

Geoobjects

This resource offers actions for querying and managing geographical features (objects).

Geographic data is stored according to the GeoJSON standard (https://tools.ietf.org/html/rfc7946). The GeoJSON specification specifies longitude first and latitude second. Like in other mapping applications, longitude and latitude are angles and represented in terms of degrees. Longitude values are measured from the Prime Meridian and are between -180 degrees and 180.0 degrees, and latitude values are measured from the equator and are between -90.0 degrees and 90.0 degrees. The underlying database engine interprets coordinates as represented per the WGS-84 reference system.

Geoobject

A Geoobject has the following attributes:

  • id - A global unique identifier for the object (GUID)

  • label - The common name for the geographical feature (optional)

  • countryCode - The country in whihc the feature resides

  • location - The geographical coordinates of the feature, consisting of an array with a longitude and latitude pair.

  • type - The type of feature (see Type below)

  • tags - A list of tags (see Tags below) which describes specific aspects of the geographical object.

Type

The type attribute in Geoobject can be (but is not limited to) one of the following values:

  • toilet - A regular (non-HC) toilet

  • disabledToilet - A handicap-friendly toilet

  • parking - A parking lot/place

Tags

The tags list in Geoobject can contain (but is not limited to) the following values:

  • paid - The parking or the toilet is not for free

  • eu-key - The toilet requires a special EU-key for opening

  • hc-friendly - The toilet is handicap-friendly (same as disabledToilet type)

Geoobjects resource

Get by ID
GET/api/geoobjects/{id}

Gets a specific geographic object by its unique identifier.

Example URI

GET https://wheelmate-api.azurewebsites.net/api/geoobjects/8CE76930-38C6-43B5-9E43-770733760852
URI Parameters
HideShow
id
string (required) Example: 8CE76930-38C6-43B5-9E43-770733760852

A globally unique identifier (GUID) for the object. The GUID must be uppercased.

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "8CE76930-38C6-43B5-9E43-770733760852",
  "label": "Mark's Restaurant",
  "address": {
    "street": "Bladgade 2",
    "zipCode": "1234",
    "city": "København K"
  },
  "type": "toilet",
  "countryCode": "DK",
  "location": [
    12.233455,
    55.123
  ],
  "tags": [
    "paid",
    "eu-key"
  ],
  "counters": {
    "likes": 21,
    "dislikes": 4
  }
}

Query by polygon
GET/api/geoobjects?within={within}&type={type}

Retrieves a list of objects that are contained within the specified geographic polygon.

Example URI

GET https://wheelmate-api.azurewebsites.net/api/geoobjects?within=[15,56],[10,56],[10,54],[15,54],[15,56]&type=toilet
URI Parameters
HideShow
within
string (required) Example: [15,56],[10,56],[10,54],[15,54],[15,56]

A list of coordinates defining a polygon (in counter-clockwise order) that the features must be within. Each coordinate is defined with longitude first and latitude second. The GeoJSON specification requires that for valid Polygons, the last coordinate pair provided should be the same as the first, to create a closed shape.

type
string (optional) Example: toilet

Filter by a specific object type

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "8CE76930-38C6-43B5-9E43-770733760852",
    "label": "Mark's Restaurant",
    "address": {
      "street": "Bladgade 2",
      "zipCode": "1234",
      "city": "København K"
    },
    "type": "toilet",
    "countryCode": "DK",
    "location": [
      12.233455,
      55.123
    ],
    "tags": [
      "paid",
      "eu-key"
    ],
    "counters": {
      "likes": 21,
      "dislikes": 4
    }
  }
]

Query by circle
GET/api/geoobjects?center={center}&radius={radius}&type={type}

Retrieves a list of objects contained in the specified geographic circle.

Example URI

GET https://wheelmate-api.azurewebsites.net/api/geoobjects?center=[12,55]&radius=34.2&type=toilet
URI Parameters
HideShow
center
string (required) Example: [12,55]

A center coordinate for the circle that the features must be within. The coordinates are a longitude first and latitude second.

radius
string (required) Example: 34.2

The radius, in meters of the circle that the features must be within.

type
string (optional) Example: toilet

Filter by a specific object type

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "8CE76930-38C6-43B5-9E43-770733760852",
    "label": "Mark's Restaurant",
    "address": {
      "street": "Bladgade 2",
      "zipCode": "1234",
      "city": "København K"
    },
    "type": "toilet",
    "countryCode": "DK",
    "location": [
      12.233455,
      55.123
    ],
    "tags": [
      "paid",
      "eu-key"
    ],
    "counters": {
      "likes": 21,
      "dislikes": 4
    }
  }
]

Create
POST/api/geoobjects

Creates a new geoobject (geographical feature).

The address field is optional. Set it to null if the geoobject shouldn’t be associated with an address.

Example URI

POST https://wheelmate-api.azurewebsites.net/api/geoobjects
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "label": "Mark's Restaurant",
  "address": {
    "street": "Bladgade 2",
    "zipCode": "1234",
    "city": "København K"
  },
  "type": "toilet",
  "countryCode": "DK",
  "location": [
    12.233455,
    55.123
  ],
  "tags": [
    "paid",
    "eu-key"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json
Location: /api/geoobjects/8CE76930-38C6-43B5-9E43-770733760852
Body
{
  "id": "8CE76930-38C6-43B5-9E43-770733760852",
  "label": "Mark's Restaurant",
  "address": {
    "street": "Bladgade 2",
    "zipCode": "1234",
    "city": "København K"
  },
  "type": "toilet",
  "countryCode": "DK",
  "location": [
    12.233455,
    55.123
  ],
  "tags": [
    "paid",
    "eu-key"
  ],
  "counters": {
    "likes": 0,
    "dislikes": 0
  }
}

Like
POST/api/geoobjects/{id}/like

Submits a “like” on a geoobject

Example URI

POST https://wheelmate-api.azurewebsites.net/api/geoobjects/8CE76930-38C6-43B5-9E43-770733760852/like
URI Parameters
HideShow
id
string (required) Example: 8CE76930-38C6-43B5-9E43-770733760852

A globally unique identifier (GUID) for the object. The GUID must be uppercased.

Request
HideShow
Headers
Content-Type: application/json
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "likes": 22
}

Dislike
POST/api/geoobjects/{id}/dislike

Submits a “dislike” on a geoobject

Example URI

POST https://wheelmate-api.azurewebsites.net/api/geoobjects/8CE76930-38C6-43B5-9E43-770733760852/dislike
URI Parameters
HideShow
id
string (required) Example: 8CE76930-38C6-43B5-9E43-770733760852

A globally unique identifier (GUID) for the object. The GUID must be uppercased.

Request
HideShow
Headers
Content-Type: application/json
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "dislikes": 5
}

Generated by aglio on 14 Feb 2018