Skip to content

Update Shifts

Operation
wsdlUpdateShifts
SOAP Action
uri:FlexForce/UpdateShifts
Service
FlexForce
Port
FlexForcePort
Style
rpc

Create, update, or delete one or more scheduled / absence shifts.


Request

Message: wsdlUpdateShiftsRequest

apiKeystringrequired

API key of the unit.

ShiftsArray<Shift>required

Array of Shift records to create / update / delete.

itemShift

A scheduled or worked shift.

scheduleIdstring

Set to 0 or "" to create a new shift; supply an existing id to update that shift.

Example134
begDatedaterequired

Shift begin date.

FormatYYYY-MM-DD
Example2018-01-02
endDatedaterequired

Shift end date.

FormatYYYY-MM-DD
Example2018-01-02
begTimestringrequired

Shift begin time.

FormatHH:MM:SS
Example12:26:00
endTimestringrequired

Shift end time.

FormatHH:MM:SS
Example17:26:00
begBreakstring
FormatHH:MM:SS
Example00:00:00
endBreakstring
FormatHH:MM:SS
Example00:00:00
begBreak2string
FormatHH:MM:SS
Example00:00:00
endBreak2string
FormatHH:MM:SS
Example00:00:00
begBreak3string
FormatHH:MM:SS
Example00:00:00
endBreak3string
FormatHH:MM:SS
Example00:00:00
begBreak4string
FormatHH:MM:SS
Example00:00:00
endBreak4string
FormatHH:MM:SS
Example00:00:00
persIdstring

Quinyx id of the employee. Set to 0 if badgeNo is used.

Example16
badgeNostring

Badge number of the employee. Leave empty if persId is used.

Example19888
shiftCategoryIdstringrequired

Required unless shiftTypeExtCode is specified, in which case it can be empty but must still be present.

Example10
agreementIdint

Agreement id. 0 = none.

extScheduleIdstring

External id of the shift. Can only be set when creating a shift; it cannot be edited/updated on an existing shift.

deleteShiftint

Whether to delete the shift.

Values
0Insert or update the shift (default).
1Delete the shift.
Default0
Example0
sectionIdint

Id in the section table.

extSectionIdstring

External section id.

commentstring

Description of the given shift.

ExampleDescription content
countsAsScheduledHoursboolean

Default inherits from the setting on the shift type.

Exampletrue
isFreeDayboolean

Default inherits from the setting on the shift type.

shiftTypeExtCodestring

External code for the shift type, which can be defined through an integration key type.

costCentreIdint

Cost centre id.

costCentreExtCodestring

External cost centre code.

projectIdint

Project id.

projectExtCodestring

External project code.

accountIdint

Account id.

accountExtCodestring

External account code.

replaceTasksboolean
tasksArray<Task>

An array of Task records. If present but empty, all tasks are removed; if non-empty, only the included tasks are set.

applyShiftTypeRulesboolean

When set, the shift type rules are applied.

Values
trueShift type rules are applied when the shift is updated.
falseRules are skipped.
Defaultfalse
Exampletrue
validationErrorsArray<xsd:string>

Array of validation error messages returned for the shift.

curl -X POST 'https://api.quinyx.com/FlexForceWebServices.php' \
  -H 'Content-Type: text/xml; charset=utf-8' \
  -H 'SOAPAction: "uri:FlexForce/UpdateShifts"' \
  --data @- <<'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="https://api.quinyx.com/soap/FlexForce">
  <soap:Body>
    <tns:wsdlUpdateShifts>
    <apiKey xsi:type="xsd:string">string</apiKey>
    <Shifts xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:Shift[1]">
      <item xsi:type="tns:Shift">
        <scheduleId xsi:type="xsd:string">134</scheduleId>
        <begDate xsi:type="xsd:date">2018-01-02</begDate>
        <endDate xsi:type="xsd:date">2018-01-02</endDate>
        <begTime xsi:type="xsd:string">12:26:00</begTime>
        <endTime xsi:type="xsd:string">17:26:00</endTime>
        <begBreak xsi:type="xsd:string">00:00:00</begBreak>
        <endBreak xsi:type="xsd:string">00:00:00</endBreak>
        <begBreak2 xsi:type="xsd:string">00:00:00</begBreak2>
        <endBreak2 xsi:type="xsd:string">00:00:00</endBreak2>
        <begBreak3 xsi:type="xsd:string">00:00:00</begBreak3>
        <endBreak3 xsi:type="xsd:string">00:00:00</endBreak3>
        <begBreak4 xsi:type="xsd:string">00:00:00</begBreak4>
        <endBreak4 xsi:type="xsd:string">00:00:00</endBreak4>
        <persId xsi:type="xsd:string">16</persId>
        <badgeNo xsi:type="xsd:string">19888</badgeNo>
        <shiftCategoryId xsi:type="xsd:string">10</shiftCategoryId>
        <agreementId xsi:type="xsd:int">0</agreementId>
        <extScheduleId xsi:type="xsd:string">string</extScheduleId>
        <deleteShift xsi:type="xsd:int">0</deleteShift>
        <sectionId xsi:type="xsd:int">0</sectionId>
        <extSectionId xsi:type="xsd:string">string</extSectionId>
        <comment xsi:type="xsd:string">Description content</comment>
        <countsAsScheduledHours xsi:type="xsd:boolean">true</countsAsScheduledHours>
        <isFreeDay xsi:type="xsd:boolean">true</isFreeDay>
        <shiftTypeExtCode xsi:type="xsd:string">string</shiftTypeExtCode>
        <costCentreId xsi:type="xsd:int">0</costCentreId>
        <costCentreExtCode xsi:type="xsd:string">string</costCentreExtCode>
        <projectId xsi:type="xsd:int">0</projectId>
        <projectExtCode xsi:type="xsd:string">string</projectExtCode>
        <accountId xsi:type="xsd:int">0</accountId>
        <accountExtCode xsi:type="xsd:string">string</accountExtCode>
        <replaceTasks xsi:type="xsd:boolean">true</replaceTasks>
        <tasks xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:Task[1]">
          <item xsi:type="tns:Task">
            <shiftTypeExtCode xsi:type="xsd:string">string</shiftTypeExtCode>
            <shiftTypeId xsi:type="xsd:int">12</shiftTypeId>
            <begTime xsi:type="xsd:string">14:45:00</begTime>
            <endTime xsi:type="xsd:string">15:15:00</endTime>
          </item>
        </tasks>
        <applyShiftTypeRules xsi:type="xsd:boolean">true</applyShiftTypeRules>
        <validationErrors xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]">
          <item xsi:type="xsd:string">string</item>
        </validationErrors>
      </item>
    </Shifts>
    </tns:wsdlUpdateShifts>
  </soap:Body>
</soap:Envelope>
EOF

Response

Message: wsdlUpdateShiftsResponse

returnArray<Shift>

Array of Shift records reflecting the saved state.

itemShift

A scheduled or worked shift.

scheduleIdstring

Set to 0 or "" to create a new shift; supply an existing id to update that shift.

Example134
begDatedaterequired

Shift begin date.

FormatYYYY-MM-DD
Example2018-01-02
endDatedaterequired

Shift end date.

FormatYYYY-MM-DD
Example2018-01-02
begTimestringrequired

Shift begin time.

FormatHH:MM:SS
Example12:26:00
endTimestringrequired

Shift end time.

FormatHH:MM:SS
Example17:26:00
begBreakstring
FormatHH:MM:SS
Example00:00:00
endBreakstring
FormatHH:MM:SS
Example00:00:00
begBreak2string
FormatHH:MM:SS
Example00:00:00
endBreak2string
FormatHH:MM:SS
Example00:00:00
begBreak3string
FormatHH:MM:SS
Example00:00:00
endBreak3string
FormatHH:MM:SS
Example00:00:00
begBreak4string
FormatHH:MM:SS
Example00:00:00
endBreak4string
FormatHH:MM:SS
Example00:00:00
persIdstring

Quinyx id of the employee. Set to 0 if badgeNo is used.

Example16
badgeNostring

Badge number of the employee. Leave empty if persId is used.

Example19888
shiftCategoryIdstringrequired

Required unless shiftTypeExtCode is specified, in which case it can be empty but must still be present.

Example10
agreementIdint

Agreement id. 0 = none.

extScheduleIdstring

External id of the shift. Can only be set when creating a shift; it cannot be edited/updated on an existing shift.

deleteShiftint

Whether to delete the shift.

Values
0Insert or update the shift (default).
1Delete the shift.
Default0
Example0
sectionIdint

Id in the section table.

extSectionIdstring

External section id.

commentstring

Description of the given shift.

ExampleDescription content
countsAsScheduledHoursboolean

Default inherits from the setting on the shift type.

Exampletrue
isFreeDayboolean

Default inherits from the setting on the shift type.

shiftTypeExtCodestring

External code for the shift type, which can be defined through an integration key type.

costCentreIdint

Cost centre id.

costCentreExtCodestring

External cost centre code.

projectIdint

Project id.

projectExtCodestring

External project code.

accountIdint

Account id.

accountExtCodestring

External account code.

replaceTasksboolean
tasksArray<Task>

An array of Task records. If present but empty, all tasks are removed; if non-empty, only the included tasks are set.

applyShiftTypeRulesboolean

When set, the shift type rules are applied.

Values
trueShift type rules are applied when the shift is updated.
falseRules are skipped.
Defaultfalse
Exampletrue
validationErrorsArray<xsd:string>

Array of validation error messages returned for the shift.

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="https://api.quinyx.com/soap/FlexForce">
  <soap:Body>
    <tns:wsdlUpdateShiftsResponse>
    <return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:Shift[1]">
      <item xsi:type="tns:Shift">
        <scheduleId xsi:type="xsd:string">134</scheduleId>
        <begDate xsi:type="xsd:date">2018-01-02</begDate>
        <endDate xsi:type="xsd:date">2018-01-02</endDate>
        <begTime xsi:type="xsd:string">12:26:00</begTime>
        <endTime xsi:type="xsd:string">17:26:00</endTime>
        <begBreak xsi:type="xsd:string">00:00:00</begBreak>
        <endBreak xsi:type="xsd:string">00:00:00</endBreak>
        <begBreak2 xsi:type="xsd:string">00:00:00</begBreak2>
        <endBreak2 xsi:type="xsd:string">00:00:00</endBreak2>
        <begBreak3 xsi:type="xsd:string">00:00:00</begBreak3>
        <endBreak3 xsi:type="xsd:string">00:00:00</endBreak3>
        <begBreak4 xsi:type="xsd:string">00:00:00</begBreak4>
        <endBreak4 xsi:type="xsd:string">00:00:00</endBreak4>
        <persId xsi:type="xsd:string">16</persId>
        <badgeNo xsi:type="xsd:string">19888</badgeNo>
        <shiftCategoryId xsi:type="xsd:string">10</shiftCategoryId>
        <agreementId xsi:type="xsd:int">0</agreementId>
        <extScheduleId xsi:type="xsd:string">string</extScheduleId>
        <deleteShift xsi:type="xsd:int">0</deleteShift>
        <sectionId xsi:type="xsd:int">0</sectionId>
        <extSectionId xsi:type="xsd:string">string</extSectionId>
        <comment xsi:type="xsd:string">Description content</comment>
        <countsAsScheduledHours xsi:type="xsd:boolean">true</countsAsScheduledHours>
        <isFreeDay xsi:type="xsd:boolean">true</isFreeDay>
        <shiftTypeExtCode xsi:type="xsd:string">string</shiftTypeExtCode>
        <costCentreId xsi:type="xsd:int">0</costCentreId>
        <costCentreExtCode xsi:type="xsd:string">string</costCentreExtCode>
        <projectId xsi:type="xsd:int">0</projectId>
        <projectExtCode xsi:type="xsd:string">string</projectExtCode>
        <accountId xsi:type="xsd:int">0</accountId>
        <accountExtCode xsi:type="xsd:string">string</accountExtCode>
        <replaceTasks xsi:type="xsd:boolean">true</replaceTasks>
        <tasks xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:Task[1]">
          <item xsi:type="tns:Task">
            <shiftTypeExtCode xsi:type="xsd:string">string</shiftTypeExtCode>
            <shiftTypeId xsi:type="xsd:int">12</shiftTypeId>
            <begTime xsi:type="xsd:string">14:45:00</begTime>
            <endTime xsi:type="xsd:string">15:15:00</endTime>
          </item>
        </tasks>
        <applyShiftTypeRules xsi:type="xsd:boolean">true</applyShiftTypeRules>
        <validationErrors xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]">
          <item xsi:type="xsd:string">string</item>
        </validationErrors>
      </item>
    </return>
    </tns:wsdlUpdateShiftsResponse>
  </soap:Body>
</soap:Envelope>

Change log

Date Description
2018-09-19 Added comment (description) field to shift element
2018-10-25 Change a comment for countsAsScheduledHours from default as true to default as inherit from shift type
2019-07-15 Added isFreeDay
2019-10-13 Added account,project,costCentre
2020-01-28 applyShiftTypeRules