Get work schedules

get

/rest/ofscCore/v1/resources/{resourceId}/workSchedules

This operation retrieves the list of work schedules assigned to the specified resource.

Work schedules represent a resource's work calendar, which includes working hours, working and non-working days, reasons for absence, and so on.

Note: This operation does not return work schedules configured for parent resources.

Request

Path Parameters
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation.
Body ()
Root Schema : Work schedules
Type: object
Title: Work schedules
The collection of work schedule items.
Show Source
Nested Schema : Items
Type: array
Title: Items
An array of work schedule items.
Show Source
Nested Schema : Resource Work Schedule Item
Type: object
Title: Resource Work Schedule Item
The array of work schedule item of the resource.
Show Source
  • Title: Comments
    The description of the schedule in Oracle Field Service.
  • Title: End Date
    The date when this schedule ends. The date is in 'YYYY-MM-DD' format.
  • Title: Is Working Shift
    Contains one of the following values: true or false. If true, then it is a working day. If false, then it is a non-working day.

    This is a read-only field calculated based on the record type or the shift settings.

  • Title: Non-working Reason
    The reason for the non-working day (for example, holiday, vacation). These reasons are preconfigured in the Oracle Field Service UI.
  • Title: Points
    The units of labor per day when this schedule is in effect. This property may be empty because all the customers may not use it.
  • Title: Record Type
    Allowed Values: [ "schedule", "shift", "extra_shift", "working", "extra_working", "non-working" ]
    The type of work schedule record.
  • Recurrence
    Title: Recurrence
    An array containing recurring work schedule items. This object is optional when the recordType is schedule. And it is mandatory when the recordType is shift, extra_shift, working, extra_working or non-working
  • Title: Work Schedule Item ID
    The identifier of the work schedule item in Oracle Field Service.
  • Title: Work Schedule Label
    The label of the work schedule in Oracle Field Service. This property is only available if the record type is schedule.
  • Shifts
    Title: Shifts
    The list of work shifts present in this work schedule. The properties of the work shifts are for information purpose only and cannot be modified using this operation.
  • Title: Work Shift Label
    The label of the work shift in Oracle Field Service. This property is only available if the value of recordType is either shift or extra_shift.
  • Title: Shift Type
    Allowed Values: [ "regular", "on-call" ]
    The type of the work shift.
  • Title: Start Date
    The date when this schedule takes effect. The format is 'YYYY-MM-DD'.
  • Title: Work Time End
    The end time of the working day when this schedule is in effect. The format is 'HH:MM'. This property is not available if the value of the isWorking parameter is false.
  • Title: Work Time Start
    The start time of the working day when this schedule is in effect. The format is 'HH:MM'. This property is not available if the value of the isWorking parameter is false.
Nested Schema : Recurrence
Type: object
Title: Recurrence
An array containing recurring work schedule items. This object is optional when the recordType is schedule. And it is mandatory when the recordType is shift, extra_shift, working, extra_working or non-working
Show Source
  • Title: Day From
    The start day (in 'YYYY-MM-DD' format) of the schedule period applicable for each year, when the schedule is in effect. It is used only if the recurrence type is yearly.
  • Title: Day To
    The end day (in 'YYYY-MM-DD' format) of the schedule period applicable for each year, when the schedule is in effect. It is used only if the recurrence type is yearly.
  • Title: Recur Every
    Minimum Value: 1
    Maximum Value: 255
    The time between each recurrence of the work schedule. Depending on the value selected for 'recurrence', the value of the parameter indicates the time between recurrence in days or weeks. For example, if '4' is the value of this parameter, and the 'recurrence' is 'daily', it indicates that the time between each recurrence is four days.
  • Title: Recurrence Type
    Allowed Values: [ "daily", "weekly", "yearly", "everyday" ]
    The type of the recurrence. This property along with the 'recurEvery' property defines the time between each recurrence. For example, if the value of this property is 'daily' and the value of the property 'recurEvery' is '4', then the time between each recurrence is four days.
  • Recurrence Weekdays
    Title: Recurrence Weekdays
    The weekdays on which the work shift recurs.
Nested Schema : Shifts
Type: array
Title: Shifts
The list of work shifts present in this work schedule. The properties of the work shifts are for information purpose only and cannot be modified using this operation.
Show Source
Nested Schema : Recurrence Weekdays
Type: array
Title: Recurrence Weekdays
The weekdays on which the work shift recurs.
Show Source
  • Title: Weekday
    Allowed Values: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]
    The weekday on which the work shift recurs. This field is required only if the recurrence type is weekly.
Nested Schema : Resource Shift Item
Type: object
Title: Resource Shift Item
An object containing the resource shift item.
Show Source
  • Title: Comments
    The description of this shift in Oracle Field Service.
  • Title: End Date
    The date when this shift ends. The date is in 'YYYY-MM-DD' format.
  • Title: Is Working Shift
    Contains one of the following values: true or false. If true, then it is a working day. If false, then it is a non-working day.

    This is a read-only field calculated based on the record type or the shift settings.

  • Title: Non-working Reason
    The reason for the non-working day (for example, holiday, vacation). These reasons are preconfigured in the Oracle Field Service UI.
  • Title: Points
    The units of labor per day when this schedule is in effect. This property may be empty because all the customers may not use it.
  • Title: Record Type
    Allowed Values: [ "shift", "extra_shift" ]
    The type of the work shift record.
  • Recurrence
    Title: Recurrence
    An array containing recurring work schedule items. For repeating shifts this property contains a description of how the shift repeats over time.
  • Title: Work Schedule Item ID
    The identifier of the work schedule item in Oracle Field Service.
  • Title: Work Schedule Label
    The label of the work schedule in Oracle Field Service. This property is only available for the record type schedule.
  • Title: Work Shift Label
    The label of the work shift in Oracle Field Service. This property is only available if the record type is either shift or extra_shift.
  • Title: Shift Type
    Allowed Values: [ "regular", "on-call" ]
    The type of the work shift.
  • Title: Start Date
    The date when this shift takes effect. The date is in 'YYYY-MM-DD'.
  • Title: Work Time End
    The end time of a working day when this work shift is in effect. The format is HH:MM. This property is not available if the value of the isWorking parameter is false.
  • Title: Work Time Start
    The start time of a working day when this work shift is in effect. The format is HH:MM. This property is not available if the value of the isWorking parameter is false.
Nested Schema : Recurrence
Type: object
Title: Recurrence
An array containing recurring work schedule items. For repeating shifts this property contains a description of how the shift repeats over time.
Show Source
  • Title: Day From
    The start day (in 'YYYY-MM-DD' format) of the schedule period applicable for each year, when the schedule is in effect. It is used only if the recurrence type is yearly.
  • Title: Day To
    The end day (in 'YYYY-MM-DD' format) of the schedule period applicable for each year, when the schedule is in effect. It is used only if the recurrence type is yearly.
  • Title: Recur Every
    Minimum Value: 1
    Maximum Value: 255
    The time between each recurrence of the work shift. Depending on the value selected for 'recurrence', the value of the parameter indicates the time between recurrence in days or weeks. For example, if '4' is the value of this parameter, and the 'recurrence' is 'daily', it indicates that the time between each recurrence is four days.
  • Title: Recurrence Type
    Allowed Values: [ "daily", "weekly", "yearly", "everyday" ]
    The type of the recurrence. This property along with the 'recurEvery' property defines the time between each recurrence. For example, if the value of this property is 'daily' and the value of the property 'recurEvery' is '4', then the time between each recurrence is four days.
  • Recurrence Weekdays
    Title: Recurrence Weekdays
    The weekdays on which the work schedule recurs.
Nested Schema : Recurrence Weekdays
Type: array
Title: Recurrence Weekdays
The weekdays on which the work schedule recurs.
Show Source
  • Title: Weekday
    Allowed Values: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]
    The weekday on which the work schedule recurs.

Default Response

This section describes the default error response for this operation.
Body ()
Root Schema : Error
Type: object
Show Source
Back to Top

Examples

The following example shows how to get work schedules for a resource by submitting a GET request on the REST resource.

Example of Request Header

The following shows an example of the request header.

GET /rest/ofscCore/v1/resources/517736/workSchedules/calendarView?dateFrom=2018-01-03&dateTo=2018-01-03
Authorization: Basic c29hcEB5YW1hdG86MQ==
Host: <instance_name>.fs.ocs.oraclecloud.com
Accept: */*

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Fri, 05 Jan 2018 08:35:48 GMT
Content-Type: application/json; charset=utf-8
Connection: close

Example of Response Body

The following example shows the contents of the response body in JSON format:

{
    "2018-01-03": {
        "regular": {
            "recordType": "working",
            "workTimeStart": "09:00",
            "workTimeEnd": "18:00",
            "shiftLabel": "for_api_testing",
            "scheduleLabel": "9-18"
        },
        "on-call": {
            "recordType": "non-working",
            "nonWorkingReason": "OTHER"
        }
    },
    "links": [
        {
            "rel": "canonical",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/517736/workSchedules/calendarView?dateFrom=2018-01-03&dateTo=2018-01-03"
        },
        {
            "rel": "describedby",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/metadata-catalog/resources"
        }
    ]
}
Back to Top