Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 21 Next »

The document describes methods and data formats used by Nwave's cloud-based API broker to relay pre-processed smart parking sensor events to the client's endpoints. The data can be passed with or without authorization.

Authorization Methods

  1. Basic HTTP(s) Authentication using authorization header in the format of "Basic " + Base64 (username: password)

  2. API-Key

Status Change

Event of sensor occupancy status change. Occupation detection time is 5-7 seconds and vacation detection time is 3-5 seconds. 

Method: POST

Template Body: 

{
  "device_id": "{modem_id}",
  "position":{
      "network_id": "{network_id}",
      "custom_id": "{custom_id}",
      "latitude": {latitude},
      "longitude": {longitude},
      "group_inner_id": {group_inner_id},
      "group":{
          "id": {group_id},
          "name": "{group_name}",
          "zone_id": {zone_id}
      }
  },
  "message_type": "status_change",
  "message_trace_id": "{message_trace_id}",
  "occupied": "{"occupied" if parsed["occupation_status"] is True else "free"}",
  "parking_session_iterator": {parsed["parking_session_iterator"]},
  "previous_status_duration_min": {parsed["previous_occupancy_status_duration_min"]}
}
 Example Message
{
   "device_id":"1E554",
   "position":{
      "network_id":"00000000-0000-0000-0000-00000001e554",
      "custom_id":"",
      "latitude":51.49442797732277,
      "longitude":-0.1280093119192549,
      "group_inner_id":1,
      "group":{
         "id":4121,
         "name":"Test Group Delete",
         "zone_id":2779
      }
   },
   "message_type":"status_change",
   "message_trace_id":"5443685e-e8d9-410f-bcee-d2d82c2e8473",
   "occupied":"free",
   "parking_session_iterator":5,
   "previous_status_duration_min":16
}

 Device Info
  • device_id - device id hexadecimal

  • position

    • network_id - parking space network address;

    • custom_id - a property "custom_id" of a position;

    • latitude, longitude - GPS coordinates;

    • group_inner_id - a device number inside of a parking bay;

    • group

      • id - id of a parking bay;

      • name - name of a position’s group;

      • zone_id - id of a group’s zone.

  • message_type - message type;

  • message_trace_id - system message-id;

  • occupied - parking occupancy status ("occupied" or "free");

  • parking_session_iterator - short serial number of parking session. Iterator (number) is incrementing when new parking session starts (0-7);

  • previous_status_duration_min - duration of previous sensor status;

Heartbeat

The message is sent to confirm the health status of a sensor every 3 hours in case of unchanged occupancy status.

Method: PUT/POST

Template Body: 

{
  "device_id": "{modem_id}",
  "position":{
      "network_id": "{network_id}",
      "custom_id": "{custom_id}",
      "latitude": {latitude},
      "longitude": {longitude},
      "group_inner_id": {group_inner_id},
      "group":{
          "id": {group_id},
          "name": "{group_name}",
          "zone_id": {zone_id}
      }
  },
  "message_type": "heartbeat",
  "message_trace_id": "{message_trace_id}",
  "parking_session_iterator": {parsed["parking_session_iterator"]},
  "occupied": "{"occupied" if parsed["occupation_status"] is True else "free"}",
  "heartbeat_message_counter": {parsed["heartbeat_message_counter"]}
}
 Example Message
{
   "device_id": "1E554",
   "position":{
      "network_id":"00000000-0000-0000-0000-00000001e554",
      "custom_id":"",
      "latitude":51.49442797732277,
      "longitude":-0.1280093119192549,
      "group_inner_id":1,
      "group":{
         "id":4121,
         "name":"Test Group",
         "zone_id":2779
      }
   }
   "message_type":"heartbeat",
   "message_trace_id":"5443685e-e8d9-410f-bcee-d2d82c2e8473",
   "parking_session_iterator": 5,
   "occupied": "free",
   "heartbeat_message_counter": 2
}
 Device Info
  • device_id - device id hexadecimal

  • position

    • network_id - parking space network address;

    • custom_id - a property "custom_id" of a position;

    • latitude, longitude - GPS coordinates;

    • group_inner_id - a device number inside of a parking bay;

    • group

      • id - id of a parking bay;

      • name - name of a position’s group;

      • zone_id - id of a group’s zone.

  • message_type - message type;

  • message_trace_id - system message-id;

  • parking_session_iterator - short number of parking session. Iterator is incrementing when parking session starts (0-7);

  • occupied - parking occupancy status ("occupied" or "free");

  • heartbeat_message_counter - the value increases for every following heartbeat during single occupancy state (0-11);

User Registration (SDI Tag)

The message is sent to inform that a user has checked using an SDI tag.

Method: PUT/POST

Template Body:

{
  "device_id": "{modem_id}",
  "position":{
      "network_id": "{network_id}",
      "custom_id": "{custom_id}",
      "latitude": {latitude},
      "longitude": {longitude},
      "group_inner_id": {group_inner_id},
      "group":{
          "id": {group_id},
          "name": "{group_name}",
          "zone_id": {zone_id}
      }
  },
  "message_type": "user_registration",
  "message_trace_id": "{message_trace_id}",
  "occupied": "{"occupied" if parsed["occupation_status"] is True else "free"}",
  "auth_ble_tag": {
    "tag_id": "{parsed["user_ID"]}",
    "event_time": "{iso8601(message_time)}"
  }
}
 Example Message
{
   "device_id":"124244",
   "position":{
      "network_id":"00000000-0000-0000-0000-00000001e554",
      "custom_id":"",
      "latitude":51.49442797732277,
      "longitude":-0.1280093119192549,
      "group_inner_id":1,
      "group":{
         "id":4121,
         "name":"Test Group Delete After 26/02/2021",
         "zone_id":2779
      }
   },
   "message_type":"user_registration",
   "message_trace_id":"7d611a3f-f2a3-4653-b70a-7e3f07e5987f",
   "parking_session_iterator": {parsed["parking_session_iterator"]},
   "occupied":"occupied",
   "auth_ble_tag":{
      "tag_id":"1A2B3C4D",
      "event_time":"2021-02-26T18:06:14.000+00:00"
   }
}
 Device Info
  • device_id - device id hexadecimal

  • position

    • network_id - parking space network address;

    • custom_id - a property "custom_id" of a position;

    • latitude, longitude - GPS coordinates;

    • group_inner_id - a device number inside of a parking bay;

    • group

      • id - id of a parking bay;

      • name - name of a position’s group;

      • zone_id - id of a group’s zone.

  • message_type - message type;

  • message_trace_id - system message-id;

  • parking_session_iterator - short serial number of parking session. Iterator (number) is incrementing when new parking session starts (0-7);

  • occupied- parking occupancy status ("occupied" or "free");

  • auth_ble_tag

    • tag_id - an ID of Bluetooth tag which was used for authorization;

    • event_time - message reception time.

  • No labels