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": 5,
"ReturnType": "json",
"StartDatetimeUTC":"2018-05-16T18:52:03",
"EndDatetimeUTC": "2018-05-16T19:27:02",
"EndpointVersion": null (null = latest 1.x)
}
{
"status": {
"HTTPStatusCode": 200,
"HTTPStatus": "OK",
"RowStart": 0,
"RowsReturned": 2,
"LastIdReturned": 270379,
"RequestBegin": "2019-05-07T20:11:21.1522362Z",
"StopWatch": {
"IsRunning": true,
"Elapsed": "00:00:00.0081014",
"ElapsedMilliseconds": 8,
"ElapsedTicks": 87891
},
"APIversion": "5.13.0.0",
"EndpointVersionReturned": 1,
"ExternalRequest": {
"RowStart": 0,
"RowCount": 2,
"StartDatetimeUTC": "2018-07-01T18:52:03",
"EndDatetimeUTC": "2018-07-16T19:27:02",
"ResponseID": null,
"TagSourceCodeName": "GoPlantAPIAccess",
"ReturnType": 1,
"EndpointVersion": null,
"EndpointVersionReturned": 1
}
},
"data": [
{
"responseID": 270378,
"responseLabel": "Step - 1 - short text",
"responseValue": "6",
"responseDate": "2018-07-02T15:58:25",
"responseColorcode": " ",
"responseType": "Short text",
"operatorID": 299,
"operatorFirstName": "Kevin",
"operatorLastName": "Cornelison",
"stepID": 32617,
"stepRequired": true,
"stepPage": 1,
"stepLabel": "Step - 1 - short text",
"stepComments": "Step 1 note",
"stepWasVisible": true,
"formName": "form - All Steps",
"formSGName": "KevinSubGroup Değeri",
"formStartDate": "2018-07-02T15:58:04",
"formEndDate": "2018-07-02T15:58:26",
"elementLabel": "form - All Steps",
"assetTag": null,
"assetDescription": null,
"assetStatus": null,
"roundName": "Round All Steps",
"roundDesc": "",
"roundStartDate": "2018-07-02T15:58:02",
"roundEndDate": "2018-07-02T15:58:46",
"roundVariantName": "AllSteps",
"taskName": "",
"taskDescription": "",
"taskEventStatus": "Void",
"taskAssignmentStartline": null,
"taskAssignmentDeadline": null,
"taskAssignmentExpiration": null,
"taskAssignmentCompletedDate": null,
"taskAssignmentDeleted": false,
"taskAssignmentStatus": "",
"timeZone": "America/Chicago",
"completedFormID": 30177,
"completedRoundID": 8445,
"completedRoundElementID": 50521,
"taskEventID": null,
"lastUpdated": "2018-07-02T15:58:25",
"roundStorageGroupID": 425,
"roundStorageGroupName:"TXRG1"
},
{
"responseID": 270379,
"responseLabel": "Step - 2 multi line",
"responseValue": "66",
"responseDate": "2018-07-02T15:58:12",
"responseColorcode": " ",
"responseType": "Multi-line text",
"operatorID": 299,
"operatorFirstName": "Kevin",
"operatorLastName": "Cornelison",
"stepID": 32618,
"stepRequired": false,
"stepPage": 1,
"stepLabel": "Step - 2 multi line",
"stepComments": "step 2 note",
"stepWasVisible": true,
"formName": "form - All Steps",
"formSGName": "KevinSubGroup Değeri",
"formStartDate": "2018-07-02T15:58:04",
"formEndDate": "2018-07-02T15:58:26",
"elementLabel": "form - All Steps",
"assetTag": null,
"assetDescription": null,
"assetStatus": null,
"roundName": "Round All Steps",
"roundDesc": "",
"roundStartDate": "2018-07-02T15:58:02",
"roundEndDate": "2018-07-02T15:58:46",
"roundVariantName": "AllSteps",
"taskName": "",
"taskDescription": "",
"taskEventStatus": "Void",
"taskAssignmentStartline": null,
"taskAssignmentDeadline": null,
"taskAssignmentExpiration": null,
"taskAssignmentCompletedDate": null,
"taskAssignmentDeleted": false,
"taskAssignmentStatus": "",
"timeZone": "America/Chicago",
"completedFormID": 30177,
"completedRoundID": 8445,
"completedRoundElementID": 50521,
"taskEventID": null,
"lastUpdated": "2018-07-02T15:58:12",
"roundStorageGroupID": 425,
"roundStorageGroupName:"TXRG1"
}
]
}
{"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 ...
curl -X POST \
http://localhost:9080/api/svc/Historian/ResponsesBetweenDateTimes \
-H 'Authorization: Basic R29QbGFudEFQSUFjY2VzczpERVZMLlRFU1RERVZFTE9QTUVOVEtFWQ==' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"RowStart": 0,
"RowCount": 2,
"ReturnType": "json",
"StartDatetimeUTC":"2018-07-01T18:52:03",
"EndDatetimeUTC": "2018-07-16T19:27:02"
}'
var client = new RestClient("http://localhost:9080/api/svc/Historian/ResponsesBetweenDateTimes");
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\":\"2018-05-16T18:52:03\",\n\t\"EndDatetimeUTC\": \"2018-05-16T19:27:02\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var settings = {
"async": true,
"crossDomain": true,
"url": "http://localhost:9080/api/svc/Historian/ResponsesBetweenDateTimes",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic R29QbGFudEFQSUFjY2VzczpERVZMLlRFU1RERVZFTE9QTUVOVEtFWQ==",
"cache-control": "no-cache"
},
"processData": false,
"data": "{\n\t\"RowStart\": 0,\n\t\"RowCount\": 2,\n\t\"ReturnType\": \"json\",\n\t\"StartDatetimeUTC\":\"2018-07-01T18:52:03\",\n\t\"EndDatetimeUTC\": \"2018-07-16T19:27:02\",\n\t\"TagSourceCodeName\": \"GoPlantAPIAccess\"\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});