POST /signals

The API to create a signal is

POST https://api.databoom.com/v1/signals/

To call the API a token OAuth with Create permission is needed.

In the request body you need to specify the following fields

  •   device, _id of the device;
  •   type, _id of theh type of signal (list is available with API);
  •   signal_token, a unique value for the specified device;
  •   description,  description of the signal.

Among the optional fields, it may useful to specify:

  • status, with INIT as default value at creation, it can be set directly as ACTIVE to skip validation;
  • unit_readable, to speify the unit of measurament of the signal.

Same call in cURL is

curl --location --request POST 'https://api.databoom.com/v1/signals' \
--header 'Authorization: Bearer <OAuth Token>' \
--header 'Content-Type: application/json' \
--data-raw '{
 "device": "58943667a27217000193f4d4",
 "type": "5718ca3f4ef29d440851589b",
 "signal_token": "postman_signal",
 "description": "Postman Signal",
 "status":"ACTIVE",
 "unit_readable" : "μg/m3"
}'

The API returns the signal.

 


 

Follows an example response:

{
   "command_status": {
       "status": "EXECUTED"
   },
   "values_filtering": {
       "enable": false
   },
   "chart_scale": {
       "active": false,
       "min_chart_scale": 0,
       "max_chart_scale": 0
   },
   "rescale": {
       "min_value": {
            "original": 0,
           "evaluated": 0
       },
       "max_value": {
           "original": 1000,
            "evaluated": 1000
       },
        "active": false
   },
   "accumulator": {
       "active": false,
       "offset": 0,
       "is_a_sum": false,
       "start_date": "2020-10-12T13:33:45.377Z"
   },
   "virtual_compute_granularity": {
       "compute": false,
       "granularity": "*"
    },
   "name": "",
   "description": "Postman Signal",
   "notes": "",
   "sampling_rate": 5,
   "command_enable": false,
   "showEvents": false,
   "status": "ACTIVE",
   "unit_prefix": "",
   "decimals": 2,
   "autocomplete": false,
   "manual_edit_active": false,
   "chart_type": "LINE",
   "min_granularity": "*",
   "alarms_on": true,
   "log_on": true,
   "skip_log": false,
   "is_cached": false,
   "partial_cache": false,
   "virtual_signal": false,
   "inline_virtual": false,
   "children": [],
   "_id": "5f845b39295a943a35e5427a",
   "public_obj": false,
   "deleted": false,
   "deletedAt": null,
   "tags": [],
   "device": "58943667a27217000193f4d4",
   "type": {
       "counter": {
           "active": false,
           "incremental": false
       },
       "limits": {
           "fixed": false,
           "max": 0,
           "min": 0
       },
       "graph": "LINE",
       "decimals": 2,
       "_id": "5718ca3f4ef29d440851589b",
       "description": "ALTRO",
       "unit": "",
       "description_en": "other",
       "icon": "fa fa-wifi fa-2x"
   },
   "signal_token": "postman_signal",
   "unit_readable": "μg/m3",
   "last_value_rules": [],
   "orders": [],
   "command_label_rules": [],
   "unit": [],
   "info": [],
   "virtual_signal_list": [],
   "permissions": [
       {
            "is_a_team_member": false,
           "fake": false,
           "max_chart_history": 0,
           "_id": "5f845b39295a9433a4e54284",
           "roles": "CREATOR",
           "user_id": "5693799a2ce24d2300439324"
       }
   ],
   "lastModDate": "2020-10-12T13:33:45.740Z",
   "created": "2020-10-12T13:33:45.377Z",
   "device_description": "Random",
   "device_token": "0hki456nf3",
   "revision": 1,
   "lastModUser": "5693799a2ce24d2300439324",
   "__v": 0,
   "id": "5f845b39295a943a35e5427a"
}

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.