The API to update a signal is the following
PUT https://api.databoom.com/v1/signals/{signalId}
To call the API an OAuth token with Update permission is needed.
{signalId} in the URL must be replaced with the _id of the signal you want to update.
It is possible to update a signal only if you have Creator or Administrator permissions.
The request body has to be filled with the fields you want to update. In the example image above signal description update is shown.
Same call in cURL is
curl -X PUT \
https://api.databoom.com/v1/signals/5ccfe0e36cc4eab9a05c370f \
-H 'Authorization: Bearer <OAuth Token>' \
-H 'Content-Type: application/json' \
-d '{
"description":"New description"
}'
The API responds with the signal filled with all its fields, properties specified in the request are updated.
Follows an example response, description field is updated.
{
"_id": "5ccfe0e36cc4eab9a05c370f",
"lastModUser": "5693799a2ce24d2300439324",
"revision": 1,
"device_token": "0rc0qi8qc0",
"device_description": "API test",
"device": "5cd2c794509393c4ac6427bb",
"type": "5718ca3f4ef29d440851589b",
"signal_token": "08atl0rfub",
"tags": [],
"created": "2019-05-08T12:12:18.278Z",
"lastModDate": "2019-05-08T12:12:18.434Z",
"deletedAt": null,
"deleted": false,
"public_obj": false,
"virtual_signal_list": [],
"children": [],
"inline_virtual": false,
"virtual_signal": false,
"partial_cache": false,
"is_cached": false,
"virtual_compute_granularity": {
"granularity": "*",
"compute": false
},
"accumulator": {
"is_a_sum": false,
"offset": 0,
"start_date": "2019-05-08T12:12:18.278Z",
"active": false
},
"skip_log": false,
"log_on": true,
"alarms_on": true,
"info": [],
"rescale": {
"max_value": {
"evaluated": 1000,
"original": 1000
},
"min_value": {
"evaluated": 0,
"original": 0
},
"active": false
},
"chart_scale": {
"max_chart_scale": 0,
"min_chart_scale": 0,
"active": false
},
"min_granularity": "*",
"chart_type": "LINE",
"manual_edit_active": false,
"autocomplete": false,
"values_filtering": {
"enable": false
},
"decimals": 2,
"unit_prefix": "",
"unit": [],
"status": "INIT",
"command_status": {
"status": "EXECUTED"
},
"showEvents": false,
"command_label_rules": [],
"command_enable": false,
"orders": [],
"last_value_rules": [],
"sampling_rate": 5,
"notes": "",
"description": "New description",
"name": "",
"__v": 0,
"role": "CREATOR"
}
1 Comments