REST API

Get alarms

GET
https://api.realtime.report/v1/changes/get_alarms

Authentication: API Key

Get a list of all the setpoints with new values.

Parameters

device_id
INTEGER
Set the device of the alarms. (required)

Response

Returns data of the setpoints

201
application/json; charset=utf-8
id
String
The id of the tag
name
String
The name of the tag
is_setpoint
Bool
True if this is a setpoint and false if we have only read access.
is_alarm
Bool
True if this is an alarm and false if we have only read access.
value
Variable
The current value of this tag.

Example


/*
* Example get tag - How to get tag information from the  API
* https://api.realtime.report/v1/tags
*/
try {

	/*
    * Initialize the RealtimeReporter API SDK with your API key.
    * See: https://realtime.report/developer
    */
	require_once $_SERVER['DOCUMENT_ROOT'].'/vendor/autoload.php';

	$reporter = new reporter_api ;
    $reporter->set_api_key('YOUR API KEY');

	/*
	* All data is returned in a tag opject
	*/
    $alarms = $reporter->get_alarms('device_id');

    /*
    * In this example we print the data in json format on the page
    */
    echo "Setpoints data";
    echo json_encode($alarms, JSON_PRETTY_PRINT);


} catch (Exception $e) {
    echo "API call failed: " . htmlspecialchars($e->getMessage());
}


Response example

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
	{
	    "id": "82449b8e92eb4f678707",
	    "name": "Temprature to high",
	    "is_setpoint": false,
	    "is_alarm": true,
	    "value": 110
	},
	{
	    "id": "d01d2ac3e1184deea8a7",
	    "name": "To much wind",
	    "is_setpoint": false,
	    "is_alarm": true,
	    "value": 22
	},
	{.....},
	{.....}
]

Response Error

Returns an array with error information

230
application/json; charset=utf-8
code
Integer
The error code listed in a list below
message
String
The error message listed in a list below

Error Codes

1000
No valid API key
1001
No device found