POST sites/{id}/data
Create new data points in the specifed site by passing a collection of channels and data points.
Request Information
URI Parameters
Name | Description | Type | Additional information |
---|---|---|---|
id |
Site id of the site where data points will be created. |
integer |
Required |
Body Parameters
An array of channels, each containing an array of data points.
Collection of ChannelDataPointOffsetVMName | Description | Type | Additional information |
---|---|---|---|
ChannelId |
The id of the channel. |
integer |
None. |
ChannelName |
The name of the channel. |
string |
None. |
DataPoints |
A collection of data points that belongs to this channel, where each data point is a recorded value at a moment in time. |
Collection of DataPointOffsetVM |
None. |
Request Formats
application/json, text/json
Sample:
[ { "ChannelId": 1, "ChannelName": "sample string 1", "DataPoints": [ { "DataValue": "sample string 1", "DataTime": "2025-01-17T19:57:23.1936652-08:00" }, { "DataValue": "sample string 1", "DataTime": "2025-01-17T19:57:23.1936652-08:00" } ] }, { "ChannelId": 1, "ChannelName": "sample string 1", "DataPoints": [ { "DataValue": "sample string 1", "DataTime": "2025-01-17T19:57:23.1936652-08:00" }, { "DataValue": "sample string 1", "DataTime": "2025-01-17T19:57:23.1936652-08:00" } ] } ]
application/xml, text/xml
Sample:
<ArrayOfChannelDataPointOffsetVM xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/FW.WebApi2.ViewModels"> <ChannelDataPointOffsetVM> <ChannelId>1</ChannelId> <ChannelName>sample string 1</ChannelName> <DataPoints> <DataPointOffsetVM> <DataTime xmlns:d5p1="http://schemas.datacontract.org/2004/07/System"> <d5p1:DateTime>2025-01-18T03:57:23.1936652Z</d5p1:DateTime> <d5p1:OffsetMinutes>-480</d5p1:OffsetMinutes> </DataTime> <DataValue>sample string 1</DataValue> </DataPointOffsetVM> <DataPointOffsetVM> <DataTime xmlns:d5p1="http://schemas.datacontract.org/2004/07/System"> <d5p1:DateTime>2025-01-18T03:57:23.1936652Z</d5p1:DateTime> <d5p1:OffsetMinutes>-480</d5p1:OffsetMinutes> </DataTime> <DataValue>sample string 1</DataValue> </DataPointOffsetVM> </DataPoints> </ChannelDataPointOffsetVM> <ChannelDataPointOffsetVM> <ChannelId>1</ChannelId> <ChannelName>sample string 1</ChannelName> <DataPoints> <DataPointOffsetVM> <DataTime xmlns:d5p1="http://schemas.datacontract.org/2004/07/System"> <d5p1:DateTime>2025-01-18T03:57:23.1936652Z</d5p1:DateTime> <d5p1:OffsetMinutes>-480</d5p1:OffsetMinutes> </DataTime> <DataValue>sample string 1</DataValue> </DataPointOffsetVM> <DataPointOffsetVM> <DataTime xmlns:d5p1="http://schemas.datacontract.org/2004/07/System"> <d5p1:DateTime>2025-01-18T03:57:23.1936652Z</d5p1:DateTime> <d5p1:OffsetMinutes>-480</d5p1:OffsetMinutes> </DataTime> <DataValue>sample string 1</DataValue> </DataPointOffsetVM> </DataPoints> </ChannelDataPointOffsetVM> </ArrayOfChannelDataPointOffsetVM>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
ResponseVMName | Description | Type | Additional information |
---|---|---|---|
ResultCode | FwApiResultCode |
None. |
|
ResultMessage | string |
None. |
Response Formats
application/json, text/json
Sample:
{ "ResultCode": 0, "ResultMessage": "sample string 1" }
application/xml, text/xml
Sample:
<ResponseVM xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/FW.WebApi2.ViewModels"> <ResultCode>Ok</ResultCode> <ResultMessage>sample string 1</ResultMessage> </ResponseVM>