### Make HTTP GET Request with cURL Source: https://developer.ukg.com/wfm/docs/quick-start-doc Use this cURL command to make an HTTP GET request to retrieve person data. Ensure you replace placeholders like <>, <>, and <>. ```curl curl -X GET \ https://<>/api/v1/commons/persons/<> \ -H 'authorization: <>' \ -H 'content-type: application/json' ``` -------------------------------- ### Make HTTP GET Request with Java OkHttp Source: https://developer.ukg.com/wfm/docs/quick-start-doc This Java code uses the OkHttp library to perform an HTTP GET request for person data. Replace <>, <>, and <> with your actual values. ```java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://<>/api/v1/commons/persons/<>") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "<>") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### Sample JSON Response Body Source: https://developer.ukg.com/wfm/docs/quick-start-doc This is an example of the JSON response body structure you can expect when successfully retrieving person data. ```json { "personIdentity": { "personKey": 210 }, ... ``` -------------------------------- ### Retrieve Person by ID using GET Source: https://developer.ukg.com/wfm/docs/quick-start-doc Use this snippet to fetch a specific person's details by their ID. Ensure you replace placeholder values for hostName and personId. The Authorization header requires a valid access token. ```json { "personIdentity": { "personKey": 210 }, "personInformation": { "accessAssignment": {}, "employmentStatusList": [ { "effectiveDate": "2016-08-13", "employmentStatusName": "Active", "expirationDate": "3000-01-01" } ], "expectedHoursList": [ { "quantity": 8, "timePeriodTypeName": "Daily" }, { "quantity": 40, "timePeriodTypeName": "Weekly" }, { "quantity": 80, "timePeriodTypeName": "Pay Period" } ], ... } ``` -------------------------------- ### Get Person by ID Source: https://developer.ukg.com/wfm/docs/quick-start-doc Retrieves detailed information about a specific person using their unique identifier. ```APIDOC ## GET /api/v1/commons/persons/{personId} ### Description Retrieves detailed information about a specific person using their unique identifier. ### Method GET ### Endpoint /api/v1/commons/persons/{personId} ### Parameters #### Path Parameters - **personId** (string) - Required - The unique identifier of the person to retrieve. #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **personIdentity** (object) - Contains the identity information of the person. - **personKey** (integer) - The internal key for the person. #### Response Example ```json { "personIdentity": { "personKey": 210 } } ``` ``` -------------------------------- ### Generate Access Token Source: https://developer.ukg.com/wfm/docs/quick-start-doc Use this POST request to obtain an OAuth 2.0 access token. Ensure you replace placeholders like <>, <>, <>, <>, and <> with your specific credentials. The `Content-Type` header must be `application/x-www-form-urlencoded`, and the body should also be form-urlencoded. ```HTTP POST https://<>/api/authentication/access_token Content-Type : application/x-www-form-urlencoded username : <> password : <> client_id : <> client_secret : <> grant_type : password auth_chain : OAuthLdapService ``` -------------------------------- ### Retrieve Aggregated Data using POST Source: https://developer.ukg.com/wfm/docs/quick-start-doc This snippet demonstrates how to retrieve aggregated employee data using a POST request. It requires a JSON body specifying the data to select, the source view, and filtering conditions. Replace placeholder values for hostName and ensure a valid access token is provided. ```json { "select": [ {"key": "EMP_COMMON_FULL_NAME"}, {"key": "EMP_COMMON_PRIMARY_JOB"}, {"key": "EMP_COMMON_PRIMARY_ORG"}, {"key": "PEOPLE_HIRE_DATE"} ], "from": { "view": "EMP", "employeeSet": { "hyperfind": { "id": "1" }, "dateRange": { "symbolicPeriod": { "id": 5 } } } }, "where": [ { "key": "EMP_COMMON_PRIMARY_JOB", "operator": "STARTS_WITH", "values": [ "Apprentice" ] } ] } ``` ```json { "metadata": { "lastRefreshed": "2017-10-18T14:45:23.713785328", "numNodes": "39", "metadataKey": "ce1ed033-3ccb-4d61-90c6-abd49de4eca0", "cacheKey": "ce1ed033-3ccb-4d61-90c6-abd49de4eca0", "totalNodes": "39", "totalElements": "39" }, "data": { "key": { "ROOT": "-1" }, "coreEntityKey": {}, "attributes": [], "children": [ { "key": { "PEOPLE": "91" }, "coreEntityKey": { "EMP": { "id": "91" } }, ... } ``` -------------------------------- ### Retrieve Person by ID Source: https://developer.ukg.com/wfm/docs/quick-start-doc Retrieves detailed information about a specific person using their unique ID. This operation is useful for fetching individual employee records. ```APIDOC ## GET /api/v1/commons/persons/{personId} ### Description Retrieves a person's record by their unique identifier. ### Method GET ### Endpoint /api/v1/commons/persons/{personId} ### Parameters #### Path Parameters - **personId** (string) - Required - The unique identifier of the person to retrieve. #### Headers - **content-type** (string) - Required - application/json - **Authorization** (string) - Required - Bearer <> ### Request Example ```json { "example": "Request to retrieve person data" } ``` ### Response #### Success Response (200) - **personIdentity** (object) - Contains the person's key. - **personInformation** (object) - Contains various details about the person, including employment status and expected hours. #### Response Example ```json { "personIdentity": { "personKey": 210 }, "personInformation": { "employmentStatusList": [ { "effectiveDate": "2016-08-13", "employmentStatusName": "Active", "expirationDate": "3000-01-01" } ], "expectedHoursList": [ { "quantity": 8, "timePeriodTypeName": "Daily" }, { "quantity": 40, "timePeriodTypeName": "Weekly" }, { "quantity": 80, "timePeriodTypeName": "Pay Period" } ] } } ``` ``` -------------------------------- ### Retrieve Aggregated Data Source: https://developer.ukg.com/wfm/docs/quick-start-doc Retrieves aggregated data based on specified criteria, allowing for complex queries across different data views. This is useful for reporting and analytics. ```APIDOC ## POST /api/v1/commons/data/multi_read ### Description Retrieves aggregated data based on a JSON query body. ### Method POST ### Endpoint /api/v1/commons/data/multi_read ### Parameters #### Request Body - **select** (array) - Required - An array of objects specifying the fields to select. - **from** (object) - Required - Defines the data source, including view and employee set. - **where** (array) - Optional - An array of conditions to filter the data. ### Request Example ```json { "select": [ {"key": "EMP_COMMON_FULL_NAME"}, {"key": "EMP_COMMON_PRIMARY_JOB"}, {"key": "EMP_COMMON_PRIMARY_ORG"}, {"key": "PEOPLE_HIRE_DATE"} ], "from": { "view": "EMP", "employeeSet": { "hyperfind": { "id": "1" }, "dateRange": { "symbolicPeriod": { "id": 5 } } } }, "where": [ { "key": "EMP_COMMON_PRIMARY_JOB", "operator": "STARTS_WITH", "values": [ "Apprentice" ] } ] } ``` ### Response #### Success Response (200) - **metadata** (object) - Contains metadata about the response, such as refresh time and node counts. - **data** (object) - Contains the actual aggregated data, structured with core entities and attributes. #### Response Example ```json { "metadata": { "lastRefreshed": "2017-10-18T14:45:23.713785328", "numNodes": "39", "metadataKey": "ce1ed033-3ccb-4d61-90c6-abd49de4eca0", "cacheKey": "ce1ed033-3ccb-4d61-90c6-abd49de4eca0", "totalNodes": "39", "totalElements": "39" }, "data": { "key": { "ROOT": "-1" }, "coreEntityKey": {}, "attributes": [], "children": [ { "key": { "PEOPLE": "91" }, "coreEntityKey": { "EMP": { "id": "91" } } } ] } } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.