Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This document describes how to configure the first rule for sending parking occupancy HTTP requests to your server.

Preparation

Please note that all data API routing templates and routes are applied only for positioned sensors. If you have no positioned sensor, please read Sensor Positioning Manual and configure position at least of one sensor.

Standard Parking HTTP API

Standard Parking HTTP API call contains all the information that can be derived from a single parking occupancy status change message:

Code Block
languagejson
{
  "timestamp": "2019-10-01T18:59:11.254Z",
  "message_type": "status_сhange",
  "message_trace_id": "6c53ce93-27b3-40e4-b012-e4c3d3aea651",
  "message":
   {
     "space_network_address": "6eb6d7d6-e486-45ff-a801-058765e2522a",
     "new_status": "occupied",
     "previous_status_duration_min":36,
     "previous_status_duration_error_min": 1,
     "session_iterator": 1
   },
  "location":
   {
     "latitude": -12.2334134,
     "longitude": 53.743789,
     "level": 3
   },
  "grouping":
   {
     "zone_id": 632,
     "group_id": 10365,
     "group_name": "Position group name",
     "group_inner_id": 16,
     "custom_id": "Position custom ID"
   }
}

API Requests configuration guide

Here we will explain how to configure HTTP API requests sending data from devices in a particular Zone to your endpoint.

  1. Open the Main menu

    Image Removed

    2. Go to menu "HTTP → Template suites"

    Image Removed

    3. Locate Default Template Suite in the list and click on it. You will see the Template Suite page.

    Image Removed

4. Go to the tab TEMPLATES and click on "Standard - Status Change" Template

...

5. Click on the button Edit in the form Template options

...

6. Now you can fill your URL into the field Url template

...

7. Click SAVE button. Your template is ready for use in routing configuration.

...

Routing configuration

After HTTP Template configuration you have to set up routing rules. Routing rule links Zone to HTTP Template suite. When this step is done you will be able to receive requests on your endpoint (set up in URL Template).

  1. Go to menu HTTP -> Routes

    Image Removed

  2. Press the + button in the right bottom

    Image Removed

  3. Select your Zone and Template Suite in the opened form. If you want to start receiving HTTP requests right after the route registration, you need to turn the “Active” switch on. Finally, click on button ADD when all these actions will be done.

    Image Removed

Viewing the history / status logs of sent HTTP requests

When you've created Zone, set positions of sensors, configured HTTP Template Suite and created route, Nwave cloud starts sending requests bu URL you entered on HTTP Template Page. If you want to check history of sent HTTP requests, you can get to the page "HTTP → History" and see the table of sent requests:

...

To start receiving Status Change messages to your backend over HTTP, you need to perform the following steps:

  1. From your home page at d.nwave.io, open the menu and navigate to the Template Suites page.

    Image Added

  2. Create your template suite. Click the [+] icon at the bottom right of the page and type a name for your suite, then click Add.

    Image Added

  3. Connect a zone from which you wish to receive messages. Click on the [+] icon in the Connected Zones section, select your zone and click Connect.

    Image Added

  4. Add Status Change Template to the Suite. Click on the [+] icon in the Templates section, under Choose from presets tab, enter the URL of your endpoint and add the necessary request headers. Then select the Status Change preset and click Add.

    Image Added

You should start receiving messages at your specified endpoint. You can check the HTTP History Page for the status of HTTP calls and call history.

If you don’t have positioned sensors and a functional Base Station, you can use Virtual Devices for testing your HTTP Suites.