Document toolboxDocument toolbox

Shifts API

This guide provides information about how to work with shifts. The shifts are important for your digital twin since work time is often divided into shifts.

Configuration

To connect shifts with twinzo digital twin, visit the course page and find out, how to set up a shift:

The main information about how to use twinzo´s REST API and how to authorize your access:

Swagger Shifts Section

The Swagger Shifts section provides a detailed description of the API for the shifts. We can use /shifts or /shifts/{id} for specific shifts to get information about shifts.

image-20240820-065359.png

/shifts

  • use for getting a list of shifts from branche

/shifts/{id}

  • get specific shift’s information according to the id

Example

There are examples for both /shifts and /shifts/{id} calls below. First is the response you get and then the image with the parameters you have to call for the correct answer. The whole request URL: https://api.twinzo.eu/v3.0/shifts / https://api.twinzo.eu/v3.0/shifts/21

/shifts

[ { "Id": 4, "Title": "Morning Shift", "BranchId": 7, "StartTime": 21600000, "StopTime": 50400000 }, { "Id": 5, "Title": "Afternoon Shift", "BranchId": 7, "StartTime": 50400000, "StopTime": 79200000 }, { "Id": 21, "Title": "Evening Shift", "BranchId": 7, "StartTime": 64800000, "StopTime": 108000000 } ]

 

image-20240820-090342.png

/shifts/{id} (/shifts/21)

{ "Id": 21, "Title": "Evening Shift", "BranchId": 7, "StartTime": 64800000, "StopTime": 108000000 }

 

 

Data Properties

Data payload JSON object has five properties:

Id

Shift ID

Title

Shift´s title

BranchId

Branch ID where the shift will be used

StartTime

Start time of the shift [in miliseconds]

StopTime

End time of the shift [in miliseconds]

StartTime / StopTime explanation:

60000 - 00:01 (12:01 AM)
21600000 - 06:00 (6:00 AM)
79200000 - 22:00 (10:00 PM)
108000000 - 06:00 (6:00 AM) - NEXT DAY! - Used for night shifts that last from the evening until the next morning

If you encounter any issues or need assistance with using this product, please do not hesitate to reach out for support. Our team is here to help you resolve any problems and answer any questions you may have.
To create a support ticket, visit our support portal at https://partner.twinzo.eu/helpdesk/customer-care-1