1. Home
  2. Docs
  3. Schedule Enforcement
  4. Check for Scheduled Shifts
  5. POST Structure for /shifts/scheduled

POST Structure for /shifts/scheduled

Checking for a user’s scheduled shifts in 7shifts is handled through a POST request to the 7shifts /shifts/scheduled endpoint.

An example POST request to the /shifts/scheduled endpoint to create a sales receipt looks as follows:

Request URL

POST https://api.7shifts.com/v1/shifts/scheduled

Request body

{
    "punch_id": 123456,
    "grace_period": 30
}

Here’s an explanation of each of the fields required in the request body:

FieldTypeExplanation
punch_idNumericThe 7shifts ID of the user clocking in (employee_id field from the users response object)
grace_periodNumericAmount of time in minutes that the employee should be allowed to clock in before the shift is scheduled to start, i.e., number of minutes between now and end of the timeframe for finding shifts that are scheduled to start or have already started within the timeframe

Response

{
    "status": "success",
    "data": {
        "scheduled": true,
        "shift": {
            "id": 123456789
        },
        "role": {
            "id": 98765,
            "name": "Server"
        }
    },
    "message": ""
}

Here’s an explanation of each of the fields in the response:

FieldTypeExplanation
scheduledBooleanThe field you really need to look at — whether the user is scheduled in 7shifts or not
shift.idNumericID of the scheduled shift
role.idNumericID of the role that the shift is scheduled for
role.nameStringName of the role that the shift is scheduled for