NextGen APIs

GET /integration/workforce/r1/timesheets/resources-calendars

Http Verb

GET

Url

/integration/workforce/r1/timesheets/resources-calendars

Permissions required

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

Organizational Structure Entities: View (fsm.core.structure.view)

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

WO Configuration: View (fsm.core.workorder.configuration.view)

Last Modified Version

r1

Tech Tags


Available Async

No

BPMN Diagram

diagram (20).svg

Business Logic

This Integration API returns a list of resource calendar within a specific time range.

The system checks that the date range in the filter object calendarDate does not exceed 7 days and that both the from and to values ​​are filled in.

One of operationCenterCode or identificationNumber/secondaryIdentificationNumber must be present.

System will return only work shift or work shift exceptions related to active Operations Center.

System verifies Permission Required and starts the elaboration that is organized in steps.

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 - Operation Center Validation and Retrieve

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

This step is skipped if operationCenterCode is absent

API Verb: GET

Resource: Operation Centers

Input: operationCenterCode, active=true, _language

Output: operationCenterId, operationCenterDescription

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 3 - Resource Retrieve

System takes Input fields and checks their existence.

This section is used only if input fields identificationNumber and/or secondaryIdentificationNumber are present

STEP 3a - Resource Retrieve

API Verb: GET

Resource: Resources

Input: identificationNumber, secondaryIdentificationNumber, _order

Output: resourceId, name, surname, email, mobilePhone, identificationNumber, secondaryIdentificationNumber, operationCenterId, workCenterId, extension

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

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

Error Type:

  • Others - see link in Resource

STEP 3b - Operation Center Retrieve

System takes Input fields and retrieve output values.

This step is skipped if operationCenterCode is present

API Verb: GET

Resource: Operation Centers

Input: list of [operationCenterId]active = true

Output: list of [operationCenterDescription]

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 3c - Work Shift Retrieve

System takes Input fields and checks their existence.

API Verb: GET

Resource: Work Shifts

Input: resourceId, operationCenterId, resourceWorkshift

Output: workShiftId, startDate, endDate, breakStart, breakEnd, note, typeId

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

If System can’t obtain the Output fields → continue to step Work Shift Exceptions Retrieve.

Error Type:

  • Others - see link in Resource

STEP 3c - Work Shift Types Retrieve

System takes Input fields and checks their existence.

This step is skipped if input fields are absent.

API Verb: GET

Resource: Work Shift Types

Input: list of typeId

Output: list of workShiftTypeCode, workShiftTypeDescription

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 3d - Work Shift Exceptions Retrieve

System takes Input fields and checks their existence.

API Verb: GET

Resource: Work Shift Exceptions

Input: resourceId, _language

Output: workShiftExceptionId, startDate, endDate, workShiftExceptionTypeId

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

If System can’t obtain the Output fields → continue to step Work Center Retrieve.

Error Type:

  • Others - see link in Resource

STEP 3e - Work Shift Exception Types Retrieve

System takes Input fields and checks their existence.

This step is skipped if input fields are absent.

API Verb: GET

Resource: Work Shift Exception Types

Input: list of workShiftExceptionTypeId

Output: list of workShiftExceptionTypeCode, workShiftExceptionTypeDescription

If System can obtain the Output fields → continue to step Work Center Retrieve.

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

Error Type:

  • Others - see link in Resource

STEP 4 - Work Shift Retrieve

System takes Input fields and checks their existence.

This section is used only if both input fields identificationNumber and secondaryIdentificationNumber are absent.

STEP 4a - Work Shift Retrieve

System takes Input fields and checks their existence.

API Verb: GET

Resource: Work Shifts

Input: startDate.from=calendarDate.from, startDate.to=calendarDate.to, operationCenterId, resourceWorkshift

Output: workShiftId, startDate, endDate, breakStart, breakEnd, note, typeId, resourceId

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

If System can’t obtain the Output fields → continue to step Work Shift Exceptions Retrieve.

STEP 4b - Work Shift Types Retrieve

System takes Input fields and checks their existence.

This step is skipped if input fields are absent.

API Verb: GET

Resource: Work Shift Types

Input: list of workShiftTypeId

Output: list of workShiftTypesCode, workShiftTypesDescription

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 4c - Work Shift Exceptions Retrieve

System takes Input fields and checks their existence.

API Verb: GET

Resource: Work Shift Exceptions

Input: startDate.from=calendarDate.from, startDate.to=calendarDate.to

Output: workShiftExceptionId, startDate, endDate, workShiftExceptionTypeId, resourceId

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

If System can’t obtain the Output fields → continue to step Resources Retrieve.

Error Type:

  • Others - see link in Resource

STEP 4d - Work Shift Exception Types Retrieve

System takes Input fields and checks their existence.

This step is skipped if input fields are absent.

API Verb: GET

Resource: Work Shift Exception Types

Input: workShiftExceptionTypeId

Output: list of workShiftExceptionTypeCode, workShiftExceptionTypeDescription

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 4f - Resources Retrieve

System takes Input fields and checks their existence.

This step is skipped if both Work Shift list and Work Shift Exception list are empty.

API Verb: GET

Resource: Resources

Input: resourceIds, operationCenterId

Output: resources (list of resource objects), resourceIds

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 5 - Work Center Retrieve

System takes Input fields and checks their existence.

API Verb: GET

Resource: Work Centers

Input: workCenterIds, active=true

Output: workCenters

If System can obtain the Output fields → elaboration is stopped. See Response payload fields (it is possible to have in response an empty array)

If System can’t obtain the Output fields → elaboration is stopped. See Response payload fields

Error Type:

  • Others - see link in Resource


Path Parameters

As their name suggests, they are included in the URL path of the endpoint.

Not applicable.

Query String Parameters

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

Filter

Field

Description

Mandatory

Constraint

1

_page

Object for pagination

N

Null or Not Blank

2

_order

Specify a collection of strings representing the desired fields and direction of resources. Inner objects, such as workShifts and unavailabilities will not be ordered.

N

Null or Not Blank

3

_language

Language option for the response. It supports the following values: - ALL: Request the server to return every possible translation of the response data. - USER

N

Null or Not Blank

4

_exclude

Allows to specify a subset of data that need to be excluded from the response

N

Null or Not Blank

5

_fields

Allows to specify a subset of data that need to be returned

N

Null or Not Blank

6

externalSystemCode

External system code

Y

Not Blank

7

operationCenterCode

Work Shift operation center code

N

Null or Not Blank

8

calendarDate

Interval of date (from-to) of resource calendar for filtering

Y

Not Blank

9

identificationNumber

Identification Number of resoruce

N

Null or Not Blank

10

secondaryIdentificationNumber

Alternative Identification Number of resource

N

Null or Not Blank

11

extension

Used to filter for extension

N

Null or Not Blank

12

resourceWorkshift

Flag used to filter only shifts of individual resources, if ‘true’ or to filter only crew shell workshifts, if ‘false’.

Default ‘true’

N


Fields

The parameter _fields allows to choose output fields. More info here How to use APIs: Output fields selection.

Header Parameters

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

Default.

Request Example

{baseUrl}/integration/timeesheets/r1/resources-calendars?externalSystemCode=SAP&identificationNumber=MI0030&calendarDate=from,2024-04-17T00:00:00.000Z,to,2024-04-20T00:00:00.000Z&operationCenterCode=OC61

Response documentation

Response payload fields


Field

Field Type

Description

1


id


Id of resources

2


name


First name of the resource

3


surname


Surname of the resource

4


email


E-mail address of the resource

5


mobilePhone


Phone number of the resource

6


identificationNumber


Identification Number of the resource

7


secondaryIdentificationNumber


Alternative Identification Number of the resource

8


operationCenter

operationCenterObject

Operation Center of the resource

9


workCenter

workCenterObject

Work Center of the resource

10

workShifts

id


Work Shift Id

11

startDate


Work Shift Start Date

12

endDate


Work Shift End Date

13

breakStart


Work Shift Break Start

14

breakEnd


Work Shift Break End

15

note


Work shift note

16

type

workShiftTypeObject

Work Shift Type

17

unavailabilities

id


Work Shift Exception Id

18

startDate


Work Shift Exception start date

19

endDate


Work Shift Exception end date

20

note


Work Shift Exception Note

21

workShiftExceptionType

workShiftExceptionTypeObject

Work Shift Exception Type

operationCenterObject

Field

Description

1

code

Code

2

description

Description

workCenterObject

Field

Description

1

code

Code

2

description

Description

workShiftTypeObject

Field

Description

1

code

Code

2

description

Description

workShiftExceptionTypeObject

Field

Description

1

code

Code

2

description

Description

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

Extension fields:

Field

Description

Note

code

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

Only for ERROR

Response example

{     
  "extension": {},
  "content": [
    {
      "extension": {},
      "id": 3681,
      "name": "John",
      "surname": "Doe",
      "email": "john.doe@example.com",
      "mobilePhone": "+123456789",
      "identificationNumber": "JD3681",
      "identificationNumber2": "JD3681",
      "operationCenter": {
        "extension": {},
        "code": "OC61",
        "description": [
          {
            "lang": "en",
            "value": "Metro OC"
          }
        ]
      },
      "workCenter": {
        "extension": {},
        "code": "WCN61",
        "description": [
          {
            "lang": "en",
            "value": "Metro workCenter"
          }
        ]
      },
      "workShifts": [
        {
          "extension": {},
          "id": 50220,
          "startDate": "2024-10-10T08:00:00Z",
          "endDate": "2024-10-10T17:00:00Z",
          "breakStart": "2024-10-10T12:00:00Z",
          "breakEnd": "2024-10-10T13:00:00Z",
          "note": "note123",
          "type": {
            "code": "REGULAR",
            "description": "Regular"
          }
        },
        {
          "extension": {},
          "id": 50221,
          "startDate": "2024-10-11T08:00:00Z",
          "endDate": "2024-10-11T17:00:00Z",
          "breakStart": "2024-10-11T12:00:00Z",
          "breakEnd": "2024-10-11T13:00:00Z",
          "type": {
            "code": "REGULAR",
            "description": "Regular"
          }
        },
        {    
         "extension": {},
          "id": 54717,
          "startDate": "2024-10-10T22:00:00Z",
          "endDate": "2024-10-11T06:00:00Z",
          "type": {
            "code": "NIGHT",
            "description": "Night"
          }
        }
      ],
      "unavailabilities": [
        {   
          "extension": {},
          "id": 1261,
          "startDate": "2024-10-10T15:00:00Z",
          "endDate": "2024-10-10T16:00:00Z",
          "note": "security training",
          "workShiftExceptionType": {
            "code": "TRN",
            "description": [
              {
                "lang": "en",
                "value": "Training"
              }
            ]
          }
        }
      ]
    }
  ],
  "_page": {
    "num": 0,
    "hasMore": false
  }
}

Error example

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

Response error codes