The following topics describe the foundational concepts and methods for retrieving report definitions and report data using RESTful web services:
- URL Endpoint
- Report API Proxy Class
- Retrieve List of Report Metadata
- Retrieve Report Metadata for One Report
- Retrieve Data for One Report
URL Endpoint
The base URL for the ReportMetadata API is as follows, where you replace <clientName> with the name of your organization:
https://www.dayforcehcm.com/api/<clientName>/v1/ReportMetadata
Report API Proxy Class
This class is a proxy class provided to act as a facade on top of the REST layer. Using this class is optional. Note that the examples in this topic provide the pure raw REST request and response details, but the sample code uses the ReportApi class.
In your application, you'll want to instantiate the ReportApi class using either the root URL or the target redirect URL that will be embedded in a URI object. Here is the code that demonstrates instantiating the ReportAPI class:
Retrieve List of Report Metadata
The following function will retrieve a list of report definitions for reports accessible via RESTful web service. The information contains metadata about each report. The content of each report will not be available in this function.
GET https://www.dayforcehcm.com/api/<clientName>/v1/ReportMetadata
{
"Data":[
{
"Name": "Pay Summary WS",
"Description": "Displays pay data for employees, such as how much employees earned and the pay category associated with the record.",
"XRefCode": "PaySummaryWS",
"MaxRows": 20000
},
{
"Name": "PaySummaryData",
"Description": "",
"XRefCode": "PaySummaryData",
"MaxRows": 20000
}
]
}
Sample Code: Retrieve List of Report Metadata
The following function will retrieve a list of report definitions for reports accessible via RESTful web service. The information contains metadata about each report. The content of each report will not be available in this function.
Retrieve Report Metadata for One Report
The following figure shows the sample code used to retrieve metadata for a single report:
Retrieve Data for One Report
The following figure shows the sample code used to retrieve data from a single report:
Response data would look like the following sample result:
"Data": {
"XRefCode": "TestWS",
"Rows": [
{
"IsTotalItem": "0",
"OrgUnit_ShortName": "Bank 1 - Admin",
"EmployeeEmploymentStatus_BaseRateAverage": "16.770512"
},
{
"IsTotalItem": "0",
"OrgUnit_ShortName": "Bank 1 - Commercial Lines",
"EmployeeEmploymentStatus_BaseRateAverage": "9.625000"
},
{
"IsTotalItem": "0",
"OrgUnit_ShortName": "Bank 1 - Customer Service",
"EmployeeEmploymentStatus_BaseRateAverage": "8.364583"
},
{
"IsTotalItem": "0",
"OrgUnit_ShortName": "Bank 1 - Employee Benefits",
"EmployeeEmploymentStatus_BaseRateAverage": "8.316666"
}
{
"IsTotalItem": "0",
"OrgUnit_ShortName": "Hotel 1 - Food & Beverage",
"EmployeeEmploymentStatus_BaseRateAverage": "9.150000"
}
]
},
"Paging": {
"Next": ""
}
}