Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 twinDigital Twin, visit the course page and find out, how to set up a shift:

The main information about how to use twinzo´s 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.pngImage Removedimage-20240820-065359.pngImage Added

/shifts

  • use for getting a list of shifts from branche

/shifts/{id}

  • get specific shift’s shift 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

Code Block
languagejson
[
  {
    "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)

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

 

image-20240820-090527.png

 

Data Properties

Data payload JSON object has five properties:

Id

Shift ID

Title

Shift´s Shift's title

BranchId

Branch ID where the shift will be used

StartTime

Start time of the shift [in milisecondsmilliseconds]

StopTime

End time of the shift [in milisecondsmilliseconds]

Note

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