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": 2,
"ReturnType": "json",
"StartDatetimeUTC":"2017-11-15T01:57:53",
"EndDatetimeUTC": "2017-11-16T19:57:53",
"TagSourceCodeName": "MAXIMO",
"TagDataValue": "",
"EndpointVersion": null (null = latest 1.x)
}
{
"status": {
"HTTPStatusCode": 200,
"HTTPStatus": "OK",
"RowStart": 0,
"RowsReturned": 2,
"LastIdReturned": 245125,
"RequestBegin": "2018-06-13T20:50:46.1348477Z",
"StopWatch": {
"IsRunning": true,
"Elapsed": "00:00:00.1382361",
"ElapsedMilliseconds": 139,
"ElapsedTicks": 353288
},
"APIversion": "3.25.0.0",
"EndpointVersionReturned": 1.0
"ExternalRequest": {
"RowStart": 0,
"RowCount": 2,
"StartDatetimeUTC": "2017-11-15T01:57:53",
"EndDatetimeUTC": "2017-11-16T19:57:53",
"ResponseID": null,
"TagSourceCodeName": "MAXIMO",
"ReturnType": 1
}
},
"data": [
{
"responseID": 245078,
"responseType": "Number",
"responseValue": "55.00",
"responseDate": "2017-11-16T17:09:52",
"stepComments": "",
"stepWasVisible": null,
"formName": "U1COMP01",
"assetTag": "U1COMP01",
"assetDescription": null,
"assetStatus": "Nominal",
"roundName": "Round Unit1-1",
"roundVariantName": "Day",
"elementLabel": "U1COMP01 / U1COMP01",
"taskName": "",
"taskEventStatus": "",
"tagSourceCode": "MAXIMO",
"tagSourceDisplayName": "Maximo",
"tagDataValue": "123",
"tagDataDescription": "MAXIMOQA"
},
{
"responseID": 245125,
"responseType": "Number",
"responseValue": "55.00",
"responseDate": "2017-11-16T17:30:17",
"stepComments": "",
"stepWasVisible": null,
"formName": "U1COMP01",
"assetTag": "U1COMP01",
"assetDescription": null,
"assetStatus": "Nominal",
"roundName": "Round Unit1-1",
"roundVariantName": "Day",
"elementLabel": "U1COMP01 / U1COMP01",
"taskName": "",
"taskEventStatus": "",
"tagSourceCode": "MAXIMO",
"tagSourceDisplayName": "Maximo",
"tagDataValue": "123",
"tagDataDescription": "MAXIMOQA"
}
]
}
{"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/HistorianBetweenDateTimes \
-H 'Authorization: Basic TXlUYWdTb3VyY2UxOjhFRTMxNTFCMUQwODQzOUZCMEQyQjhFQ0MzMzNBNkZF' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"RowStart": 0,
"RowCount": 2,
"ReturnType": "json",
"StartDatetimeUTC":"2017-11-15T01:57:53",
"EndDatetimeUTC": "2017-11-16T19:57:53",
"TagSourceCodeName": "MAXIMO"
}'
var client = new RestClient("http://localhost:9080/api/svc/Historian/HistorianBetweenDateTimes");
var request = new RestRequest(Method.POST);
request.AddHeader("Cache-Control", "no-cache");
request.AddHeader("Authorization", "Basic TXlUYWdTb3VyY2UxOjhFRTMxNTFCMUQwODQzOUZCMEQyQjhFQ0MzMzNBNkZF");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\n\t\"RowStart\": 0,\n\t\"RowCount\": 2,\n\t\"ReturnType\": \"json\",\n\t\"StartDatetimeUTC\":\"2017-11-15T01:57:53\",\n\t\"EndDatetimeUTC\": \"2017-11-16T19:57:53\",\n\t\"TagSourceCodeName\": \"MAXIMO\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var settings = {
"async": true,
"crossDomain": true,
"url": "http://localhost:9080/api/svc/Historian/HistorianBetweenDateTimes",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic TXlUYWdTb3VyY2UxOjhFRTMxNTFCMUQwODQzOUZCMEQyQjhFQ0MzMzNBNkZF",
"Cache-Control": "no-cache"
},
"processData": false,
"data": "{\n\t\"RowStart\": 0,\n\t\"RowCount\": 2,\n\t\"ReturnType\": \"json\",\n\t\"StartDatetimeUTC\":\"2017-11-15T01:57:53\",\n\t\"EndDatetimeUTC\": \"2017-11-16T19:57:53\",\n\t\"TagSourceCodeName\": \"MAXIMO\"\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});