---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps]
keyword: [Extend, Workday Query Language, WQL]
nav: wcp_docs
parent_url: /wcp_docs/
title: >- 
  Reference: WQL REST API
layout: subsection
---

<a id="d522e486"></a>
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.


You can use the information from the response to construct a WQL request in:

-   The `query` parameter of the `GET /data` endpoint.
-   The request body of the `POST /data` endpoint.


Before you construct your request, you can make calls with the `GET /dataSources/` and `GET /dataSources/{ID}` endpoints to verify the correct alias names to use.

See [Reference: WQL Aliases](/wcp_docs/ktw1644956621314.html).

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.

<table><thead><tr><th><b>WQL Request Source</b></th><th><b>Base URL to Use</b></th></tr></thead><tbody><tr><td>Workday tenanted host</td><td><code>https://{hostname}/api/wql/{version}/{tenant}</code></td></tr><tr><td>WCP API Gateway</td><td><code>https://api.workday.com/wql/{version}</code></td></tr></tbody></table><br/>

## <a id="d522e585"></a>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
```

## <a id="d522e627"></a>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"
    },
    ...
]
}
```

## <a id="d522e664"></a>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"
    },
  ……
  ]
}
 
```

## <a id="d522e716"></a>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"
  }
}
 
```

## <a id="d522e745"></a>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"
     }
   },...
 ]
}
```

## <a id="d522e773"></a>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"
    }
  ]
}
 
```

## <a id="d522e804"></a>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"
    },
    ...
]
}
```

### Related Information

[Concept: Workday Query Language (WQL)](/wcp_docs/GUID-6546152a-bcf0-447d-8d64-230f9e2ac291-enHYPHENus.html)

[Reference: Workday Extend API Gateways and Authorization Base URLs](/wcp_docs/dlh1653340161856.html)

[Administrator Guide: Register API Clients for Integrations](https://doc.workday.com/access/sources/dita/topic?wd:docset=adminguide&ft:locale=en-US&resourceid=dan1370797831458)

