Dayforce RESTful services use the POST verb to create a department.
Overview
Consuming applications can use the POST Department request to create a department record in Dayforce.
The URL for POST operations uses the following base URL:
https://www.dayforcehcm.com/api/CompanyName/V1/Departments
To create a department, a unique identifier (XRefCode) must be provided. This is done within the data that is sent for processing (referred to as the request body). The XRefCode must be generated by the requester and it must be unique. It is the consuming application’s responsibility to assign a unique identifier (XRefCode) to the department when it's sent in a POST operation. Dayforce web services will return an error if the XRefCode provided in the request body matches the value of an existing department record in Dayforce. If this occurs, the consuming application must determine whether to raise an error (requesting manual intervention) or resubmit the request using the PATCH verb.
Important: This request writes data into Dayforce. When using this request, be sure that the consuming application/requester is using the correct Dayforce instance (test or production). Watch out for inadvertently updating the wrong instance of Dayforce (for example, adding test data to a production instance).
Parameters
IsValidateOnly (boolean)
- Used to specify that all of the validations need to be performed without committing any changes.
- Use this parameter to control whether committing information to your instance of Dayforce is your responsibility.
- https://www.dayforcehcm.com /api/CompanyName/V1/Departments?isValidateOnly=true
Request Body
The request body contains the values that need to be inserted. The request body should be structured so that it can be interpreted by Dayforce web services. Therefore, consuming applications should use the JSON structure that they retrieve when using the RESTful Get Department Detail by XRefCode request. See RESTful Get Department Details.