Skip to content

Working with Employee Work Assignments

Overview

The following operations allow you to retrieve, create or update work assignments of an employee

Operation Description
GET Employee Work Assignments Retrieve employee work assignments.
POST Employee Work Assignments Create employee work assignments.
PATCH Employee Work Assignments Update employee work assignments.

Operation details

This section provides more details on each of the operations.

Retrieving Employee Work Assignments

We can use GET Employee Work Assignments operation with required parameters to find the work assignment of employees.

GET Employee Work Assignments

<ceridiandayforce.getEmployeeWorkAssignments>
    <xRefCode>{$ctx:xRefCode}</xRefCode>
    <contextDate>{$ctx:contextDate}</contextDate>
    <contextDateRangeFrom>{$ctx:contextDateRangeFrom}</contextDateRangeFrom>
    <contextDateRangeTo>{$ctx:contextDateRangeTo}</contextDateRangeTo>
</ceridiandayforce.getEmployeeWorkAssignments>

Properties

  • xRefCode (Mandatory): The unique identifier (external reference code) of the employee whose data will be retrieved. The value provided must be the exact match for an employee; otherwise, a bad request (400) error will be returned.
  • contextDate (Optional): The Context Date value is an “as-of” date used to determine which employee data to search when records have specific start and end dates. The service defaults to the current datetime if the requester does not specify a value. Example: 2017-01-01T13:24:56
  • contextDateRangeFrom (Optional): The Context Date Range From value is the start of the range of dates used to determine which employee data to search when records have specific start and end dates. The service defaults to null if the requester does not specify a value. Example: 2017-01-01T13:24:56
  • contextDateRangeTo (Optional): The Context Date Range To value is the end of the range of dates to determine which employee data to search when records have specific start and end dates. The service defaults to null if the requester does not specify a value. Example: 2017-01-01T13:24:56

Sample request

Following is a sample request that can be handled by this operation.

{
  "username": "DFWSTest",
  "password": "DFWSTest",
  "clientNamespace": "usconfigr57.dayforcehcm.com/Api/ddn",
  "apiVersion": "V1",
  "xRefCode": "42199",
  "contextDate": "2017-01-01T13:24:56"
}

Sample response

Given below is a sample response for this operation.

{
    "Data": [
        {
            "Position": {
                "Department": {
                    "XRefCode": "11",
                    "ShortName": "Packaging",
                    "LongName": "Packaging"
                },
                "Job": {
                    "EmployeeEEO": {
                        "XRefCode": "8",
                        "ShortName": "8 - Laborers and Helpers",
                        "LongName": "8 - Laborers and Helpers"
                    },
                    "IsUnionJob": false,
                    "JobRank": 13,
                    "JobClassification": {
                        "XRefCode": "ProductionStaff",
                        "ShortName": "Production Staff",
                        "LongName": "Production Staff"
                    },
                    "FLSAStatus": {
                        "XRefCode": "NON-EXEMPT",
                        "ShortName": "Non-exempt"
                    },
                    "XRefCode": "13",
                    "ShortName": "Packager"
                },
                "XRefCode": "Packaging Packager",
                "ShortName": "Package Handler"
            },
            "Location": {
                "ClockTransferCode": "540",
                "LegalEntity": {
                    "Country": {
                        "Name": "United States of America",
                        "XRefCode": "USA",
                        "ShortName": "United States of America",
                        "LongName": "United States of America"
                    },
                    "LegalEntityAddress": {
                        "Address1": "1 Wilkinson Street",
                        "City": "Jersey City",
                        "PostalCode": "10017",
                        "Country": {
                            "Name": "United States of America",
                            "XRefCode": "USA",
                            "ShortName": "United States of America",
                            "LongName": "United States of America"
                        },
                        "State": {
                            "Name": "New Jersey",
                            "XRefCode": "NJ",
                            "ShortName": "New Jersey"
                        }
                    },
                    "LegalIdNumber": "654565981",
                    "XRefCode": "Manufacturing Co. USA ",
                    "ShortName": " Manufacturing Co. USA ",
                    "LongName": "Manufacturing Co. USA "
                },
                "XRefCode": "500Packaging",
                "ShortName": "Plant 1 - Packaging",
                "LongName": "Plant 1 - Packaging"
            },
            "EffectiveStart": "2000-01-01T00:00:00",
            "IsPAPrimaryWorkSite": false,
            "IsPrimary": true,
            "IsStatutory": false,
            "IsVirtual": false,
            "BusinessTitle": "Senior Package Handler",
            "LastModifiedTimeStamp": "2016-04-26T09:53:27.947",
            "Rank": 15
        },
        {
            "Position": {
                "Department": {
                    "XRefCode": "9",
                    "ShortName": "Assembly 2",
                    "LongName": "Assembly 2"
                },
                "Job": {
                    "EmployeeEEO": {
                        "XRefCode": "3",
                        "ShortName": "3 - Technicians",
                        "LongName": "3 - Technicians"
                    },
                    "IsUnionJob": false,
                    "JobRank": 12,
                    "JobClassification": {
                        "XRefCode": "ManagerialAndProfessionalStaff",
                        "ShortName": "Managerial, Professional and Engineering Staff",
                        "LongName": "Managerial, Professional and Engineering Staff"
                    },
                    "FLSAStatus": {
                        "XRefCode": "NON-EXEMPT",
                        "ShortName": "Non-exempt"
                    },
                    "XRefCode": "12",
                    "ShortName": "Process Technician"
                },
                "XRefCode": "Assembly 2 Process Technician",
                "ShortName": "Assembly 2 Process Technician"
            },
            "Location": {
                "ClockTransferCode": "510",
                "LegalEntity": {
                    "Country": {
                        "Name": "United States of America",
                        "XRefCode": "USA",
                        "ShortName": "United States of America",
                        "LongName": "United States of America"
                    },
                    "LegalEntityAddress": {
                        "Address1": "1 Wilkinson Street",
                        "City": "Jersey City",
                        "PostalCode": "10017",
                        "Country": {
                            "Name": "United States of America",
                            "XRefCode": "USA",
                            "ShortName": "United States of America",
                            "LongName": "United States of America"
                        },
                        "State": {
                            "Name": "New Jersey",
                            "XRefCode": "NJ",
                            "ShortName": "New Jersey"
                        }
                    },
                    "LegalIdNumber": "654565981",
                    "XRefCode": "Manufacturing Co. USA ",
                    "ShortName": " Manufacturing Co. USA ",
                    "LongName": "Manufacturing Co. USA "
                },
                "XRefCode": "500Assembly 2",
                "ShortName": "Plant 1 - Assembly 2",
                "LongName": "Plant 1 - Assembly 2"
            },
            "EffectiveStart": "2011-12-12T00:00:00",
            "IsPAPrimaryWorkSite": false,
            "IsPrimary": false,
            "IsStatutory": false,
            "IsVirtual": false,
            "LastModifiedTimeStamp": "2012-06-18T14:13:31.55",
            "JobRate": 22.50000
        }
    ]
}

Related Dayforce documentation

https://developers.dayforce.com/Build/API-Explorer/Employee-Employment-Information/Work-Assignments/GET-Employee-Work-Assignments.aspx

Creating Employee Work Assignments

We can use POST Employee Work Assignments operation with required parameters to create work assignments for employees

POST Employee Work Assignments

<ceridiandayforce.postEmployeeWorkAssignments>
    <xRefCode>{$ctx:xRefCode}</xRefCode>
    <isValidateOnly>{$ctx:isValidateOnly}</isValidateOnly>
    <fieldAndValue>{$ctx:fieldAndValue}</fieldAndValue>
</ceridiandayforce.postEmployeeWorkAssignments>

Properties

  • xRefCode (Mandatory): The unique identifier (external reference code) of the employee whose data will be retrieved. The value provided must be the exact match for an employee; otherwise, a bad request (400) error will be returned.
  • isValidateOnly (Mandatory): When a TRUE value is used in this parameter, POST and PATCH operations validate the request without applying updates to the database.

Sample request

Following is a sample request that can be handled by this operation.

{
  "username": "DFWSTest",
  "password": "DFWSTest",
  "clientNamespace": "usconfigr57.dayforcehcm.com/Api/ddn",
  "apiVersion": "V1",
  "xRefCode": "100421",
  "isValidateOnly": "true",
  "contextDateRangeFrom": "2017-01-01T13:24:56",
  "fieldAndValue": {
            "Position": {
                "Department": {
                    "XRefCode": "9",
                    "ShortName": "Packaging",
                    "LongName": "Packaging"
                },
                "Job": {
                    "EmployeeEEO": {
                        "XRefCode": "8",
                        "ShortName": "8 - Laborers and Helpers",
                        "LongName": "8 - Laborers and Helpers"
                    },
                    "IsUnionJob": false,
                    "JobRank": 13,
                    "JobClassification": {
                        "XRefCode": "ProductionStaff",
                        "ShortName": "Production Staff",
                        "LongName": "Production Staff"
                    },
                    "FLSAStatus": {
                        "XRefCode": "NON-EXEMPT",
                        "ShortName": "Non-exempt"
                    },
                    "XRefCode": "13",
                    "ShortName": "Packager"
                },
                "XRefCode": "Packaging Packager",
                "ShortName": "Package Handler"
            },
            "Location": {
                "ClockTransferCode": "540",
                "LegalEntity": {
                    "Country": {
                        "Name": "United States of America",
                        "XRefCode": "USA",
                        "ShortName": "United States of America",
                        "LongName": "United States of America"
                    },
                    "LegalEntityAddress": {
                        "Address1": "1 Wilkinson Street",
                        "City": "Jersey City",
                        "PostalCode": "10017",
                        "Country": {
                            "Name": "United States of America",
                            "XRefCode": "USA",
                            "ShortName": "United States of America",
                            "LongName": "United States of America"
                        },
                        "State": {
                            "Name": "New Jersey",
                            "XRefCode": "NJ",
                            "ShortName": "New Jersey"
                        }
                    },
                    "LegalIdNumber": "654565981",
                    "XRefCode": "Manufacturing Co. USA ",
                    "ShortName": " Manufacturing Co. USA ",
                    "LongName": "Manufacturing Co. USA "
                },
                "XRefCode": "500Packaging",
                "ShortName": "Plant 1 - Packaging",
                "LongName": "Plant 1 - Packaging"
            },
            "EffectiveStart": "2000-01-01T00:00:00",
            "IsPAPrimaryWorkSite": false,
            "IsPrimary": true,
            "IsStatutory": false,
            "IsVirtual": false,
            "BusinessTitle": "Senior Package Handler",
            "LastModifiedTimeStamp": "2016-04-26T09:53:27.947",
            "Rank": 15
        }
}

Sample response

Dayforce returns 200

Related Dayforce documentation

https://developers.dayforce.com/Build/API-Explorer/Employee-Employment-Information/Work-Assignments/POST-Employee-Work-Assignments.aspx

Updating Employee Work Assignments

We can use PATCH Employee Work Assignments operation with required parameters to update the work assignments of an employee.

PATCH Employee Work Assignments

<ceridiandayforce.patchEmployeeWorkAssignments>
    <xRefCode>{$ctx:xRefCode}</xRefCode>
    <isValidateOnly>{$ctx:isValidateOnly}</isValidateOnly>
    <fieldAndValue>{$ctx:fieldAndValue}</fieldAndValue>
</ceridiandayforce.patchEmployeeWorkAssignments>

Properties

  • xRefCode (Mandatory): The unique identifier (external reference code) of the employee whose data will be retrieved. The value provided must be the exact match for an employee; otherwise, a bad request (400) error will be returned.
  • isValidateOnly (Mandatory): When a TRUE value is used in this parameter, POST and PATCH operations validate the request without applying updates to the database.

Sample request

Following is a sample request that can be handled by this operation.

{
  "username": "DFWSTest",
  "password": "DFWSTest",
  "clientNamespace": "usconfigr57.dayforcehcm.com/Api/ddn",
  "apiVersion": "V1",
  "xRefCode": "100421",
  "isValidateOnly": "true",
  "contextDateRangeFrom": "2017-01-01T13:24:56",
  "fieldAndValue": {
            "Position": {
                "Department": {
                    "XRefCode": "9",
                    "ShortName": "Packaging",
                    "LongName": "Packaging"
                },
                "Job": {
                    "EmployeeEEO": {
                        "XRefCode": "8",
                        "ShortName": "8 - Laborers and Helpers",
                        "LongName": "8 - Laborers and Helpers"
                    },
                    "IsUnionJob": false,
                    "JobRank": 13,
                    "JobClassification": {
                        "XRefCode": "ProductionStaff",
                        "ShortName": "Production Staff",
                        "LongName": "Production Staff"
                    },
                    "FLSAStatus": {
                        "XRefCode": "NON-EXEMPT",
                        "ShortName": "Non-exempt"
                    },
                    "XRefCode": "13",
                    "ShortName": "Packager"
                },
                "XRefCode": "Packaging Packager",
                "ShortName": "Package Handler"
            },
            "Location": {
                "ClockTransferCode": "540",
                "LegalEntity": {
                    "Country": {
                        "Name": "United States of America",
                        "XRefCode": "USA",
                        "ShortName": "United States of America",
                        "LongName": "United States of America"
                    },
                    "LegalEntityAddress": {
                        "Address1": "1 Wilkinson Street",
                        "City": "Jersey City",
                        "PostalCode": "10017",
                        "Country": {
                            "Name": "United States of America",
                            "XRefCode": "USA",
                            "ShortName": "United States of America",
                            "LongName": "United States of America"
                        },
                        "State": {
                            "Name": "New Jersey",
                            "XRefCode": "NJ",
                            "ShortName": "New Jersey"
                        }
                    },
                    "LegalIdNumber": "654565981",
                    "XRefCode": "Manufacturing Co. USA ",
                    "ShortName": " Manufacturing Co. USA ",
                    "LongName": "Manufacturing Co. USA "
                },
                "XRefCode": "500Packaging",
                "ShortName": "Plant 1 - Packaging",
                "LongName": "Plant 1 - Packaging"
            },
            "EffectiveStart": "2000-01-01T00:00:00",
            "IsPAPrimaryWorkSite": false,
            "IsPrimary": true,
            "IsStatutory": false,
            "IsVirtual": false,
            "BusinessTitle": "Senior Package Handler",
            "LastModifiedTimeStamp": "2016-04-26T09:53:27.947",
            "Rank": 15
        }
}

Sample response

Dayforce returns 200

Related Dayforce documentation

https://developers.dayforce.com/Build/API-Explorer/Employee-Employment-Information/Work-Assignments/PATCH-Employee-Work-Assignments.aspx

Sample configuration

Following example illustrates how to connect to Dayforce with the init operation and query operation.

1.Create a sample proxy as below :

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="query"
       startOnLoad="true"
       statistics="disable"
       trace="disable"
       transports="http,https">
   <target>
      <inSequence>
         <log level="full" separator=","/>
         <property expression="json-eval($.username)" name="username"/>
         <property expression="json-eval($.password)" name="password"/>
         <property expression="json-eval($.clientNamespace)" name="clientNamespace"/>
         <property expression="json-eval($.apiVersion)" name="apiVersion"/>
         <property expression="json-eval($.xRefCode)" name="xRefCode"/>
         <property expression="json-eval($.contextDate)" name="contextDate"/>
         <ceridiandayforce.init>
            <username>{$ctx:username}</username>
            <password>{$ctx:password}</password>
            <clientNamespace>{$ctx:clientNamespace}</clientNamespace>
            <apiVersion>{$ctx:apiVersion}</apiVersion>
         </ceridiandayforce.init>
         <ceridiandayforce.getEmployeeWorkAssignments>
            <xRefCode>{$ctx:xRefCode}</xRefCode>
            <contextDate>{$ctx:contextDate}</contextDate>
         </ceridiandayforce.getEmployeeWorkAssignments>
         <send/>
      </inSequence>
   </target>
   <description/>
</proxy>

2.Create a json file named query.json and copy the configurations given below to it:

{
  "username": "DFWSTest",
  "password": "DFWSTest",
  "clientNamespace": "usconfigr57.dayforcehcm.com/Api/ddn",
  "apiVersion": "V1",
  "xRefCode": "42199",
  "contextDate": "2017-01-01T13:24:56"
}
3.Replace the credentials with your values.

4.Execute the following curl command:

curl http://localhost:8280/services/query -H "Content-Type: application/json" -d @query.json
5.Dayforce returns HTTP Code 200 with the following response body

{
    "Data": [
        {
            "Position": {
                "Department": {
                    "XRefCode": "11",
                    "ShortName": "Packaging",
                    "LongName": "Packaging"
                },
                "Job": {
                    "EmployeeEEO": {
                        "XRefCode": "8",
                        "ShortName": "8 - Laborers and Helpers",
                        "LongName": "8 - Laborers and Helpers"
                    },
                    "IsUnionJob": false,
                    "JobRank": 13,
                    "JobClassification": {
                        "XRefCode": "ProductionStaff",
                        "ShortName": "Production Staff",
                        "LongName": "Production Staff"
                    },
                    "FLSAStatus": {
                        "XRefCode": "NON-EXEMPT",
                        "ShortName": "Non-exempt"
                    },
                    "XRefCode": "13",
                    "ShortName": "Packager"
                },
                "XRefCode": "Packaging Packager",
                "ShortName": "Package Handler"
            },
            "Location": {
                "ClockTransferCode": "540",
                "LegalEntity": {
                    "Country": {
                        "Name": "United States of America",
                        "XRefCode": "USA",
                        "ShortName": "United States of America",
                        "LongName": "United States of America"
                    },
                    "LegalEntityAddress": {
                        "Address1": "1 Wilkinson Street",
                        "City": "Jersey City",
                        "PostalCode": "10017",
                        "Country": {
                            "Name": "United States of America",
                            "XRefCode": "USA",
                            "ShortName": "United States of America",
                            "LongName": "United States of America"
                        },
                        "State": {
                            "Name": "New Jersey",
                            "XRefCode": "NJ",
                            "ShortName": "New Jersey"
                        }
                    },
                    "LegalIdNumber": "654565981",
                    "XRefCode": "Manufacturing Co. USA ",
                    "ShortName": " Manufacturing Co. USA ",
                    "LongName": "Manufacturing Co. USA "
                },
                "XRefCode": "500Packaging",
                "ShortName": "Plant 1 - Packaging",
                "LongName": "Plant 1 - Packaging"
            },
            "EffectiveStart": "2000-01-01T00:00:00",
            "IsPAPrimaryWorkSite": false,
            "IsPrimary": true,
            "IsStatutory": false,
            "IsVirtual": false,
            "BusinessTitle": "Senior Package Handler",
            "LastModifiedTimeStamp": "2016-04-26T09:53:27.947",
            "Rank": 15
        },
        {
            "Position": {
                "Department": {
                    "XRefCode": "9",
                    "ShortName": "Assembly 2",
                    "LongName": "Assembly 2"
                },
                "Job": {
                    "EmployeeEEO": {
                        "XRefCode": "3",
                        "ShortName": "3 - Technicians",
                        "LongName": "3 - Technicians"
                    },
                    "IsUnionJob": false,
                    "JobRank": 12,
                    "JobClassification": {
                        "XRefCode": "ManagerialAndProfessionalStaff",
                        "ShortName": "Managerial, Professional and Engineering Staff",
                        "LongName": "Managerial, Professional and Engineering Staff"
                    },
                    "FLSAStatus": {
                        "XRefCode": "NON-EXEMPT",
                        "ShortName": "Non-exempt"
                    },
                    "XRefCode": "12",
                    "ShortName": "Process Technician"
                },
                "XRefCode": "Assembly 2 Process Technician",
                "ShortName": "Assembly 2 Process Technician"
            },
            "Location": {
                "ClockTransferCode": "510",
                "LegalEntity": {
                    "Country": {
                        "Name": "United States of America",
                        "XRefCode": "USA",
                        "ShortName": "United States of America",
                        "LongName": "United States of America"
                    },
                    "LegalEntityAddress": {
                        "Address1": "1 Wilkinson Street",
                        "City": "Jersey City",
                        "PostalCode": "10017",
                        "Country": {
                            "Name": "United States of America",
                            "XRefCode": "USA",
                            "ShortName": "United States of America",
                            "LongName": "United States of America"
                        },
                        "State": {
                            "Name": "New Jersey",
                            "XRefCode": "NJ",
                            "ShortName": "New Jersey"
                        }
                    },
                    "LegalIdNumber": "654565981",
                    "XRefCode": "Manufacturing Co. USA ",
                    "ShortName": " Manufacturing Co. USA ",
                    "LongName": "Manufacturing Co. USA "
                },
                "XRefCode": "500Assembly 2",
                "ShortName": "Plant 1 - Assembly 2",
                "LongName": "Plant 1 - Assembly 2"
            },
            "EffectiveStart": "2011-12-12T00:00:00",
            "IsPAPrimaryWorkSite": false,
            "IsPrimary": false,
            "IsStatutory": false,
            "IsVirtual": false,
            "LastModifiedTimeStamp": "2012-06-18T14:13:31.55",
            "JobRate": 22.50000
        }
    ]
}