参考: WQL REST API
WQL REST APIを使用して以下を返します。
- データ ソースとデータ ソースフィルタのリスト。
- 特定のデータ ソースの詳細。
- 特定のデータ ソースの主ビジネス オブジェクト。
- データ ソースのフィールド。
- 特定のフィールドの関連ビジネス オブジェクト。
- -queryのパラメータGET /dataエンドポイント
- のリクエスト本文POST /dataエンドポイント
GET /dataSources/
およびGET /dataSources/{ID}
エンドポイントの使用が正しいエイリアスを確認してください。
を参照参考: WQL エイリアス-
テナントホストとWorkdayクラウド プラットフォーム (WCP) API Gateway の両方が WQL リクエストをサポートしています。WQL リクエストを行う場所によって、使用する基本 URL は異なります。
WQL リクエスト ソース
| 使用する基本 URL
|
|---|---|
Workdayテナントホスト | https://{hostname}/api/wql/{version}/{tenant}
|
WCP API Gateway | https://api.workday.com/wql/{version}
|
GET /data
WQL クエリーからデータを返します。このリクエストは、2,048 文字未満のクエリーに使用します。セキュリティ アクセス権があるデータのみを表示できます。 WQL を実行する。
query
パラメータ。構文:
{baseURL}/data?query={myquery}
クエリーの例:
{baseURL}/data?query=SELECT location, max(yearsOfService) FROM allWorkers GROUP BY location
例JSON回答:
{ "total": 152, "data": [ { "location": { "descriptor": "Academic Location WATS 1", "id": "5403216f5ef810381796f3bb216504f5" }, "max(yearsOfService)": "20" }, ... ] }
Workdayされている WQL クエリーの結果は 30 分後にクリアされます。キャッシュを手動でクリアするには、次のようにしてください:
offset=0
をクエリーに使用します。例:{baseURL}/data?offset=0&query=SELECT firstName, location FROM allWorkers
POST /data
WQL クエリーからデータを返します。このリクエストは、2,048 文字から 16,000 文字までのクエリーに使用します。 セキュリティ アクセス権があるデータのみを表示できます。 WQL を実行する。
query
パラメータ。を配置query
API呼び出しのリクエスト本文に、パラメータとクエリーを含めます。構文:
{baseURL}/data/
リクエスト本文の例:
{ "query" : "SELECT location, max(yearsOfService) FROM allWorkers GROUP BY location" }
例JSON回答:
{ "total": 152, "data": [ { "location": { "descriptor": "Academic Location WATS 1", "id": "5403216f5ef810381796f3bb216504f5" }, "max(yearsOfService)": "20" }, ... ] }
GET /dataSources
以下を返します。
- WQL クエリーで使用するデータ ソースのコレクション。
- データ ソースの主ビジネス オブジェクト。
- データ ソースのインデックス情報。
構文:
{baseURL}/dataSources/
クエリーの例:
{baseURL}/dataSources
例JSON回答:
{ "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" }, …… ] }
オプションフィルタ"" を使用したサンプル クエリー。フィルタ"SourceIndexType" = "インデックス付き" が使用されている場合、インデックス付きデータ ソースを返します。
{baseURL}/dataSources?SourceIndexType=Indexed
例JSON回答:
{ "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}
WQL クエリーで使用する、指定された ID のデータ ソースを返します。このリクエストでは、データ ソース ""の主ビジネス オブジェクト ""も返されます。
構文:
{baseURL}/dataSources/‹datasource_wid›
クエリーの例:
{baseURL}/dataSources/aae24a47e36110000a37dcb7628d000d
例JSON回答:
{ "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
WQL クエリーで使用する特定のデータ ソースのフィールドを返します。このリクエストでは、各フィールドの関連ビジネス オブジェクトも返されます。
構文:
{baseURL}/dataSources/‹datasource_wid›/fields
クエリーの例:
{baseURL}/datasources/aae24a47e36110000a37dcb7628d000d/fields
例JSON回答:
{ "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}
特定のフィールドの ID が次のように指定されている場合に、そのフィールドの詳細を返します。
{subresourceID}
-このリクエストでは、各フィールドの関連ビジネス オブジェクトも返されます。構文:
{baseURL}/dataSources/‹datasource_wid›/fields/{subresourceID}
クエリーの例:
{baseURL}/dataSources/7884e9fbf68c10000b2b632e6e0100f1/fields/bb4ed38524451000419c823f09ba1587
例JSON回答:
{ "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}/dataSourceFiles
WQL クエリーで使用する特定のデータ ソースのデータ ソースフィルタを返します。
構文:
{baseURL}/dataSources/‹datasource_wid›/dataSourceFilters
クエリーの例:
{baseURL}/dataSources/6d34556ff015100012a60a4bb1ce0b92/dataSourceFilters
例JSON回答:
{ "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" }, ... ] }