The following topics describe the foundational concepts and methods for adding employee information using RESTful Web Services:
URL Endpoint
The base URL for the Employees API is as follows:
https://www.dayforcehcm.com/api/{clientName}/v1/Employees
Important: Employees are forever persistent in the Dayforce database. After an employee has been added to the Dayforce database, they cannot be removed.
Submit a Request to Add an Employee
Adding an employee is very much like updating an employee but you use the HTTP verb POST instead of PATCH. In addition, the request body is a more complete representation of an employee. Validation logic remains the same has updating an employee, and you can force validation only by using the same isValidateOnly query string parameter. Here is an example:
POST https://www.dayforcehcm.com/api/<clientName>/v1/Employees/abc123
Body:
{
"BioExempt":false,
"BirthDate":"1970-01-01T00:00:00",
"Gender":"M",
"PhotoExempt":true,
"RequiresExitInterview":true,
"SocialSecurityNumber":"999999999",
"FirstTimeAccessEmailSentCount":0,
"FirstTimeAccessVerificationAttempts":0,
"SendFirstTimeAccessEmail":false,
"XRefCode":"Sample760",
"FirstName":"FSample",
"LastName":"LSample"
}
The EmployeesApi provides a method to add an employee. The request object is of the type EmployeePostRequest. Unlike using PATCH to update an employee, when you use POST, there is no concern about null versus missing property values because there is no existing data for this new employee in the database. The following screenshot shows the code that would be used to add an employee using the EmployeesApi proxy class. This code is setting the IsValidateOnly property of the request to true to ensure that you don’t add an employee with sample code.