Get Current Readings

Overview

This can be used to get the most recent current readings from compatible devices that are being managed with T&D WebStorage Service.
It is possible to get the same list of current readings in the "Data View" window of T&D WebStorage Service.

*Note that info about and related to warnings is not included at this time. We are however planning to include warning information in future revisions.

Request

URI

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

Access Restrictions

Read-Only ID is also possible

Compatible Models for this API

TR7A2/7A, TR-7wb/nw/wf series, TR4A series, RTR500B series (via HTTPS), RTR500B series (via FTP), TR32B, RTR-500 series, TR-700W series

Rate Limit

10 requests per allotted 2-minute span

When automatically uploading data to T&D WebStorage Service, the shortest possible uploading interval for devices such as TR-7wb/nw/wf is 1 minute.
We have designed the API so that it is possible to get the most current readings from devices like this which refresh every minute.
The rate limit allows for gaps in timing between devices, but we calculate that in most cases almost all conditions will be covered if current readings are retrieved from 2 to 5 times within a 2-minute period.

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-serialArray: string(8 characters)---Make entries here when wishing to select by using one or more Remote Unit Serial Numbers. It is possible to specify multiple units by using more than one array. (*1)
base-serialArray: string(8 characters)---Make entries here when wishing to select by using one or more Base Unit Serial Numbers. It is possible to specify multiple units by using more than one array. (*1)

(*1) For both “remote-serial” and “base-serial” it is possible to specify multiple units. However do not specify by using both “remote-serial” and “base-serial” at the same time. Make sure to specify by using only “remote-serial”, by using only “base-serial”, or by using neither of them to specify.
When specifying by using “remote-serial”, you are already specifying a base device and hence it is not necessary to use “base-serial”.
If specifying by serial number, even if only one serial number is specified make sure to describe as an array. (Please refer to the Request Example below.)

Request Example

Request Header

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

Request Body

[1. If you wish to get device info for all devices.]
{
"api-key":"73pfobnche8d1p6laqnemsbnpkght3bjv047oid6p2sg3", 
"login-id":"tbzz9999", 
"login-pass":"ppaasswwoorrdd"
} 


[2. If you wish to get device info from multiple Remote Units by using specific Remote Unit serial numbers]
{
"api-key":"73pfobnche8d1p6laqnemsbnpkght3bjv047oid6p2sg3", 
"login-id":"tbzz9999", 
"login-pass":"ppaasswwoorrdd",
"remote-serial":["52120001","52120002"]
} 
*In this example, two sets of data are being retrieved from TR-71wf[52120001] and TR-71wf[52120002].

[3. If you wish to get device info from a specific Base Unit and its registered Remote Units by using a specific Base Unit serial number]
{
"api-key":"73pfobnche8d1p6laqnemsbnpkght3bjv047oid6p2sg3", 
"login-id":"tbzz9999", "login-pass":"ppaasswwoorrdd", 
"base-serial":["52A010D0"]
}
*In this example, all data for all Remote Units registered to our company’s demo device RTR-500AW[52A010D0] is being retrieved. 

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.

[1. If you wish to get device info for all devices.]
curl -X POST \
  -H "Content-Type: application/json" \
  -H "X-HTTP-Method-Override: GET" \
  -d '{"api-key":"73pfobnche8d1p6laqnemsbnpkght3bjv047oid6p2sg3","login-id":"tbzz9999","login-pass":"ppaasswwoorrdd"}' \
  https://api.webstorage-service.com:443/v1/devices/current

[2. If you wish to get device info from multiple Remote Units by using specific Remote Unit serial numbers]
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":["52120001","52120002"]}' \
  https://api.webstorage-service.com:443/v1/devices/current
*In this example, two sets of data are being retrieved from TR-71wf[52120001] and TR-71wf[52120002].

[3. If you wish to get device info from a specific Base Unit and its registered Remote Units by using a specific Base Unit serial number]
curl -X POST \
  -H "Content-Type: application/json" \
  -H "X-HTTP-Method-Override: GET" \
  -d '{"api-key":"73pfobnche8d1p6laqnemsbnpkght3bjv047oid6p2sg3","login-id":"tbzz9999","login-pass":"ppaasswwoorrdd","base-serial":["52A010D0"]}' \
  https://api.webstorage-service.com:443/v1/devices/current
*In this example, all data for all Remote Units registered to our company’s demo device RTR-500AW[52A010D0] is being retrieved. 

Response

Response Header

Item NameValueDetails
HTTP status code(**)HTTP Status Code
Content-Typeapplication/json; charset=utf-8Character 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. 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

Item Name Format Details
devices Array Device (Remote Unit) Info shown here as an array in which the number of elements equals the number of devices.
If there is a combination of Base Units and Remote Units, only the Remote Unit Info is included.
  devices.num string(*1) Device (Remote Unit) Number shown here. In the case of an independently operating device (no Base required), then fixed at “0”.
  devices.serial string(8 characters) Device (Remote Unit) Serial Number
  devices.model string(32 characters) Device (Remote Unit) Model Name
  devices.name string(32 characters) Device (Remote Unit) Device Name
  devices.battery string(*1) Device (Remote Unit) Battery Level
TR7A2/7A, TR-7wb/nw/wb series
  1: Very low - change now | 2: Low - change soon | 3: Getting Low | 4: Medium | 5: High
RTR500B/RTR-500 series/TR4A series
  1-3: Very low - change now | 4: Low - change soon | 5: High
  devices.rssi string(*1) Device (Remote Unit) Radio Signal Strength
  devices.time_diff string(*1) Device Time Difference Info [in units of minutes] shown here. If it is a Remote Unit, then the time difference info will be that set in Base Unit to which it is registered.
  devices.std_bias string(*1) Device Time Difference from Standard [in units of minutes] shown here. If it is a Remote Unit, then the time difference from standard info will be that set in Base Unit to which it is registered.
  devices.dst_bias string(*1) Device Time Difference during Daylight Savings Time [in units of minutes] shown here. If it is a Remote Unit, then the time difference during daylight savings time info will be that set in Base Unit to which it is registered.
  devices.unixtime string(*1) Device (Remote Unit) Clock Time of Most Recent Measurement (unixtime)
  devices.channel Array Device (Remote Unit) Measurement Channel Info shown here. Array in which the number of measurement channels is the number of elements.
    devices.channel.num string(*1) Channel Number
    devices.channel.name string(32 characters) Channel Name
    devices.channel.value string(*1)(*2) Most Recent Measurement Reading shown here.
    devices.channel.unit string(20 characters) Unit of Measurement shown here. If scale conversion is taking place, then the value will be the post converted measurement value.
  devices.baseunit Array Base Unit Info shown here. Array in which the number of Base Units is the number of elements.
Even if it is an independently operating device (no Base required), the device info will be entered as if it were a Base Unit.
    devices.baseunit.serial string(8 characters) Base Unit Serial Number (if it is an independently operating device (no Base required), then it will be that device’s serial number)
    devices.baseunit.model string(32 characters) Base Unit Model Name (if it is an independently operating device (no Base required), then it will be that device’s model name)
    devices.baseunit.name string(32 characters) Base Unit Device Name (if it is an independently operating device (no Base required), then it will be the device name of that device)
  devices.group Array Group Info shown here. Array in which the number of groups is the number of elements.
Even if there are devices with no Group settings, the number “0” will treated as one element.
    devices.group.num string(*1) Group Number (If it is a device with no Group settings, then fixed at “0”. )
    devices.group.name string(16 characters) Group Name (If it is a device with no Group settings, then blank data.)

(*1) The value is a number, but the type is character-based.
(*2) If the measured value is obtained, a numeric value of character type is returned, but if an error occurs, an error value starting with E is returned.

* “Independently operating devices” refers to such devices as in the TR7A2/7A, TR-7wb/nw/wf Series, TR4A Series, and the TR-700w series which can send data to T&D WebStorage Service acting alone without a Base Unit.

Response Example

{
	"devices": [{
			"num": "2",
			"serial": "52BC078B",
			"model": "RTR-503",
			"name": "02",
			"battery": "5",
			"rssi": "5",
			"time_diff": "540",
			"std_bias": "0",
			"dst_bias": "0",
			"unixtime": "1476150408",
			"channel": [{ 
					"num": "1",
					"name": "",
					"value": "23.9", 
					"unit": "C"
				}, {
					"num": "2",
					"name": "",
					"value": "40",
					"unit": "%"
				}
			],
			"baseunit": {
				"serial": "529C0051",
				"model": "RTR-500NW",
				"name": "RTR-500NW_529C0051"
			},
			"group": {
				"num": "0",
				"name": "Group1"
			}
		},{
			"num": "1",
			"serial": "52BC1495",
			"model": "RTR-503",
			"name": "01",
			"battery": "5",
			"rssi": "5",
			"time_diff": "540",
			"std_bias": "0",
			"dst_bias": "0",
			"unixtime": "1476150411",
			"channel": [{
					"num": "1",
					"name": "",
					"value": "23.9",
					"unit": "C"
				}, {
					"num": "2",
					"name": "",
					"value": "39",
					"unit": "%"
				}
			],
			"baseunit": {
				"serial": "529C0051",
				"model": "RTR-500NW",
				"name": "RTR-500NW_529C0051"
			},
			"group": {
				"num": "0",
				"name": "Group1"
			}
		}
	]
}

MENU