Shift Notes
- GET /api/shiftNotes/list
Get the objects needing shift notes entry for the current shift on a machine.
- Query Parameters:
machine_id (int) – the ID of the machine to get objects relating to (required)
shift_id (int) – the ID of the shift to get data for (required)
date (string) – get objects created on this date (format: YYYY-MM-DD) in local time (required)
- Status Codes:
400 Bad Request – if the date format is invalid
404 Not Found – if the machine or shift does not exist
- POST /api/shiftNotes/submit
Set the notes fields of many objects at once.
- Query Parameters:
machine_id (int) – the ID of the machine to send a notification to (required)
shift_id (int) – the ID of the shift to submit notes for (required)
date (string) – the date (format: YYYY-MM-DD) in local time to submit notes for (required)
- Status Codes:
204 No Content – on success
400 Bad Request – if the date format or field data is invalid
404 Not Found – if the machine or shift does not exist
- GET /api/shiftNotes/submissions
Get shift notes submission history.
- Query Parameters:
machine (int) – if set to the ID of a machine, only submissions for that machine will be returned.
shift (int) – if set to the ID of a shift, only submissions for that machine will be returned.
user (int) – if set to the ID of a user, only submissions for that machine will be returned.
start (float) – only submissions on or after this UNIX timestamp will be returned.
end (float) – only submissions on or before this UNIX timestamp will be returned.
- Returns:
an object mapping submission ID to ShiftNotesSubmission object
- GET /api/shiftNotes/fields
Get all custom shift notes fields.
- Returns:
an object mapping shift notes field ID to ShiftNotesField object
- PUT /api/shiftNotes/fields
Create a new custom shift notes field.
- Reqjson:
a (partial) ShiftNotesField object (at least a
name
is required)- Status Codes:
201 Created – on success
400 Bad Request – if the new ShiftNotesField is invalid
- Returns:
the new ShiftNotesField object
- PATCH /api/shiftNotes/fields/(int: field_id)
Edit an existing custom shift notes field.
- Parameters:
field_id – the ID of the field to edit
- Status Codes:
404 Not Found – if the field does not exist
- Reqjson:
a (partial) ShiftNotesField object
- Returns:
the modified ShiftNotesField object
- DELETE /api/shiftNotes/fields/(int: field_id)
Delete an existing custom shift notes field.
- Parameters:
field_id – the ID of the field to delete
- Status Codes:
404 Not Found – if the field does not exist
204 No Content – on success
- GET /api/shiftNotes/fields/(int: field_id)/values
Get entered values of a custom shift notes field.
- Query Parameters:
machine_id (int) – get only values from the specified machine ID
limit (int) – maximum number of values to return
offset (int) – skip this many most recent values
- Returns:
a list of ShiftNotesValue objects sorted by shift date (not submission date) with the newest first