The shift services can be used to get information on rotas and upcoming shifts.

a) My Overview

This service returns a list of the logged in employees’ upcoming shifts. Dates are expressed as milliseconds since EPOCH (1970-1-1 00:00:00). This is available for all roles.

Request (JSON)

GET /shifts/future/?securitytoken={sessionToken}
Content-Type: application/json

 

Response (JSON)

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[{"BreakCode":"Q",
"Comment":"",
"DepartmentName":"Ny Bistro",
"EmployeeName":null,
"EndTime":"\/Date(1318860000000+0200)\/",
"StartTime":"\/Date(1318831200000+0200)\/"},
...
{"BreakCode":"Q",
"Comment":"",
"DepartmentName":"Ny Bistro",
"EmployeeName":null,
"EndTime":"\/Date(1318946400000+0200)\/",
"StartTime":"\/Date(1318917600000+0200)\/"}]

 

Response (XML)

<ArrayOfShift xmlns="http://schemas.datacontract.org/2004/07/Tamigo.Services.Entities" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance">
<Shift>
<BreakCode>Q</BreakCode>
<Comment/>
<DepartmentName>Herning</DepartmentName>
<EmployeeName i:nil=\"true\"/>
<EndTime>2011-12-19T06:00:00</EndTime>
<IsAvailable>false</IsAvailable>
<IsExchange>false</IsExchange>
<ShiftId>2f5e8bcc-a419-4c2b-891a-54fa4592bd52</ShiftId>
<StartTime>2011-12-18T23:00:00</StartTime>
</Shift>
</ArrayOfShift>

b)   Approved Rota – Current Day

This service returns a list of the shifts in the approved rota for the day, including employees who are absent, as indicated by the activity on the day. This is available for all roles. If the department is equal to all, shifts from all rotas in all departments are returned.

Request (JSON)

GET /shifts/today/?securitytoken={sessionToken}(&departmentId={departmentId})
Content-Type: application/json

 

Response (JSON)

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[{"BreakCode":"Q","Comment":"",
"DepartmentName":"Ny Bistro","EmployeeName":"",
"EndTime":"\/Date(1316700000000+0200)\/",
"StartTime":"\/Date(1316671200000+0200)\/"},
...
{"BreakCode":"Q","Comment":"",
"DepartmentName":"Ny Bistro","EmployeeName":"",
"EndTime":"\/Date(1316700000000+0200)\/",
"StartTime":"\/Date(1316671200000+0200)\/"}]

Response (XML)

"<ArrayOfShift xmlns="http://schemas.datacontract.org/2004/07/Tamigo.Services.Entities" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Shift>
<BreakCode>Q</BreakCode>
<Comment/>
<DepartmentName>København</DepartmentName>
<EmployeeName/>
<EndTime>2011-12-13T16:00:00</EndTime>
<StartTime>2011-12-13T08:00:00</StartTime>
</Shift>
</ArrayOfShift>"

 

c) Approved Rota – Day Other Than Current Day

This service returns a list of shifts in the approved rota for the day, including employees that are absent, as indicated by the activity on the day. This is available for all roles. If the department is equal to all, shifts from all rotas in all departments are returned.

Request (JSON)

GET /shifts/day/{date}/?securitytoken={sessionToken}(&departmentId={departmentId})
Content-Type: application/json

Response (JSON)

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[{"BreakCode":"Q","Comment":"",
"DepartmentName":"Ny Bistro","EmployeeName":"",
"EndTime":"\/Date(1316700000000+0200)\/",
"StartTime":"\/Date(1316671200000+0200)\/"},
...
{"BreakCode":"Q","Comment":"",
"DepartmentName":"Ny Bistro","EmployeeName":"",
"EndTime":"\/Date(1316700000000+0200)\/",
"StartTime":"\/Date(1316671200000+0200)\/"}]

 

d) Approved Rota – Period of Dates per Employee

This service returns a list of the shifts in the approved rota for the selected period of dates for the selected employee. This is available for all roles. If the department is equal to all, shifts from all rotas in all departments are returned.

Request (JSON)

GET /shifts/period/{startDate}/{endDate}/?securitytoken={sessionToken}(&departmentId={departmentId})&employeeId=employeeId
Content-Type: application/json

 

Response (JSON)

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[{"BreakCode":"Q","Comment":"",
"DepartmentName":"Ny Bistro","EmployeeName":"",
"EndTime":"\/Date(1316700000000+0200)\/",
"StartTime":"\/Date(1316671200000+0200)\/"},
...
{"BreakCode":"Q","Comment":"",
"DepartmentName":"Ny Bistro","EmployeeName":"",
"EndTime":"\/Date(1316700000000+0200)\/",
"StartTime":"\/Date(1316671200000+0200)\/"}]

 

Response (XML)

"<ArrayOfShift xmlns="http://schemas.datacontract.org/2004/07/Tamigo.Services.Entities" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Shift>
<BreakCode>Q</BreakCode>
<Comment/>
<DepartmentName>København</DepartmentName>
<EmployeeName/>
<EndTime>2011-12-13T16:00:00</EndTime>
<StartTime>2011-12-13T08:00:00</StartTime>
</Shift>
</ArrayOfShift>"

 

e) Get All Types of Shifts – Original, Planned, and Worked Shifts

This service returns a list of all types of shifts for the selected period of dates. This is available only when you are logged in as an application. If the department is equal to all, shifts from all rotas in all departments are returned.

Request (JSON)

GET /shifts/all/{startDate}/{endDate}/?securityToken={tokenId}&departmentId={departmentId}") Content-Type: application/json

Response (JSON)

Host: api.tamigo.com
Content-Type: application/json
Accept: application/json

[{

    "Date": "/Date(1453071600000+0100)/",
    "DepartmentId": "dc1a04be-fb08-443f-aa3f-06b0a7bffb28",
    "DepartmentKey": "835",
    "DepartmentName": "Copenhagent",
    "EmployeeId": "00000000-0000-0000-0000-000000000000",
    "FirstName": null,
    "EmployeePosKey": "E100",
    "Email": "user@tamigo.com",
    "OriginalShift": {
    "ActivityName": null,
      "Comments": "",
      "Shift": 7.25,
      "ShiftActivityId": null,
      "Sum": null
    },
    "PlannedShift": {
      "ActivityName": null,
      "Comments": "",
      "Shift": 7.25,
      "ShiftActivityId": null,
      "Sum": null
    },
    "ActualShift": {
      "ActivityName": null,
      "Comments": null,
      "Shift": null,
      "ShiftActivityId": null,
      "Sum": null
    },

    "WageNumber": null
  }
]

Response (XML)

"<ArrayOfEmployeeShift xmlns="http://schemas.datacontract.org/2004/07/Tamigo.Services.Entities" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <EmployeeShift>
        <Date>2016-01-05T00:00:00</Date>
        <DepartmentId>dc1a04be-fb08-443f-aa3f-06b0a7bffb28</DepartmentId>
        <DepartmentKey>835</DepartmentKey>
        <DepartmentName>Copenhagent</DepartmentName>
        <EmployeeId>00000000-0000-0000-0000-000000000000</EmployeeId>
        <FirstName i:nil="true"/>
        <OriginalShift>
            <ActivityName i:nil="true"/>
            <Comments/>
            <Shift>9.00</Shift>
            <ShiftActivityId i:nil="true"/>
            <Sum i:nil="true"/>
        </OriginalShift>
        <PlannedShift>
            <ActivityName i:nil="true"/>
            <Comments/>
            <Shift>9.00</Shift>
            <ShiftActivityId i:nil="true"/>
            <Sum i:nil="true"/>
        </PlannedShift>
         <ActualShift>
            <ActivityName i:nil="true"/>
            <Comments i:nil="true"/>
            <Shift i:nil="true"/>
            <ShiftActivityId i:nil="true"/>
            <Sum i:nil="true"/>
        </ActualShift>

        <WageNumber i:nil="true"/>
    </EmployeeShift>

 

f) Get Relevant Planned Shifts

This service returns the most relevant planned shift for the employee, meaning the shift that has not ended yet.

Request (JSON)

GET /shifts/planned/relevant/?securitytoken={sessionTokenContent-Type: application/json

 

Response (JSON)

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{"BreakCode":"Q","Comment":"",
"DepartmentName":"Ny Bistro","EmployeeName":"",
"EndTime":"\/Date(1316700000000+0200)\/",
"StartTime":"\/Date(1316671200000+0200)\/"},
...
{"BreakCode":"Q","Comment":"",
"DepartmentName":"Ny Bistro","EmployeeName":"",
"EndTime":"\/Date(1316700000000+0200)\/",
"StartTime":"\/Date(1316671200000+0200)\/"}

 

Response (XML)

"<Shift xmlns="http://schemas.datacontract.org/2004/07/Tamigo.Services.Entities" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<BreakCode>Q</BreakCode>
<Comment/>
<DepartmentName>København</DepartmentName>
<EmployeeName/>
<EndTime>2011-12-13T16:00:00</EndTime>
<StartTime>2011-12-13T08:00:00</StartTime>
</Shift>

 

g) Available Shifts

This service is deprecated–use the Bid service instead. This service is only available for backwards compatibility. It returns a list of shifts that are available. This service is available for all roles.

Request (XML)

GET /Shifts/available/?securitytoken={sessionToken}(&departmentId={departmentId})
Content-Type: application/json

 

Response(XML)

<ArrayOfAvailableShift xmlns="http://schemas.datacontract.org/2004/07/Tamigo.Services.Entities" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<AvailableShift>
<BidPlaced>false</BidPlaced>
<BreakCode>Q</BreakCode>
<Comment/><DepartmentId>dc1a04be-fb08-443f-aa3f-06b0a7bffb28</DepartmentId>
<DepartmentName>København</DepartmentName>
<EmployeeHaveShiftSameDay>false</EmployeeHaveShiftSameDay>
<EndTime>2011-12-13T16:00:00</EndTime>
<ExtendedShiftEndTime>0001-01-01T00:00:00</ExtendedShiftEndTime>
<ExtendedShiftStartTime>0001-01-01T00:00:00</ExtendedShiftStartTime>
<IsExtended>false</IsExtended>
<OtherEmployeesHaveBidOnShift>false</OtherEmployeesHaveBidOnShift>
<ShiftId>d54f1963-bdd4-4929-a053-4efb947f96b2</ShiftId>
<ShiftProviderId>00000000-0000-0000-0000-000000000000</ShiftProviderId>
<ShiftProviderName>Ledig</ShiftProviderName>
<StartTime>2011-12-13T08:00:00</StartTime>
<Week>50</Week>
</AvailableShift>
…
</ArrayOfAvailableShift>

 

h) Update Shifts

Use this service to update your shift resources. It is important to send all information about the shift back, even if it is not changed. All changes between the original shift and the new shifts will be updates. So, if an original shift comment is omitted the comment will be deleted.

This service is also used for employees to set their shifts as available by setting IsAvailable to true. If an employee uses this service, only the IsAvailable property will be used. If a planner changes the employee on a shift, exchanges and bids will be removed if the shift can be changed. (if the shift can be changed it will be removed). If EmployeeId is changed to null, IsAvailable will be set as true on the server.

This service returns a Response Message. If Success is true, the response is successful. If Success is false a message will be supplied with a description of the error.  To update a shift with a missing end time, set the end time to a date before 01-01-1900.

Request (JSON)

PUT /Shifts/{ShiftId}/?securitytoken={sessionToken}

{
  "ShiftId": "fb60311f-e88c-4a6a-9bc4-6ad09fd6a7b5",
  "StartTime": "\/Date(1355986847000+0100)\/",
  "EndTime": "\/Date(1356008447000+0100)\/",
  "Comment": "Early",
  "BreakCode": "P",
  "IsAvailable": false,
  "IsExchange": false,
  "EmployeeId": "4a6b1e63-666d-4955-b42b-20a289da3414",
  "ShiftActivityId": "00000000-0000-0000-0000-000000000000"
}

Response (JSON)

HTTP/1.1 200 OK
{"Message":null,"Success":true}

 

i) Add Shifts

A Planner can use everything on a shift besides the IsAvailable and the IsExchange properties. If the EmployeeId is sent as null, IsAvailable will be set as true on the server.

This service returns a Response Message. If Success is true, the response is successful. If Success is false, a message will be supplied with a description of the error. type should be either planned or actual to define if you are adding a planned or a worked shift.

Request (JSON)

POST /Shifts/{type}/?securitytoken={sessionToken}

{
  "StartTime": "\/Date(1355986847000+0100)\/",
  "EndTime": "\/Date(1356008447000+0100)\/",
  "Comment": "Early",
  "BreakCode": "P",
  "IsAvailable": false,
  "IsExchange": false,
  "EmployeeId": "4a6b1e63-666d-4955-b42b-20a289da3414",
  "ShiftActivityId": "00000000-0000-0000-0000-000000000000"

}

Response (JSON)

HTTP/1.1 200 OK

{"Message":null,"Success":true}

 

j) Delete Shifts 

A Planner or Administrator can delete a shift if they have a role in the specific department.

Request (JSON)

DELETE /Shifts/{shiftId}/?securityToken={tokenId}

Response (JSON)

HTTP/1.1 200 OK

{"Message":null,"Success":true}