Dayforce hosts multiple versions of this service to support multiple clients. All clients use the same URL, and Dayforce issues an HTTP redirect on every request to ensure that your request is processed with the correct service.
If you are submitting many requests in a short period of time, you will benefit from obtaining the target redirect URL which will allow you to bypass the automatic redirect. To obtain the target URL, you should make the following REST service request, replacing {clientName} with your organization name:
https://www.dayforcehcm.com/api/{clientName}/V1/ClientMetadata
Important: This method must be called at a minimum of once a day if you store the URL returned from this method.
The client and version specific URL returned from this service will look very similar to this root URL, but will likely have a version number embedded within it.
Example Response
{
"ServiceVersion":"58.x.x.x",
"ServiceUri":"https://www.dayforcehcm.com/58/api"
}
Sample Code - Acquire Client Site URL
Program.cs
clientMetadataApi.cs:
The ClientMetadataApi response contains the current ServiceURL to which API requests should be made
The main program creates the API objects which contain an internal RestClientHelper. The RestClientHelper class can execute RestRequests as well as handle the redirects that the RESTful Web Services require.