Create or merge time series data
PATCH {{baseUrl}}/timeseries/:entityId/:propertySetName
Create or merge time series data for one combination of an asset (entity) and an(a) aspect (property set). This api creates or merges the data when different devices Or 3rd party apps write to different variables but within one aspect (property set) and same timestamp. Only those properties will be replaced by the ones provided in the request.
Request body limitations: 1. It may take several minutes after response until the provided changes are fully merged. 2. The number of updates being processed simultaneously by the service is limited. 3. The number of requests being accepted for processing is limited per time frame. 4. The maximum size of acceptable request bodies is 600 KB. 5. The maximum time range for PATCH request can't be older than 24 hours from current time. For example, if customer want to patch some timeseries record ingested for current time T; it needs to be patched maximum within T+24 hours 6. The PATCH will not work on Future timestamp at the time of execution. 7. The merge functionality does not support to create or update the variable value having data type as BigString. 8. The maximum number of records supported in one request is 10. 9. In case of errors, none of the changes for the provided time stamps will be applied.
Example
Example 1: If we have asset (entity) which can send two sensor values say 'pressure' & 'temperature'. Then the asset (entity) can send two separate calls to IoT for same device timesamp as below:
Call-1: This is a put request
TS record for tenant1\asset1\aspect1
{
"_time" : "2020-01-01T23:00:00.000Z",
"pressure" : 42.56
}
Call-2: This is a patch request
TS record for tenant1\asset1\aspect1
{
"_time" : "2020-01-01T23:00:00.000Z",
"temperature" : 73.23
}
After above two TimeSeries ingest calls, if we make GET call for this tenant-asset-aspect combination and for the same device timestamp, then expected output should have merged results from both the calls. This means the output should look as below:
TS record for tenant1\asset1\aspect1
{
"_time" : "2020-01-01T23:00:00.000Z",
"pressure" : 42.56,
"temperature" : 73.23
}
Request Body
{"0"=>{"_time"=>"<dateTime>"}, "1"=>{"_time"=>"<dateTime>"}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |