API 2.0: For any of the endpoints that require a start and end date / time, you can now pass a storage group date / time with "StartDatetimeSG" and "EndDatetimeSG" instead of "StartDatetimeUTC" and "EndDatetimeUTC". Include "StorageGroupID" to tell the system which storage group date / time you are sending.
{
"RowStart": 0,
"RowCount": 3,
"ReturnType": "json",
"LastUpdatedUTC": "2018-05-25T15:50:00",
"LastUpdatedSG": null,
"TagSourceCodeName": "UNITECH",
"TagDataValue": "",
"EndpointVersion": null (null = latest 2.2)
}
{
"status": {
"HTTPStatusCode": 200,
"HTTPStatus": "OK",
"RowStart": 0,
"RowsReturned": 3,
"LastIdReturned": 259761,
"RequestBegin": "2019-05-07T20:21:50.7536514Z",
"StopWatch": {
"IsRunning": true,
"Elapsed": "00:00:00.0831032",
"ElapsedMilliseconds": 83,
"ElapsedTicks": 843331
},
"APIversion": "5.13.0.0",
"EndpointVersionReturned": 2.2,
"ExternalRequest": {
"RowStart": 0,
"RowCount": 3,
"LastUpdatedUTC": "2018-05-25T15:5",
"TagSourceCodeName": "HACHWIMS",
"ReturnType": 1,
"EndpointVersion": null,
"EndpointVersionReturned": 2.2
}
},
"data": [
{
"responseID": 259759,
"responseType": "Number",
"responseValue": "73.00",
"responseDate": "2018-05-25T15:55:49",
"stepComments": "Step Note spot",
"stepWasVisible": null,
"formName": "U1FEXT",
"assetTag": "U1FEXTINGUISHER08",
"assetDescription": null,
"assetStatus": "Nominal",
"roundName": "Safety Round",
"roundVariantName": "Shift1",
"elementLabel": "U1FEXTINGUISHER08 / U1FEXT",
"taskName": "",
"taskEventStatus": "",
"tagSourceCode": "HACHWIMS",
"tagSourceDisplayName": "Hach WIMS",
"tagDataValue": "Hach WIMS Asset01",
"tagDataDescription": "Hach WIMS Asset01",
"operatorFullName": "Max Admin",
"completedFormID": 29182,
"completedRoundID": 7816,
"completedRoundElementID": 48954,
"taskEventID": null,
"timeZone": "America/Chicago",
"lastUpdated": "2018-05-25T15:55:49",
"responseLabel": "number_1",
"roundStorageGroupID": 425,
"roundStorageGroupName:"TXRG1",
"roundStartDate": "2018-05-23T11:05:48.84",
"roundEndDate": "2018-05-23T13:04:48.84"
},
{
"responseID": 259760,
"responseType": "List",
"responseValue": "Class B",
"responseDate": "2018-05-25T15:55:21",
"stepComments": "Step Note spot",
"stepWasVisible": null,
"formName": "U1FEXT",
"assetTag": "U1FEXTINGUISHER08",
"assetDescription": null,
"assetStatus": "Nominal",
"roundName": "Safety Round",
"roundVariantName": "Shift1",
"elementLabel": "U1FEXTINGUISHER08 / U1FEXT",
"taskName": "",
"taskEventStatus": "",
"tagSourceCode": "HACHWIMS",
"tagSourceDisplayName": "Hach WIMS",
"tagDataValue": "Hach WIMS Asset02",
"tagDataDescription": "Hach WIMS Asset02",
"operatorFullName": "Max Admin",
"completedFormID": 29182,
"completedRoundID": 7816,
"completedRoundElementID": 48954,
"taskEventID": null,
"timeZone": "America/Chicago",
"lastUpdated": "2018-05-25T15:55:21",
"responseLabel": "list_1",
"roundStorageGroupID": 425,
"roundStorageGroupName:"TXRG1",
"roundStartDate": "2018-05-23T11:05:48.84",
"roundEndDate": "2018-05-23T13:04:48.84"
},
{
"responseID": 259761,
"responseType": "Yes/No",
"responseValue": "No",
"responseDate": "2018-05-25T15:55:30",
"stepComments": "Step Note spot",
"stepWasVisible": null,
"formName": "U1FEXT",
"assetTag": "U1FEXTINGUISHER08",
"assetDescription": null,
"assetStatus": "Nominal",
"roundName": "Safety Round",
"roundVariantName": "Shift1",
"elementLabel": "U1FEXTINGUISHER08 / U1FEXT",
"taskName": "",
"taskEventStatus": "",
"tagSourceCode": "HACHWIMS",
"tagSourceDisplayName": "Hach WIMS",
"tagDataValue": "Hach WIMS Asset03",
"tagDataDescription": "Hach WIMS Asset03",
"operatorFullName": "Max Admin",
"completedFormID": 29182,
"completedRoundID": 7816,
"completedRoundElementID": 48954,
"taskEventID": null,
"timeZone": "America/Chicago",
"lastUpdated": "2018-05-25T15:55:30",
"responseLabel": "YesNo_1",
"roundStorageGroupID": 425,
"roundStorageGroupName:"TXRG1",
"roundStartDate": "2018-05-23T11:05:48.84",
"roundEndDate": "2018-05-23T13:04:48.84"
}
]
}
{"message": "Unauthorized API access"}
{"message": "Missing body in post."}
{"message": "RowStart cannot be less than 0."}
{"message": "RowCount cannot be less than 0."}
{"message": "You must pass a source code name."}
{"message": "StartDatetimeUTC cannot be null"}
OR
{"message": "EndDatetimeUTC cannot be null"}
OR
{"message": "LastUpdateUTC cannot be null"}
{"message": "ResponsesBetweenResponseDate Error: Invalid Version Requested [1.1]. at ...
{"message":"You must pass a source code name."}
curl -X POST \
http://localhost:9080/api/svc/Historian/HistorianAfterResponseLastUpdated \
-H 'Authorization: Basic R29QbGFudEV4dGVybmFsQWNjZXNzOjc3NjRFRDE3Q0QyODRGNzhBNDYy' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"RowStart": 0,
"RowCount": 4,
"ReturnType": "json",
"LastUpdatedUTC": "2018-05-25T15:5",
"TagSourceCodeName": "MAXIMO"
}'
var client = new RestClient("http://localhost:9080/api/svc/Historian/HistorianAfterResponseLastUpdated");
var request = new RestRequest(Method.POST);
request.AddHeader("Cache-Control", "no-cache");
request.AddHeader("Authorization", "Basic R29QbGFudEV4dGVybmFsQWNjZXNzOjc3NjRFRDE3Q0QyODRGNzhBNDYy");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\n\t\"RowStart\": 0,\n\t\"RowCount\": 4,\n\t\"ReturnType\": \"json\",\n\t\"LastUpdatedUTC\":\"2018-05-25T15:50:00\",\n\t\"TagSourceCodeName\": \"MAXIMO\"\n \"EndpointVersion\": 1.1\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var settings = {
"async": true,
"crossDomain": true,
"url": "http://localhost:9080/api/svc/Historian/HistorianAfterResponseLastUpdated",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic SEFDSFdJTVM6REVWTC5URVNUREVWRUxPUE1FTlRLRVk=",
"cache-control": "no-cache"
},
"processData": false,
"data": "{\n \"RowStart\": 0,\n \"RowCount\": 3,\n \"ReturnType\": \"json\",\n\ "LastUpdatedUTC\":\"2018-05-25T15:50:00\",\n \"TagSourceCodeName\": \"HACHWIMS\"\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});