Get Alert Logs (20 most recent entries) [TR7A2/7A, TR-7nw/wb/wf, RTR500BW/RTR500BM]

Overview

This can be used to get the 20 most recent log entries from compatible devices that are being managed with T&D WebStorage Service.

Request

URI

https://api.webstorage-service.com/v1/devices/alert

Access Restrictions

Read-Only ID is also possible

Compatible Models for this API

TR7A2/7A, TR-7nw/wb/wf series, RTR500B series (via HTTPS)

* The alert logs for RTR500BM itself (battery level / external power / contact input) cannot be retrieved using this API.

Rate Limit

12 requests per allotted 1-hour span

It is designed to allow retrieval of all alert logs stored in T&D WebStorage Service (up to 20 entries), even if a warning alert is sent every 30 seconds.
* The shortest possible warning monitoring interval is 30 seconds.

The rate limit itself is designed to avoid concentrated access during a short period of time and balance out the load. Please be aware of this before using.

Request Header

Item NameValue
HTTP MethodPOST
X-HTTP-Method-OverrideGET
Hostapi.webstorage-service.com:443
Content-Typeapplication/json

Request Parameter

Parameter NameFormatRequiredDefault ValueDetails
api-keystring(45 characters)Yes---Already acquired API Key
login-idstring(8 characters)Yes---User ID Read-Only ID is also possible.
login-passstring(4~16 characters)Yes---The password for the above User ID.
remote-serialstring(8 characters)Yes---Device Serial Number of the device from which graph data will be extracted. Not possible to select more than one unit at a time.
base-serialstring(8 characters)Yes---Serial Number of the Base Unit to which the above Remote Unit is registered (if it is an independently operating device (no Base required), then it will be that device’s serial number). Not possible to select more than one unit at a time.

Request Example

Request Header

POST /v1/devices/alert HTTP/1.1
Host: api.webstorage-service.com:443
Content-Type: application/json
X-HTTP-Method-Override: GET

Request Body

{
"api-key":"73pfobnche8d1p6laqnemsbnpkght3bjv047oid6p2sg3",
"login-id":"tbzz9999",
"login-pass":"ppaasswwoorrdd",
"remote-serial":"52BA0001",
"base-serial":"58580001"
}

*In this example, the most recent 20 log entries for the RTR-502(sn:52BA0001) which was registered to the RTR500BW(sn:58580001) was retrieved in json format.

Request Example using Curl

This is an example of request using the curl command, which is available from the command line on Windows and Mac devices.
The example command includes request header and request body.

curl -X POST \
  -H "Content-Type: application/json" \
  -H "X-HTTP-Method-Override: GET" \
  -d '{"api-key":"73pfobnche8d1p6laqnemsbnpkght3bjv047oid6p2sg3","login-id":"tbzz9999","login-pass":"ppaasswwoorrdd","remote-serial":"52BA0001","base-serial":"58580001"}' \
  https://api.webstorage-service.com:443/v1/devices/alert

Response

Response Header

Item NameValueDetails
HTTP status code(**)HTTP Status Code
Content-Typeapplication/json; charset=utf-8(Character code is UTF-8)
X-RateLimit-Limit(integer)Maximum number of requests per allotted time span
X-RateLimit-Reset(integer)Number of seconds in the allotted time span
X-RateLimit-Remaining(integer)Remaining number of requests per allotted time span

(**) If the HTTP status code is “200”, then the process has been completed successfully. If any other HTTP status code is returned, then an error has occurred and processing was not completed. As shown below, if an error does occur, JSON data with the error info included will be returned.

HTTP/1.1 400 Bad Request
Server: api.webstorage-service.com
Content-Type: application/json; charset=utf-8
X-RateLimit-Limit: 60
X-RateLimit-Reset: 60
X-RateLimit-Remaining: 57

{
	"error":{
		"code": error code,
		"message": "error details"
	}
}

Response Parameter (JSON format)

In the following, when an item name includes a period (.) as in “channel.name”, this indicates that the elements of the array are included in the item, in this case “channel”.

Item Name Format Details
remote-serial string Serial Number of Selected Remote Unit
remote-model string Model Name of Selected Remote Unit
remote-name string Device Name of Selected Remote Unit
base-serial string Base Unit Serial Number (if it is an independently operating device (no Base required), then it will be that device’s serial number)
base-model string Base Unit Model Name (if it is an independently operating device (no Base required), then it will be that device’s model name)
base-name string Base Unit Device Name (if it is an independently operating device (no Base required), then it will be the device name of that device)
time-diff string(*1) Base Unit Time Difference Info [in units of minutes] shown here. (If it is an independently operating device (no Base required), then it will be the time difference info set in the device.)
std-bias string(*1) Base Unit Time Difference from Standard [in units of minutes] shown here. (If it is an independently operating device (no Base required), then it will be the time difference from the standard time set in the device.)
dst-flg string(*1) Base Unit Daylight Savings Time Flag. “1” will be returned when the daylight savings time (DST) setting is ON, and “0” will be returned when it is OFF. (If it is an independently operating device (no Base required), then it will be the daylight savings time flag based on the DST setting for the device.)
dst-bias string(*1) Device Time Difference during Daylight Savings Time [in units of minutes] shown here. This value is fixed at “60” regardless of the DST setting on the device.
channel Array Measurement Channel Info shown here. If the device selected does not include sufficient data, it may result in an empty array.
  channel.name string Channel Name (*2)
  channel.num string(*1) Channel Number (1~4)
  channel.unit string Unit of Measurement for Channel
alert-logs Array If the number of data readings is "0”, then the array is blank.
  alert-logs.unixtime string(*1) Date and time of alert (unixtime)
  alert-logs.ch1 string The contents for ch1 alert for the above unixtime. This will not exist if there is no ch1 alert.
  alert-logs.ch2 string The contents for ch2 alert for the above unixtime. This will not exist if there is no ch2 alert.
  alert-logs.ch3 string The contents for ch3 alert for the above unixtime. This will not exist if there is no ch3 alert.
  alert-logs.ch4 string The contents for ch4 alert for the above unixtime. This will not exist if there is no ch4 alert.
  alert-logs.ch5 string The contents for ch5 alert for the above unixtime. This will not exist if there is no ch5 alert.
  alert-logs.ch6 string The contents for ch6 alert for the above unixtime. This will not exist if there is no ch6 alert.
  alert-logs.battery-level string The contents for battery level alert for the above unixtime. This will not exist if there is no alert for battery level.
  alert-logs.communication-status string The contents for communication status alert for the above unixtime. This will not exist if there is no alert for communication status.

(*1) The value is a number, but the type is character-based.
(*2) The channel name cannot be set for the RTR500B Series and RTR-500 Series Remote Units, and "ch + channel number" will be entered here.

Response Example(JSON format)

*Please note that actual responses may not be in such clear understandable form as shown in the example below.

HTTP/1.1 200 OK
Server: api.webstorage-service.com
Content-Type: application/json; charset=utf-8
X-RateLimit-Limit: 60
X-RateLimit-Reset: 60
X-RateLimit-Remaining: 57

{
    "remote-serial": "52140001",
    "remote-model": "TR-72wf",
    "remote-name": "outside",
    "base-serial": "52140001",
    "base-model": "TR-72wf",
    "base-name": "at-west",
    "time-diff": "540",
    "std-bias": "0",
    "dst-flg": "0",
    "dst-bias": "60",
    "channel": [
        {
            "name": "temp",
            "num": "1",
            "unit": "C"
        },
        {
            "name": "humid",
            "num": "2",
            "unit": "%"
        }
    ],
    "alert-logs": [
        {
            "unixtime": "1742259344",
            "ch1": "[ch1:temp] Upper Limit Exceeded: 31.5 C (Upper Limit: 26.0 C)",
            "ch2": " [ch2:humid] Upper Limit Exceeded: 82 % (Upper Limit: 70 %)",
            "battery-level": "[Battery Level] No Warning"
        },
        {
            "unixtime": "1742258355",
            "ch1": " [ch1:temp] Back to Normal",
            "ch2": " [ch2:humid] Back to Normal",
            "battery-level": "[Battery Level] In Warning State"
        },
        {
            "unixtime": "1742254755",
            "ch1": "[ch1:temp] Sensor Error: --- C",
            "ch2": "[ch2:humid] Sensor Error: --- %",
            "battery-level": "[Battery Level] No Warning"
        }
    ]
}

MENU