POST ./staff_att/sign
Handles the POST request for creating a new sign entry.
Payload
Name | Value Type | Validation | Details |
---|---|---|---|
cmcID | integer | Required | Must be a natural number greater than zero |
description | string | Optional | Will be stripped of tags and cleaned for XSS |
isVisibleStudents | integer | Optional | Must be either 0 or 1 |
startDateTime | string (date) | Required | Must be a valid date in 'Y-m-d H:i:s' format |
endDateTime | string (date) | Required | Must be a valid date in 'Y-m-d H:i:s' format and greater than startDateTime |
Example
{"cmcID": 123,"description": "Staff meeting","isVisibleStudents": 1,"startDateTime": "2023-10-01 09:00:00","endDateTime": "2023-10-01 10:00:00"}
Validation Custom Errors
Error Code: 101
Error Message: The {field} is not a valid date.
Description: This error occurs when the provided date does not match the expected format Y-m-d H:i:s.
Location: Sign::_check_date method.
Example:
{"errorCode": "101","errorMessage": "The startDateTime is not a valid date."}
Error Code: 102
Error Message: The start date should be less than the end date.
Description: This error occurs when the start date is not less than the end date.
Location: Sign::_compare_dates method.
Example:
{"errorCode": "102","errorMessage": "The start date should be less than the end date."}
Response
{"id": 1}