Employee-based queries

This topic explains how to create requests for basic employee-based information using the Retrieve Data operation.

Example requests are POSTed to the Retrieve Data URL:
https://<<hostName>>/api/v1/commons/data/multi_read

Retrieve Data operations aggregate data from across the suite using the Data Dictionary data elements defined in the request. Each response provides metadata that allows for caching and paging, which is covered in detail in the Cache, count, and index topic.

Prerequisites

Understand the concepts in the following topic:

  1. The Data Dictionary

Example request

In this example, the request:

  • retrieves employee names and the names of their supervisors using The Data Dictionary keys
  • defines the data view as EMP for employee, which is similar to an Employee Dataview
  • selects the set of employees using a Hyperfind query
  • establishes a date range for the requested data in the form of a symbolic period
{
  "select": [
    {
      "key": "EMP_COMMON_FULL_NAME"
    },
    {
      "key": "PEOPLE_MANAGER_NAME"
    }
  ],
  "from": {
    "view": "EMP",
    "employeeSet": {
      "hyperfind": {
        "qualifier": "All Home"
      },
      "dateRange": {
        "symbolicPeriod": {
          "qualifier": "Current_Payperiod"
        }
      }
    }
  }
}

Notes of interest

  • Use qualifiers instead of IDs when your object references point to gold data. Gold data consists of queries, Dataviews, reports, and other such entities that are included with your tenant and are not changeable.
  • Refer to the Resource Details of the Retrieve Data POST /v1/commons/data/multi_read operation for descriptions of each object, array, and property.

Example response

The request defined a set of employees and retrieved their names and the names of their supervisors using the Data Dictionary keys EMP_COMMON_FULL_NAME and PEOPLE_MANAGER_NAME.

    {
    "metadata": {
        "lastRefreshed": null,
        "cacheExpirationTime": null,
        "numNodes": "8",
        "metadataKey": "df063aee-17da-4575-a0c4-7c325c183edd",
        "cacheKey": "8b080708-4452-41d0-80bd-5a2644085b9c",
        "totalNodes": "8",
        "totalElements": "8"
    },
    "data": {
        "key": {
            "ROOT": "-1"
        },
        "coreEntityKey": {},
        "attributes": [],
        "children": [
            {
                "key": {
                    "PEOPLE": "208"
                },
                "coreEntityKey": {
                    "EMP": {
                        "id": "208"
                    }
                },
                "attributes": [
                    {
                        "key": "PEOPLE_MANAGER_NAME",
                        "rawValue": "Russel, Beverly",
                        "value": "Russel, Beverly"
                    },
                    {
                        "key": "EMP_COMMON_FULL_NAME",
                        "rawValue": "Leavitt, Caitlin",
                        "value": "Leavitt, Caitlin"
                    }
                ],
                "children": [],
                "summaryListDisplay": [],
                "rootEntity": "PEOPLE",
                "customProperties": {}
            },
            ...
            ]
        }
    }

Next steps

Proceed to the Location-based queries topic.