Reference: WQL REST API
Use the WQL REST API to return:
- A list of data sources and data source filters.
- Details about a specific data source.
- The primary business objects for a specific data source.
- Fields in a data source.
- The related business object for a specific field.
- Thequeryparameter of theGET /dataendpoint.
- The request body of thePOST /dataendpoint.
GET /dataSources/
and GET /dataSources/{ID}
endpoints to verify the correct alias names to use.
Both tenanted hosts and the Workday Cloud Platform (WCP) API Gateway support WQL requests. Depending on where you make WQL requests from, the base URL that you use differs.
WQL Request Source
| Base URL to Use
|
|---|---|
Workday tenanted host | https://{hostname}/api/wql/{version}/{tenant}
|
WCP API Gateway | https://api.workday.com/wql/{version}
|
GET /data
Returns the data from a WQL query. Use this request for queries with less than 2,048 characters. You can only view data you have security access to. You execute WQL using the
query
parameter.Syntax:
{baseURL}/data?query={myquery}
Example query:
{baseURL}/data?query=SELECT location, max(yearsOfService) FROM allWorkers GROUP BY location
Example JSON response:
{ "total": 152, "data": [ { "location": { "descriptor": "Academic Location WATS 1", "id": "5403216f5ef810381796f3bb216504f5" }, "max(yearsOfService)": "20" }, ... ] }
Workday clears cached WQL query results after 30 minutes. To clear the cache manually, you can add
offset=0
to your query. Example:{baseURL}/data?offset=0&query=SELECT firstName, location FROM allWorkers
POST /data
Returns the data from a WQL query. Use this request for queries between 2,048 and 16,000 characters. You can only view data you have security access to. You execute WQL using the
query
parameter. Place the query
parameter and query in the request body of the API call.Syntax:
{baseURL}/data/
Example request body:
{ "query" : "SELECT location, max(yearsOfService) FROM allWorkers GROUP BY location" }
Example JSON response:
{ "total": 152, "data": [ { "location": { "descriptor": "Academic Location WATS 1", "id": "5403216f5ef810381796f3bb216504f5" }, "max(yearsOfService)": "20" }, ... ] }
GET /dataSources
Returns:
- A collection of data sources for use in a WQL query.
- The primary business object for the data sources.
- Indexing information of the data sources.
Syntax:
{baseURL}/dataSources/
Example query:
{baseURL}/dataSources
Example JSON response:
{ "total": 1722, "data": [ { "id": "aae24a47e36110000a37dcb7628d000d", "descriptor": "Indexed In Progress ~Worker~ Calibration Placements", "alias": "indexedInProgressWorkerCalibrationPlacements", "description": "Accesses a ~worker's~ in progress ~worker~ calibration event as the primary business object and the ~worker's~ attributes as the secondary business object. Returns the calibrated values specific to a ~worker~ for an in progress Calibration event.", "primaryBusinessObject": { "descriptor": "Indexed In Progress ~Worker~ Calibration Placements", "id": "aae24a47e36110000a37dd177601000e" }, "dataSourceIndexType": "Indexed" }, …… ] }
Example query with optional filter. Returns indexed data sources when filter ‘SourceIndexType’ = Indexed is used.:
{baseURL}/dataSources?SourceIndexType=Indexed
Example JSON response:
{ "total": 35, "data": [ { "id": "aae24a47e36110000a37dcb7628d000d", "descriptor": "Indexed In Progress ~Worker~ Calibration Placements", "alias": "indexedInProgressWorkerCalibrationPlacements", "description": "Accesses a ~worker's~ in progress ~worker~ calibration event as the primary business object and the ~worker's~ attributes as the secondary business object. Returns the calibrated values specific to a ~worker~ for an in progress Calibration event.", "primaryBusinessObject": { "descriptor": "Indexed In Progress ~Worker~ Calibration Placements", "id": "aae24a47e36110000a37dd177601000e" }, "dataSourceIndexType": "Indexed" }, …… ] }
GET /dataSources/{ID}
Returns a data source for the specified ID for use in a WQL query. The request also returns the primary business object for the data source.
Syntax:
{baseURL}/dataSources/‹datasource_wid›
Example query:
{baseURL}/dataSources/aae24a47e36110000a37dcb7628d000d
Example JSON response:
{ "id": "aae24a47e36110000a37dcb7628d000d", "descriptor": "Indexed In Progress ~Worker~ Calibration Placements", "optionalParameters": [ { "label": "Include ~Terminated~ ~Workers~", "alias": "includeTerminatedWorkers", "type": "Boolean" }, ... ], "supportsEntryDate": false, "description": "Accesses a ~worker's~ in progress ~worker~ calibration event as the primary business object and the ~worker's~ attributes as the secondary business object. Returns the calibrated values specific to a ~worker~ for an in progress Calibration event.", "supportsEffectiveDate": false, "alias": "indexedInProgressWorkerCalibrationPlacements", "dataSourceIndexType": "Indexed", "requiredParameters": [ { "label": "Calibration Node for nBox", "type": "Multi-instance", "alias": "calibrationNodeForNBox" } ], "fullAlias": "my::indexedInProgressWorkerCalibrationPlacements", "filterIsRequired": false, "primaryBusinessObject": { "descriptor": "Indexed In Progress ~Worker~ Calibration Placements", "id": "aae24a47e36110000a37dd177601000e" } }
GET /dataSources/{ID}/fields
Returns the fields of a specific data source for use in a WQL query. The request also returns the related business object for each field.
Syntax:
{baseURL}/dataSources/‹datasource_wid›/fields
Example query:
{baseURL}/datasources/aae24a47e36110000a37dcb7628d000d/fields
Example JSON response:
{ "total": 2967, "data": [ { "id": "09d50672a44001ea5d41efcfd6419a00", "descriptor": "Trended Worker Org for Cost Center_Current_QA (tenant setup)", "alias": "cf_TrendedWorkerOrgForCostCenter_Current_QATenantSetup", "type": "Single instance", "relatedBusinessObject": { "descriptor": "Position Set", "id": "373872302e7e4afe96aa37c0dd93e53e" } },... ] }
GET /dataSources/{ID}/fields/{subresourceID}
Returns details for a particular field when the ID for the field is specified as the
{subresourceID}
. The request also returns the related business object for each field. Syntax:
{baseURL}/dataSources/‹datasource_wid›/fields/{subresourceID}
Example query:
{baseURL}/dataSources/7884e9fbf68c10000b2b632e6e0100f1/fields/bb4ed38524451000419c823f09ba1587
Example JSON response:
{ "id": "bb4ed38524451000419c823f09ba1587", "descriptor": "ACA IRS 1094-C Reporting - ~Worker~ Included in Full Time Count for September", "type": "Boolean", "alias": "ACAIRS1094_CReporting_WorkerIncludedInFullTimeCountForSeptember", "requiredParameters": [ { "alias": "yearForIRSReporting", "label": "Year", "type": "Single Instance" }, { "type": "Single Instance", "alias": "companyWith1094_CCountDataAvailableForYearSelection", "label": "Company with 1094-c Count Data Available for Year Selection" } ], "optionalParameters": [ { "type": "Single Instance", "alias": "month", "label": "Month" } ] }
GET /dataSources/{ID}/dataSourceFilters
Returns the data source filters for a specific data source for use in a WQL query.
Syntax:
{baseURL}/dataSources/‹datasource_wid›/dataSourceFilters
Example query:
{baseURL}/dataSources/6d34556ff015100012a60a4bb1ce0b92/dataSourceFilters
Example JSON response:
{ "total": 6, "data": [ { "id": "432abca0a751100008144ff171b8000a", "descriptor": "Student Applications for Admissions Cohort Finalize Decisions", "alias": "studentApplicationsForAdmissionsCohortFinalizeDecisions", "optionalParameters": [ { "type": "Single Instance", "description": "The Application Grouping for this Student Application.", "alias": "applicationGrouping" } ], "description": "Return Applications that are valid for Publication with this Cohort\n- has an Admissions Decision\n- Decisions Published Status is Confidential - For Internal Use Only\n- No Inactive Status" }, ... ] }