NextGen APIs

POST /integration/workforce/r1/work-shift-exceptions

Http Verb

POST

Url

/integration/workforce/r1/work-shift-exceptions

Permissions required

Core Additional Parameters: Edit (fsm.core.additionalparameter.edit)

Resource Configuration: View (fsm.core.resource.configuration.view)

Last Modified Version

r1

Tech Tags


Available Async

No

BPMN Diagram

diagram (14).svg

Business Logic

This Integration API creates in batch Work Shift Exception records associating them to the Resource retrieved by the identificationNumber in input.

The Private API Suite mandates the verification of OverITs’ software license and the required user permissions. Each call initiated by the Integration API will activate both validations. Only upon successful completion of these validations can the business processes commence.

STEP 1 - External System Validation

System takes Input fields and checks their existence in internal configuration.

API Verb: GET

Resource: External Systems

Input: externalSystemCode, active=true

Output: externalSystemId

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 2 - Public Holidays Retrieval

System takes Input fields as QueryStringParameters and returns a list of holidays.

API Verb: GET

Resource: Public Holidays

Input: startDate, andDate

Output: holidayList

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

  • Others - see link in Resource

STEP 3 - Resource Retrieval

System takes Input fields and extract the Resource filtered by identificationNumber.

API Verb: GET

Resource: Resource

Input: identificationNumber, loan=false

Output: resourceId

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 4 - Work Shift Exception Type Retrieval

System takes Input field and extract the Work Shift Exception Type id.

API Verb: GET

Resource: Work Shift Exceptions Types

Input: typeCode, active=true

Output: workShiftExceptionTypeId

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 5 - Work Shift Exceptions Creation

All dates included in startDate-endDate temporal range are extracted and for each, if the single item is not included in the holidayList, a WorkShiftException Object is added to the workShiftExceptionList.

System takes workShiftExceptionList in input and create all records in it.

API Verb: POST

Resource: Work Shift Exceptions Batch Creation

Input: List of: startDate, endDate, resourceId, workShiftExceptionTypeId

Output: workShiftExceptionIdList

If Creation outcome is SUCCESS → elaboration is stopped. See Response payload fields.

If Creation outcome is ERROR → elaboration is stopped. See Response payload fields.

Error Type:

  • Others - see link in Resource

Path Parameters

Not present.

Query String Parameters

Start with a ? and includes parameters listed one after the another separated by &.

Not applicable.

Header Parameters

Parameters included in the request headers. Generally, request headers are used to keep authorization parameters.

Default.

Request Body Parameters

Request body parameters are used when clients send data to the API. They are shipped in a JSON Object only in POST, PUT, or PATCH requests.

Field

Description

Mandatory

Constraint

1

externalSystemCode

External system code

Y

Not Blank

2

identificationNumber

Resource’s Identification Number

Y

Not Blank

3

typeCode

Work Shift Exception Type Code

Y

Not Blank

4

startDate

Work Shift Exception Start Date

Y

Not Null

5

endDate

Work Shift Exception End Date

Y

Not Null

6

note

Note

N


The objects in input could have also the extension object that allows to add additional, customized data to this API. More info here How to use APIs: Custom data via Extension.

Request example

JSON
{
    "extension": {
        "myFieldName": "myValue"
    },
    "externalSystemCode": "string",
    "identificationNumber": "string",
    "typeCode": "string",
    "startDate": "2024-04-17T12:43:37.858Z",
    "endDate": "2024-04-17T12:43:37.858Z",
    "note":"string"
}

Response documentation

Response payload fields

Compliant with RFC Standard https://www.rfc-editor.org/rfc/rfc9457.html

Extension fields:

Field

Description

Note

List of id

Work Shift Exceptions id list

Only for SUCCESS

code

Extension member of a Problem Details Object that contains the error code

Only for ERROR

Response example

Error example

JSON
{
  "type": "about:blank",
  "title": "Not Found",
  "status": 404,
  "detail": "External system string does not exist",
  "instance": "/integration/workforce/r1/work-shift-exceptions",
  "code": "IA001_001"
}

Response error codes