RTDMS Restful APIv1.0
RTDMS Restful APIv1.0
Version 1.0
RTDMS REST API version 1.0
© 2015 LogicLadder
1
RTDMS REST API version 1.0
1.1 EndPoint
http://182.75.69.206:8080/v1.0/industry/<industryId>/station/<stationId>/data
1.2 Method
Request should be through POST method.
1.3 Header
The request should contain a valid token in Authorization header. The token should be Base64
encoded. The header format should be:
Note:- Here industryId and stationId corresponding to industryId and stationId available in
vendor system.
Note:-
When device is in Calibration mode or Zero Calibration mode then vendor should capture
and push one data point at every 30 sec.
The json should provide an array of data object, specific to each device installed at a station.
The request json to be posted would be :
© 2015 LogicLadder
2
RTDMS REST API version 1.0
[
{
"deviceId": "xxxx",
"params": [
{
"parameter": "xxxx",
"value": xxxx,
"unit": "xxx",
"timestamp": xxxx,
"flag": "U|C|M|F|Z|D"
}
],
"diagnostics": [
{
"diagParam": "xxxx",
"value": xxxx,
"timestamp": xxxx
}
]
}
]
© 2015 LogicLadder
3
RTDMS REST API version 1.0
“parameter”:”bod”,
“value”:28,
“unit‘:”mg/l”
“timestamp”:1441686170004
“flag”:”U”
}]
© 2015 LogicLadder
4
RTDMS REST API version 1.0
“diagParam”:“humidityAlert”,
“value”: 0,
“timestamp”:1441686170004
},
{
“diagParam”:“deviceTemperature”,
“value”: 49,
“timestamp”:1441686170004
}]
[
{
"deviceId": "sn-123-d-56",
"params": [
{
"parameter": "cod",
"value": 198,
"unit": "mg/l",
"timestamp": 1441686170004,
"flag": "U"
},
{
"parameter": "bod",
"value": 28,
"unit": "mg/l",
"timestamp": 1441686170004,
"flag": "U"
}
],
© 2015 LogicLadder
5
RTDMS REST API version 1.0
"diagnostics": [
{
"diagParam": "humidityAlert",
"value": 0,
"timestamp": 1441686170004
},
{
"diagParam": "devTemperature",
"value": 49,
"timestamp": 1441686170004
}
]
},
{
"deviceId": "sn-124-d-58",
"params": [
{
"parameter": "ph",
"value": 7.8,
"unit": “",
"timestamp": 1441686170004
"flag": "U",
},
]
"diagnostics": [
{
"diagParam": "devTemperature",
"value": 49,
"timestamp": 1441686170004
}
]
}
]
1.5 Response
Success: If data uploaded successfully
© 2015 LogicLadder
6
RTDMS REST API version 1.0
"msg": "success",
“status”: 1
}
© 2015 LogicLadder
7
RTDMS REST API version 1.0
"serialNo": "xyz",
"parameters": [{
"parameter": "abc"
}]
}]
}]
}]
},
"invalidUnits": {
"industries": [{
"industryId": "abc",
"stations": [{
"stationId": "xyz",
"devices": [{
"serialNo": "xyz",
"parameters": [{
"parameter": "abc",
"unit": "mg/L"
}]
}]
}]
}]
}
}
This api is used to upload parameters value of multiple stations of an industry. A station can be
an ETP or a stack. A station can have multiple devices installed to record different environment
parameters (cod, bod, tss, pH, flow, Sox, Nox, PM etc).
2.1 EndPoint
http://182.75.69.206:8080/v1.0/industry/<industryId>/data
2.2 Method
© 2015 LogicLadder
8
RTDMS REST API version 1.0
2.3 Header
The request header should contain a valid token in Authorization header. The token should be
Base64 encoded. The header format should be:
Note:-
When device is in Calibration mode or Zero Calibration mode then vendor should capture
and push one data point at every 30 sec.
The request accepts an array of stations with its data. The request json to be posted would be :
[
{
"stationId": "xxxx",
"data": [
{
"deviceId": "xxxx",
"params": [
{
"parameter": "xxxx",
"value": xxxx,
"unit": "xxx",
"timestamp": xxxx,
"flag": "U|C|M|F|Z|D"
}
],
"diagnostics": [
{
"diagParam": "xxxx",
"value": xxxx,
"timestamp": xxxx
}
]
}
]
© 2015 LogicLadder
9
RTDMS REST API version 1.0
}
]
[{
"stationId": "stack1",
"data": [{
"deviceId": "sn-123-d-56",
"params": [{
"parameter": "cod",
"value": 198,
"unit": "mg/l",
"timestamp": 1441686170004,
"flag": "U"
}, {
"parameter": "bod",
"value": 28,
"unit": "mg/l",
"timestamp": 1441686170004,
"flag": "U"
}],
"diagnostics": [{
"diagParam": "humidityAlert",
"value": 0,
"timestamp": 1441686170004
}, {
"diagParam": "devTemperature",
© 2015 LogicLadder
10
RTDMS REST API version 1.0
"value": 49,
"timestamp": 1441686170004
}]
}, {
"deviceId": "sn-124-d-58",
"params": [{
"parameter": "ph",
"value": 7.8,
"unit": " ",
"timestamp": 1441686170004,
"flag": "U"
}],
"diagnostics": [{
"diagParam": "devTemperature",
"value": 51,
"timestamp": 1441686170004
}]
}]
}, {
"stationId": "stack2",
"data": [...]
}]
2.5 Response
Success: If data uploaded successfully
© 2015 LogicLadder
11
RTDMS REST API version 1.0
"msg": "failed",
"status": 0,
"invalidIndustries": {
"industries": [
{
"industryId": "abc"
}
]
},
"invalidStations": {
"industries": [
{
"industryId": "abc",
"stations": [
{
"stationId": "xyz"
}
]
}
]
},
"invalidDevices": {
"industries": [
{
"industryId": "abc",
"stations": [
{
"stationId": "xyz",
"devices": [
{
"serialNo": "xyz"
}
]
}
]
}
]
},
"invalidParameters": {
"industries": [
{
"industryId": "abc",
© 2015 LogicLadder
12
RTDMS REST API version 1.0
"stations": [
{
"stationId": "xyz",
"devices": [
{
"serialNo": "xyz",
"parameters": [
{
"parameter": "abc"
}
]
}
]
}
]
}
]
},
"invalidUnits": {
"industries": [
{
"industryId": "abc",
"stations": [
{
"stationId": "xyz",
"devices": [
{
"serialNo": "xyz",
"parameters": [
{
"parameter": "abc",
"unit": "mg/L"
}
]
}
]
}
]
}
]
}
}
© 2015 LogicLadder
13
RTDMS REST API version 1.0
© 2015 LogicLadder
14
RTDMS REST API version 1.0
station can have multiple devices installed to record different environment parameters (cod,
bod, tss, pH, flow, Sox, Nox, PM etc).
3.1 EndPoint
http://182.75.69.206:8080/v1.0/industry/<industryId>/station/<stationId>/correction
Note:- Here industryId and stationId corresponding to industryId and stationId available in
vendor system.
3.2 Method
Request should be through POST method.
3.3 Header
The request should contain a valid token in Authorization header. The token should be Base64
{
"approvedbySPCB": "true/false",
"regionalOffice": "xxxx",
"officialName": "xxxx",
"officialEmail": "xxxx",
© 2015 LogicLadder
15
RTDMS REST API version 1.0
"officialContact": "xxxx",
"approvalReason": "xxxx",
"submittedBy": "xxxx",
"submissionDateTime": "xxxx",
"correctionReason": "xxxx",
"requestID": "xxxx",
"responseURL": "xxxx",
"params": [
{
"paramName": "xxxx",
"data": [
{
"dataTimestamp": 1441686170004,
"newValue": 5.14
},
{
"dataTimestamp": 1441686170004,
"newValue": x.xxxx
}
]
},
{
"paramName": "xxxx",
"data": [
{
"dataTimestamp": 1441686170004,
"newValue": x.xxxx
}
]
}
]
}
© 2015 LogicLadder
16
RTDMS REST API version 1.0
© 2015 LogicLadder
17
RTDMS REST API version 1.0
3.5 Response
Success: If data uploaded successfully
© 2015 LogicLadder
18
RTDMS REST API version 1.0
{
“requestId”:”1234”,
“status”: “Approved/Rejected”,
“reason”:”valid data”
}
Parameter Description
4.1 EndPoint
http://182.75.69.206:8080/v1.0/sms/<industry_Id >
4.2 Method
Request should be through POST method.
4.3 Header
The request should contain a valid token in Authorization header. The token should be Base64
encoded. The header format should be:
© 2015 LogicLadder
19
RTDMS REST API version 1.0
Note:- Here Industry_Id refers the actual Industry Id available at vendor system.
The json should provide the details of parameter with its min and max value along with contact
details. The request json to be posted would be :
[{
"parameter": "xx",
"min_limit": xxx,
"max_limit": xxx,
"sms_count": xxx,
"exceedance_count": xxx,
"unit" : "xxxxxx",
"date": "x-xxx-xxxx",
"contact_details": [{
"user_type": "xxxxxxxxxx",
"contact_name": "xxxxxxxx",
"contact_phone": "xxxxxxxx",
"contact_email":”xxxxxxxx”
}, {
"user_type": "xxxxx",
"contact_name": "xxxxx",
"contact_phone": "xxxxxxxxxxxx",
"contact_email":”xxxxxxxx”
}]
}, {
"parameter": "xxx",
"min_limit": xx,
"max_limit": xx,
"sms_count": xx,
"exceedance_count": xxx,
"unit": "xx",
"date": "xx-xxx-xxxx",
"contact_details": [{
"user_type": "xxxxxxxxxx",
"contact_name": "xxxxxxxx",
"contact_phone": "xxxxxxxxxxxx",
"contact_email":”xxxxxxxx”
}]
}]
© 2015 LogicLadder
20
RTDMS REST API version 1.0
© 2015 LogicLadder
21
RTDMS REST API version 1.0
[{
"parameter": "pm",
"min_limit": 10,
"max_limit": 100,
"sms_count": 40,
"exceedance_count": 10,
"unit" : "mg/Nm3",
"date": "24-Feb-2016",
"contact_details": [{
"user_type": "CPCB",
"contact_name": "Mr.Rahul",
"contact_phone": "8512899322",
"contact_email":”[email protected]”
}, {
"user_type": "INDUSTRY",
"contact_name": "Mr.vivek",
"contact_phone": "9310161018",
"contact_email":”[email protected]”
}]
}, {
"parameter": "ph",
"min_limit": 0,
"max_limit": 14,
"sms_count": 50,
"exceedance_count":10,
"unit": "ph",
"date": "24-Feb-2016",
"contact_details": [{
"user_type": "INDUSTRY",
"contact_name": "Mr.Rahul",
© 2015 LogicLadder
22
RTDMS REST API version 1.0
"contact_phone": "8512899322",
"contact_email":”[email protected]”
}]
}]
4.5 Response
Success: If data uploaded successfully
5 Annexure
5.1 Parameter Keys
© 2015 LogicLadder
23
RTDMS REST API version 1.0
Flow flow
Chromium chromium
Ammonical Nitrogen ammonical_nitrogen
Fluoride fluoride
Phenol phenol
Cyanide cyanide
Arsenic as
Adsorbable organic halogens aox
Temperature for Effluent ef_temperature
Temperature for Emission em_temperature
Particulate Matter pm
Dust pm
SPM pm
Sulfur Dioxide so2
Sulfur Oxides sox
Chlorine cl
Hydrochloric acid hcl
Ammonia ammonia
Carbon Monoxide co
Carbon Dioxide co2
Hydro carbon hc
Nitrogen Oxide no
Nitrogen Dioxide no2
Nitrogen Oxides nox
Total carbon tc
Hydrogen Sulfide h2s
Hydrogen fluoride hf
Opacity opacity
Velocity velocity
Conductivity conductivity
Oil & Grease oil_grease
Ammoniacal nitrogen nh4-n
Dissolved oxygen do
Cyanide ion cn-
Nitrate as Nitrogen no3-n
Arsenic as
color color
H2O h2o
Total volatile organic compound tvoc
Vinyl chloride monomer vcm
O2 o2
© 2015 LogicLadder
24
RTDMS REST API version 1.0
Benzene benzene
Total dissolved solids tds
Total organic carbon toc
Ammonium ammonium
Flow Outlet flow
Env Temp temperature
Flow Volume flow_totalizer
Phosgene(COCl2) cocl2
Phosphates Concentration phosphates
HCN hcn
Flow_inlet_totalizer flow_inlet_totalizer
Inlet FLow2 inlet flow2
PRIMARY TEMPERATURE primary_temperature
Sec. Temp secondary_temperature
Mercury mercury
Flow Inlet flow_inlet
5.2 Units
© 2015 LogicLadder
25
RTDMS REST API version 1.0
mm mm
pH ph
Torr torr
LPM lpm
Hazen hu
Kg/Hr kg/hr
m³/day m3/day
l/hr l/hr
ton/hr ton/hr
µg/m³ ug/m3
1 Success
© 2015 LogicLadder
26
RTDMS REST API version 1.0
5.4 Throttling
● To prevent the abuse of the system, number of requests per min (cumulative across all
APIs) are restricted as per the following rule -
Note:
If no of request exceeds the given range, below response you will get.
Status Description
© 2015 LogicLadder
27