REST Occupancy API
- 1 Authorization
- 2 Endpoints Overview
- 3 Quick Start Guide
- 3.1 Sending Requests
- 4 Use Cases
- 4.1 Get Group Information & Occupancy Summary on the 2nd floor of MSCP
- 4.2 Get Group Information & Occupancy Summary within a search radius
- 4.3 Get individual position occupancy & summary for group X
- 4.4 Find occupancies longer than X minutes
- 4.5 Get occupancy summary per level (Digital signage)
- 4.6 Get position information and summary for level X (MSCP occupancy map)
- 5 Postman Collection
- 6 OpenAPI Documentation
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.
Click on the user icon in the top right corner and select Company Info.
Â
Â
Click + to the right of the Client API Auth Tokens card to generate a new token.
Â
Â
Enter a name, select permissions and project scope for the new token and click Add.
Â
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:
Quick display of all the parking groups and their aggregate status per specified filters.
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
Enter the URL and select the GET method.
Fill out the key-value pair under the headers tab.
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:
state: Occupied
time_to: 2021-04-09T13:24:00 (current time minus 120 minutes)
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:
level information
positions locations on a level
positions' occupancies
occupancy summary for that level
Â
cURL example
Postman example
Â
Â
Â
Postman Collection
Â
Importing Collection
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.
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
Â