SmartSense API: Report API
SmartSense provides a set of endpoints for generating report information.
Report Specific Types
The SmartSense Report API defines the following types:
Numbers
TaskSelectionType
TaskSelectionType describes the type of task selection. This type has four values:
0: None
1: Fixed
2: Randomized
3: Dynamic
The Fixed type means that all tasks in the checklist must be completed by the designated type. The Randomized type is a Fixed-type checklist with the items in a random order. The _Dynamic type means that a specified number of tasks must be completed. E.g., if there are 12 listed tasks, the user may only have to complete 6 of the 12.
TaskType
TaskType describes the task. This type has 10 values:
0: Manual Temperature
1: Sensor Temperature
2: Probe Temperature
3: Manual Number
4: Manual Text
5: Select Single
6: Select Many
7: Picture
8: Checkbox
9: Asset Sensor Reading
Enums
Fields that are enums are returned as strings in JSON. The string value will be limited to the possible enum values as defined for the type. All enum types have the possibility of being null.
AnswerStatus
Specifies the type of reading. Values:
"Incomplete"
"Complete"
"CompletedNotApplicable"
"RequiresFollowUp"
"CompletedWithCorrectiveAction"
The Incomplete status means that the user has not yet responded to the task. The Complete status means that the user provided a response to a task and that the task has a value associated, e.g., the user used a temperature probe to take a temperature or inputted the temperature manually. The CompletedNotApplicable status means that the user responded to a task, but it was not necessary to provide a value. The RequiresFollowUp status means that the user has missed follow-up tasks that still need to be completed. The CompletedWithCorrectiveAction status means that the task was completed and performed at least one associated corrective action.
TaskClass
Specifies the class of a task. Values:
"FoodStep"
"Task"
The FoodStep class indicates that the task relates to a specific food item, e.g., checking the temperature of cooked chicken. The Task class indicates that the task does not relate to a specific food item, e.g., checking the SmartSense web application for any new incidents.
Above Store Report
The /abovestore endpoint can be used to retrieve checklist/task completion information for a given group as well as summary information for descendent groups.
Get Above Store Report
Get the Above Store report for the given group as well as summary information for descendant groups.
GET /report/v1/abovestore group/{groupId}
Parameters are shown below:
Name | Location | Type | Required | Description |
groupId |
path | integer (64 bit) | yes | ID of the group to retrieve. Any group type can be used, but usage is typically limited to Location and Department groups. |
reportDate | query string | date | no | Pull report for a given date. Default is the current date. Value cannot be in the future. |
Output Fields:
Name | Type | Description |
groupID |
integer (64 bit) | Unique group identifier. |
day | date | The day of the report. |
overallCompletionPercentage | float (64 bit) | Returns totalCompletedTasks divided by totalAvailableTasks as a number between 0 and 1. Will be null when totalAvailableTasks is zero. |
totalAvailableTasks | integer (32 bit) | Total number of available tasks. |
totalMissedFollowUpTasks | integer (32 bit) | Total number of missed or follow-up tasks. |
totalCompletedTasks | integer (32 bit) | Total number of completed tasks. |
totalCorrectiveActions | integer (32 bit) | Total number of corrective actions. |
totalIncompleteOrMissedTask | integer (32 bit) | Total number of incomplete or missed tasks. |
results | array | Array of Results Data for each descendant group. May be empty. |
The Results Data structure is as follows:
Name | Type | Description |
groupID |
integer (64 bit) | Unique group identifier. |
completionPercentage | float (64 bit) | Returns completedTasks divided by availableTasks as a number between 0 and 1. Will be null when availableTasks is zero. |
availableTasks | integer (32 bit) | The number of available tasks. |
missedFollowUpTasks | integer (32 bit) | The number of missed or follow-up tasks. |
completedTasks | integer (32 bit) | The number of completed tasks. |
correctiveActions | integer (32 bit) | The number of corrective actions. |
incompleteOrMissedTask | integer (32 bit) | The number of incomplete or missed tasks. |
Responses shown below:
Code | Description |
200 | Success |
400 | Bad Request |
401 | Unauthorized |
Scheduled Checklist Report
The /ScheduledChecklist endpoint can be used to retrieve a daily scheduled checklist report including checklist details.
Get Scheduled Checklist Report
Get the Scheduled Checklist report for the given group.
GET /report/v1/scheduledchecklist/group/{groupId}
Parameters are shown below:
Name | Location | Type | Required | Description |
groupId |
path | integer (64 bit) | yes | ID of the group to retrieve. Any group type can be used, but usage is typically limited to Location and Department groups. |
reportDate | query string | date | no | Pull report for a given date. Default is the current date. Value cannot be in the future. |
Output Fields:
Name | Type | Description |
groupID |
integer (64 bit) | Unique group identifier. |
reportDate | date | The day of the report. |
summary | object | Single object of Summary Data. |
details | array | Array of Details Data. |
The Summary Data structure is as follows:
Name | Type | Description |
completionPercentage |
float (64 bit) | Returns completedTasks divided by availableTasks as a number between 0 and 1. Will be null when availableTasks is zero. |
availableTasks | integer (32 bit) | The number of available tasks. |
missedFollowUpTasks | integer (32 bit) | The number of missed or follow-up tasks. |
completedTasks | integer (32 bit) | The number of completed tasks. |
correctiveActions | integer (32 bit) | The number of corrective actions. |
incompleteOrMissedTask | integer (32 bit) | The number of incomplete or missed tasks. |
The Details Data structure is as follows:
Name | Type | Description |
checklistName |
string | The name of the checklist. |
timeZone | time zone | The time zone assigned to the group as a human readable string. |
startDate | date | The start date of the checklist. |
endDate | date | The end date of the checklist. |
gracePeriodEndDate | date | The end date of the grace period. If there is no grace period, it will be the same as endDate. |
TaskSelectionType | TaskSelectionType | Describes the type of task selection. |
dynamicallyRequiredItemCount | integer (32 bit) | The number of required items for checklists with a "Dynamic" taskSelectionType. Will be zero otherwise. |
checklistAnswers | array | Array of Checklist Answers Data. |
The Checklist Answers Data structure is as follows:
Name | Type | Description |
taskID | string | The ID of the task. |
taskName | string | The name of the task. |
taskType | TaskType | Describes the type of task. |
incidentID | integer (64 bit) |
The ID of the incident, if triggered by an incident otherwise will be null. |
low | float (64 bit) |
The lower range limit of acceptable values, if relevant. |
high | float (64 bit) |
The upper range limit of acceptable values, if relevant. |
unit | string |
The unit type for low and high values, if relevant. |
priority | integer (32 bit) |
A number indicating priority. |
status | AnswerStatus |
The status of the checklist answer. |
answerDate | date |
The date the checklist item was answered. |
taskClass | TaskClass |
The class of the task. |
result | string |
The result of the checklist item. |
manager | string |
The login username of the manager, if applicable. |
comments | string |
Any related comments. |
correctiveActions | string array |
A list of corrective actions, if any. |
followUps | array |
Array of Checklist Answers Data containing follow-up actions, if any. |
Responses shown below:
Code | Description |
200 | Success |
400 | Bad Request |
401 | Unauthorized |