Readings for one sensor
POST
/GetDataBySensor
const url = 'https://api.eianalytic.com/ApiWeb.svc/GetDataBySensor';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"phantomCode":1,"StartDate":"2019-10-10","EndDate":"2019-10-10","Token":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.eianalytic.com/ApiWeb.svc/GetDataBySensor \ --header 'Content-Type: application/json' \ --data '{ "phantomCode": 1, "StartDate": "2019-10-10", "EndDate": "2019-10-10", "Token": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
phantomCode
required
Sensor serial number.
integer
StartDate
yyyy-MM-dd for a whole day, or yyyy-MM-dd HH:mm:ss (24-hour clock)
for an instant. A date-only value returns everything in that range.
string
EndDate
yyyy-MM-dd for a whole day, or yyyy-MM-dd HH:mm:ss (24-hour clock)
for an instant. A date-only value returns everything in that range.
string
Token
required
The database token returned by Login. Sent in the request body, not
in a header.
string
Responses
Section titled “Responses”Readings grouped by channel.
Media typeapplication/json
Array<object>
object
Key
The Key half of every response envelope.
object
StatusNumber
required
0 means OK. See the Conventions page for the full table.
integer
Description
required
string
Configs
Present on some responses; empty in the documented examples.
Array<object>
object
Value
Array<object>
Readings for one channel of one sensor.
object
Channel
integer
PhantomCode
integer
PhantomName
string
MachineName
string
PointName
string
values
Nested one level deeper than a flat list, per the source examples.
Array<Array<object>>
Example
[ { "Key": { "StatusNumber": 0, "Description": "OK" }, "Value": [ { "values": [ [ { "Date": "2022/02/28 20:07:10", "DescUnit": "Amp P1 AmpMin" } ] ] } ] }]