data.mossengine.com

DataPoint API documentation



BASE URL:

https://data.mossengine.com/v1


datapoint types:

string
number
boolean
datetime


request new datapoint:

request
GET /new/{datapoint_type}
response
{
  "status": true,
  "message": "DataPoint successfully created",
  "data": {
    "key": "bcce730c13184e29b10...0ec3adc472429131a82",
    "read": "c1e0ba37c1629f723e...586ff6b74f65d374ec5",
    "write": "ed815dd96a745764a...ec00355adacfc78fc5f9",
    "admin": "51768f9eadc8e8992...d499e616e69b5713c030",
    "type": "string",
    "value": null,
    "attributes": null,
    "history": null
  }
}


get datapoint value:

request
GET /{datapoint_key}/{datapoint_read}
response
{
  "status": true,
  "message": "DataPoint Value successfully found",
  "data": {
    "key": "bcce730c13184e29b10...0ec3adc472429131a82",
    "type": "string",
    "value": null,
    "attributes": null,
    "history": null
  }
}


datapoint functions:

request
GET /{datapoint_key}/{datapoint_write}/{datapoint_type_function}
response
{
  "status": true,
  "message": "DataPoint Value successfully saved",
  "data": {
    "key": "bcce730c13184e29b10...0ec3adc472429131a82",
    "type": "string",
    "value": "{alerted_value}",
    "attributes": null,
    "history": {
      "value": [
        {
          "2017-06-30 05:37:29": "{alerted_value}"
        }
      ]
    }
  }
}


functions:

string
set/{new_value}
append/{extra_value}
prepend/{extra_value}

number
set/{new_value}
addition/{modifier_value}
subtract/{modifier_value}
multiply/{modifier_value}
divide/{modifier_value}

boolean
set/{new_value}
toggle

datetime
set/{new_value}
seconds/{modifier_value}
minutes/{modifier_value}
hours/{modifier_value}
days/{modifier_value}
weeks/{modifier_value}
months/{modifier_value}
years/{modifier_value}


set datapoint attributes:

request
GET /{datapoint_key}/{datapoint_write}/attribute/{attribute_key}/{attribute_value}
response
{
  "status": true,
  "message": "DataPoint Attribute successfully saved",
  "data": {
    "key": "bcce730c13184e29b10...0ec3adc472429131a82",
    "type": "string",
    "value": null,
    "attributes": {
      "{attribute_key}": "{attribute_value}"
    },
    "history": null
  }
}