Have a question? Call us +7 (499) 648-00-54
+7 (499) 648-00-54

Back-end API

Telecom back-end API allows sending HTTP-queries to the client application as new data becomes available from sensors. It is useful when you need to get the most up-to-date data as soon as possible. To enable access to WAVIoT Telecom API please send the inquiry now.

Basics

The back-end API consists of HTTP GET methods addressed to the client application server.

https://yourdomain.com/sensors/?sensor={device_id}&time={message_time}&snr={signal}&station={station_id}&rssi={rssi}&data={data}
Sending Parameters

device_id: Sensor identification number.
message_time: UNIX timestamp of the message received.
message_id: Message identification number.
signal: Signal noise rate of the message.
station_id: The base station identification number.
sector: The number of sector antenna received the message.
rssi: Received signal strength indicator.
data: Payload, sensor data.
iterator: Iterational message number.
lat: Sensors batch latitude.
long: Sensors batch longitude.
freq: Uplink frequency.

Example of usage:

https://parking-sensor-example.com/sensors/?sensor=7282129&time=1459247449&snr=20&station=1227&rssi=9&data=80030003180306F9

IoT Cloud API

Integrate 3rd party applications and custom solutions to WAVIoT Cloud platform easily with opened API. To enable access to WAVIoT Cloud API please send inquiry now.

Basics

The Web API consists of HTTP RPC-style methods, all of the form:
https://api.dgmatics.com/v1/method

All methods must be called using HTTPS. Request arguments can be passed as GET or POST params, or a mix. The API is a JSON-only API. You must supply a Content-Type: application/json; charset=utf-8 header in POST requests, and you must set an Accept: application/json; charset=utf-8 header on all requests.

Response format:

{
  "result": true,
  "items": [
    {"name":"sensor1"},
    {"name":"sensor2"}
  ]
}

WAVIoT responds to successful requests with a JSON object containing response data.

Specifying your groupId:

Some API calls require you to specify for what groupId you are making a request. You can find relevant groupIds and your orgId from the API Tokens tab.

Authentication

API authentication is achieved via two values, an access token and a secret key. These together identify an API access as belonging to a specific organization in the WAVIoT Cloud.

These values can be found from the API Tokens tab on the Organization settings page in the WAVIoT Cloud (accessible from the user drop-down in the upper-right of the Dashboard. After you create an API token, you must manually save the secret key to a safe location. Because this is equivalent to a user password, WAVIoT only stores a hashed form of the secret key value; not the actual value. If you lose the secret key for an API token, there is no way to recover it. You will need to create a new API token and save its new secret key.

All calls to API endpoints should set an X-Access-Token and an X-Secret-Key header value with the corresponding values provided by the WAVIoT Cloud.

Methods

Verify

This method checks authentication based on a specified token and is used to verify API connectivity and protocol.

https://api.dgmatics.com/v1/auth/verify

Example usage:

curl -H 'X-Access-Token: <your_access_token>' -H 'X-Secret-Key: <your_secret_key>' https://api.dgmatics.com/v1/auth/verify

Response:

{
  "result":true,
  "orgId":1
}

List

This method returns a list of the sensor objects in the WAVIoT Cloud and information about them. Be careful not to confuse the orgId for the groupId. The orgId is visible from the api_tokens page, and the groupId is visible from any sensor page.

https://api.dgmatics.com/v1/sensors/list

Request Parameters
Name Type Required Example Description
groupId int Yes 123 Group ID to query

Example usage:

curl -H 'X-Access-Token: <your_access_token>' -H 'X-Secret-Key: <your_secret_key>' -d '{"groupId":123}' https://api.dgmatics.com/v1/sensors/list

Response:

{
  "sensors": [
    {
      "id":1,
      "name":"Freezer ABC",
      "macAddress":"00:00:00:00:00:00"
    },
    {
      "id":2,
      "name":"Freezer DEF",
      "macAddress":"11:11:11:11:11:11"
    },
    …
  ]
}

Temperature

This method returns the current ambient temperature (and probe temperature if applicable) for the requested sensors.

https://api.dgmatics.com/v1/sensors/temperature

Request Parameters
Name Type Required Example Description
groupId int Yes 123 Group ID to query
sensors array Yes [0,1,2] Sensor IDs to query (limited to 10)

Example usage:

curl -H 'X-Access-Token: <your_access_token>' -H 'X-Secret-Key: <your_secret_key>' -d '{"groupId":1,"sensors":[0,1,2]}' https://api.dgmatics.com/v1/sensors/temperature

Returns a list of sensor objects containing information about the current state and temperature reported by each sensor:

{
  "groupId": 123,
  "sensors": [
    {
       "id": 0,
       "ambientTemperature": 11032 
    },
    {
       "id": 1,
       "ambientTemperature": 11001,
       "probeTemperature": -20145
    },
    {
       "id": 2,
       "ambientTemperature": 11057
    },
    …
  ]
}

id: Unique sensor identifier.
ambientTemperature: Currently reported ambient temperature in millidegrees celsius.
probeTemperature: Currently reported probe temperature in millidegrees celsius. If no probe is connected, this parameter will not be reported.

Humidity

This method returns the current relative humidity for the requested sensors.

https://api.dgmatics.com/v1/sensors/humidity

Request Parameters
Name Type Required Example Description
groupId int Yes 0 Group ID to query
sensors array Yes [0,1,2] Sensor IDs to query (limited to 10)

Example usage:

curl -H 'X-Access-Token: <your_access_token>' -H 'X-Secret-Key: 
<your_secret_key>' -d '{"groupId":0,"sensors":[0,1,2]}' 
https://api.dgmatics.com/v1/sensors/humidity

Returns a list of sensor objects containing information about the current state and humidity reported by each sensor:

{
  "sensors": [
    {
      "id":0,
      "humidity": 8412
    },
    {
      "id":1,
      "humidity": 532
    },
    {
      "id":3,
      "humidity": 588
    },
    …
  ]
}

id: Unique sensor identifier.
humidity: Currently reported relative humidity in percent, from 0-100.

History

This method returns a set of historical data for the specified sensors in the specified time range and at the specified time resolution. Because some sensors can sense multiple pieces of data, you must specify for each requested sensor for which field you would like the historical data.

Data will be returned “aligned” to time slices. For example, if you request data for sensor A from12/25/2015 00:00:00 to 12/25/2015 23:59:59 in 1 hour increments, you will receive 24 values, from 00:00:00 to 23:00:00, that represent the last known value for that sensor at00:00:00, 01:00:00, 02:00:00, etc. The fillMissing parameter specifies what to return for a sensor in a timeslice in which that sensor does not have a recorded value.

Time ranges are specified using UNIX time (i.e. “epoch time”) in milliseconds, which is defined as the number of milliseconds which have elapsed since 00:00:00 UTC time on Thursday, January 1, 1970. If needed, there are common UNIX time converters available online.

https://api.dgmatics.com/v1/sensors/history

Request Parameters
Name Type Required Example Description
groupId int Yes 1 Group ID to query.
startMs int Yes 53 Beginning of the time range, specified in milliseconds UNIX time.
endMS int Yes 1453449599999 End of the time range, specified in milliseconds UNIX time.
stepMs int Yes 3600000 Time resolution for which data should be returned, in milliseconds. (Ex: 3600000 ms/hour. Specifying 3600000 will return data at hour intervals).
series array Yes [{"widgetId":1,"field":"current_loop_1"}] Array of JSON objects each containing two fields:widgetId: The sensor ID for which to return data.field: Acceptable values for field are specified in the table below.
fillMissing string No "withNull""withPrevious" If a specified sensor does not have a data point in a timeslice being returned, this specifies whether null or the last valid value should be returned. Valid values are: "withNull": return null for a sensor with no value recorded in that timeslice."withPrevious": return the most recent, previously recorded value for a sensor in a timeslice with no values recorded for that sensor. If this parameter is omitted, it defaults to “withNull”.
Field Values

Because each sensor specified may track multiple values, you must specify for which field on a sensor you would like historical data. Acceptable values for field are:

ambientTemperature Ambient temperature
probeTemperature Probe temperature
currentLoop1Raw Raw 4-20mA current loop value on channel one of a WAVIoT IM sensor
currentLoop1Mapped Mapped 4-20mA current loop value on channel one of a WAVIoT IM sensor (based on the mapping applied at cloud.dgmatics.com.
currentLoop2Raw Raw 4-20mA current loop value on channel two of a WAVIoT IM sensor
currentLoop2Mapped Mapped 4-20mA current loop value on channel two of a WAVIoT IM sensor (based on the mapping applied at cloud.dgmatics.com.
pmPowerTotal Total power across all phases of a PM power meter
pmPhase1Power
pmPhase2Power
pmPhase3Power
Power on each individual phase of a PM power meter
pmPhase1PowerFactor
pmPhase2PowerFactor
pmPhase3PowerFactor
Power factor on each individual phase of a PM power meter

Example usage:

curl -H 'X-Access-Token: <your_access_token>' -H 'X-Secret-Key: <your_secret_key>' -d '{"groupId":1,"startMs":1453607226980,"endMs":1453693626980,"stepMs":7200000,"series":[{"widgetId":0,"field":"currentLoop1Mapped"},{"widgetId":1,"field":"pmPowerTotal"}]}' https://api.dgmatics.com/v1/sensors/history

Returns a list of results, with each result corresponding to the equivalent of a returned row of data, where each row contains a time and a datapoint for each requested sensor/field pair:

{
  "rows": [
    {
      "timeMs": 1453148078209,
      "series": [158152,76]
    },
    {
      "timeMs": 1453148138209,
      "series": [0,76]
    },
    {
      "timeMs": 1453148198209,
      "series": [0,76]
    },
    …
  ]
}

Changes & Versions

WAVIoT may modify the attributes and resources available to the API and our policies related to access and use of the API from time to time without advance notice. WAVIoT will use commercially reasonable efforts to notify customers of any modifications to the API or policies.


Ready to deploy IoT Application ?

Get started with trail kit now

Or tell us about your needs

Make an enquiry

© Copyright 2010 - 2016
All rights reserved, intellectual property covered with patents.

Disclaimer notice for information and content in this web-site.