Business Unit

Last updated: 15 Nov 2024

Integrate with PageUp's Core HR Business Unit API with your HRIS to create, update and archive Business Unit Level records.


Contents

  1. Overview
  2. Requesting API Credentials
  3. Before you begin
  4. Examples
  5. Validation Messages
  6. Error Messages
  7. URL format
  8. Postman Collection

Overview

The Core HR Business Unit API allows you to manipulate business units. The purpose of this API is to provide an endpoint for the consumers to insert a new business unit or update an existing one. The Business Unit API allows for:

  • Creating a record for a new business unit in the system.
  • Updating a record for an existing business unit in the system.
  • Archiving a record for an existing business unit in the system.

Requesting API Credentials

For information on how to obtain API credentials and to start integrating with the Core HR API, please visit the Getting started page.


Before you begin

To begin using any of the Core HR APIs, there are a few things that you will need:

  1. Authentication credentials for the particular PageUp Customer/Client
  2. You will need a valid (oAuth)JWT token to authorize yourself to access the end points in this API. When requesting the bearer token with the authentication service please ensure you include the scope Public.HrCore.Write in the authentication request. Multiple scopes may be requested by specifying them as space separated list. The available scope for the endpoints in this page is
    Public.HrCore.Write
    

Technical

  • API's are secured using oAuth (client credentials grant flow)
  • Integrators must handle common errors and support surfacing of error messages back to the user when a request is not successful
  • Integrators must log all relevant errors and be able to provide a copy to PageUp to assist with troubleshooting when required
Notes:
  • Client ID and Client secret will be different per environment (i.e. UAT and LIVE)
  • The oAuth token has an expiry period of 300 seconds.

Monitoring

  • Integrators must have in place monitoring processes to alert on failed requests, updates, retries or any other mechanisms.

Examples

Here are some examples on how to create and update Business Units using the Core HR Business Unit API. Please note that the Business Unit Level ID (externalId) field is mandatory for all requests, however there are certain fields that are mandatory based on the action that you are trying to perform. More details on these fields are available in the following sections.


Creating a Business Unit

To create a business unit level record, follow the example provided below. The fields that are required to create a business unit level record are externalId and name. Additionally, if the business unit record being created is for:

  • level 2, then level1ExternalId field is required
  • level 3, then level2ExternalId field is required
  • level 4, then level3ExternalId field is required

Other fields provided in the example below are optional. The consumer will be provided with a validation message in response if there are any required fields missing. For a full list of what fields are available and to also view details on requests and all types of responses, please refer to the API specifications below.

Request

PUT /hrcore/business-unit/level1
{
  "externalId": "BRAN01",
  "name": "Human Resources",
  "archive": "false"
}

Updating a Business Unit

To update a business unit record, follow the example provided below. The fields that are required to update a business unit are externalId and at least one additional field that needs to be updated. Other fields provided in the example below are optional. The consumer will be provided with a validation message in response if there are any required fields missing. If any of the fields are not provided they will not be modified however if you intend to delete a field from the record then pass that field as a null value this will trigger the field to be removed from the system. For a full list of what fields are available and to also view details on requests and all types of responses, please refer to the API specifications below.

Request

PUT /hrcore/business-unit/level1
PUT /hrcore/business-unit/level2
PUT /hrcore/business-unit/level3
PUT /hrcore/business-unit/level4
{
  "externalId": "DEP04",
  "name": "Sales",
  "archive": "false"
}

Archiving a Business Unit

To archive a business unit, follow the example provided below. The fields that are required to archive a business unit are externalId and archive. The consumer will be provided with a validation message in response if there are any required fields missing. If a business unit record is referenced by a lower level business unit record, it cannot be archived. For a full list of what fields are available and to also view details on requests and all types of responses, please refer to the API specifications below.

Request

PUT /hrcore/business-unit/level1
PUT /hrcore/business-unit/level2
PUT /hrcore/business-unit/level3
PUT /hrcore/business-unit/level4
{
  "externalId": "DEP04",
  "archive": true
}

Validation messages

When integrating with the Core HR API, you may receive validation messages in your responses. Each specific Core HR API resource documents the list of validation messages you may receive and what they mean.


Error messages

In addition to validation messages, you may also receive generic HTTP Status code error messages in your responses. Information on these error messages can be found on our Error handling page.


URL format

Root url:
https://<environment>.<dataCentreId>.pageuppeople.com/v3/<tenantId>/hrcore/...
Where
  environment = specify 'api' for production or 'apiuat' for development or testing
  dataCentreId = the data centre to connect to (e.g. dc2)
  tenantId = the organisation's tenant Id (e.g. 218)
Region dataCentreId
AUS dc2
UK / EMEA dc3
US dc4
SEA dc5

Please contact PageUp representative to find out the data centre and organisation's tenant Id if not known.

Example - connect to the 218 production environment on dc2

https://api.dc2.pageuppeople.com/v3/218/hrcore/business-unit/level1

Example - connect to the 218 development or testing environment on dc2

https://apiuat.dc2.pageuppeople.com/v3/218/hrcore/business-unit/level1

Postman Collection

The Postman collection is available publicly (Core HR API > Business Unit API): Business Unit API

Run in Postman