REST Occupancy API

Authorization

To retrieve occupancy information the client needs to be authorised. To successfully authorize with this API, the client is required to provide a valid authorization token in the x-Auth-Token header of the HTTP request.

The authorization token can be obtained from the Nwave's console.

  1. Click on the user icon in the top right corner and select Company Info.

     

     

  2. Click + to the right of the Client API Auth Tokens card to generate a new token.

     

     

  3. Enter a name, select permissions and project scope for the new token and click Add.

     

  4. Copy the generated token.

     

Endpoints Overview

/group/find/short_info

This endpoint retrieves a list of groups and their occupancy summary per specified filters. Each group info has geolocation location data and filters may be geospatial.

Useful for:

  1. Quick display of all the parking groups and their aggregate status per specified filters.

  2. Displaying occupancy summary on digital signage.

Available filters:

  • project_id

  • zone_id

  • group_id

  • level_id or floor_number

  • geospatial filter

More detailed info can be found in Swagger documentation in the end of this document.

/group/{group_id}/status

This endpoint retrieves detailed information for a single group. It will return a list of all parking positions, their location and occupancy status. It will also return an occupancy summary for this group.

More detailed info can be found in Swagger documentation in the end of this document.

Useful for quickly displaying all the parking spots in a chosen location. e.g. when a user selects a parking group in a mobile app.

/positions/states/find

This endpoint retrieves comprehensive information for all of the positions with extensive filtering capabilities.

More detailed info can be found in Swagger documentation in the end of this document.

Useful for finding overstays in a particular zone as it is capable of filtering by occupancy and status change time.

/level/find/short_info

This endpoint retrieves level details and occupancy summary for each level.

More detailed info can be found in Swagger documentation in the end of this document.

/level/{level_id}/status

This endpoint retrieves detailed information for a single level. It will return level details as well as occupancy and location details of every position on that level.

More detailed info can be found in Swagger documentation in the end of this document.

Quick Start Guide

Sending Requests

cURL

Run the following command in your terminal window.

curl -v -H 'x-Auth-Token: <your_token>' 'https://api.nwave.io/parking/v1/positions/states/find'

Postman

  1. Enter the URL and select the GET method.

  2. Fill out the key-value pair under the headers tab.

  3. Click Send.

 

 

 

Use Cases

Get Group Information & Occupancy Summary on the 2nd floor of MSCP

Get the list of parking groups objects (including occupancy summary) on the 2nd level of multi-storey car parking (project ID = 123).

cURL Example

curl -v -H 'x-Auth-Token: <Your API Key>' 'https://api.nwave.io/parking/v1/group/find/short_info?project=123&floor_number=2'

Postman Example

 

Get Group Information & Occupancy Summary within a search radius

Get parking groups within 2km of the user’s coordinates.

 

cURL example

curl -v -H 'x-Auth-Token: <Your API Key>' 'https://api.nwave.io/parking/v1/group/find/short_info?lat=51.504536284954085&lon=-0.0847326846421401&radius=2000'

Postman example

 

 

Get individual position occupancy & summary for group X

Get detailed group information for group 2100 when a user chooses a group from the map.

 

cURL example

Postman example

 

 

Find occupancies longer than X minutes

If the current time is 2021-02-01 15:24:00, in order to find all positions that have been occupied for over 2 hours in zone 419, we should use the following query string parameters:

  1. state: Occupied

  2. time_to: 2021-04-09T13:24:00 (current time minus 120 minutes)

  3. zone_id: 419

 

cURL example

Postman example

 

Get occupancy summary per level (Digital signage)

To retrieve occupancy summaries for all levels and display them on a digital sign use the following request.

 

cURL example

Postman example

 

Get position information and summary for level X (MSCP occupancy map)

Retrieving all of the positions information and summary for a level can be useful for displaying availability map for a single floor in a multi-storey car park.

 

This request will retrieve:

  1. level information

  2. positions locations on a level

  3. positions' occupancies

  4. occupancy summary for that level

 

cURL example

Postman example

 

 

 

Postman Collection

 

Importing Collection

  1. Click import in the My Workspace section.

2. Upload the collection file and click Import.

 

Adding API key to Postman Environment

This collection uses the api_key variable to add an authorization token to the x-Auth-Token header.

  1. To create a new environment click on the eye icon near the top right corner.

 

2. Click Add to add a new environment.

 

3. Add the api_key variable name and your token in the initial value.

 

4. Select the New Environment from the list.

5. You can now test the requests in the REST Occupancy Collection.

 

OpenAPI Documentation

Â