Get work schedules
/rest/ofscCore/v1/resources/{resourceId}/workSchedules
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
-
resourceId(required): string
The unique identifier of the resource in Oracle Field Service.
-
actualForDate: string(date)
The work schedules that expired before the specified date are not returned. Specify the date in YYYY-MM-DD format.
Response
- application/json
200 Response
object
Work schedules
-
items:
array Items
Title:
Items
An array of work schedule items.
array
Items
-
Array of:
object Resource Work Schedule Item
Title:
Resource Work Schedule Item
The array of work schedule item of the resource.
object
Resource Work Schedule Item
-
comments:
string
Title:
Comments
The description of the schedule in Oracle Field Service. -
endDate:
string(date)
Title:
End Date
The date when this schedule ends. The date is in 'YYYY-MM-DD' format. -
isWorking:
boolean
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.
-
nonWorkingReason:
string
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. -
points:
integer
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. -
recordType(required):
string
Title:
Record Type
Allowed Values:[ "schedule", "shift", "extra_shift", "working", "extra_working", "non-working" ]
The type of work schedule record. -
recurrence:
object 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 -
scheduleItemId:
integer
Title:
Work Schedule Item ID
The identifier of the work schedule item in Oracle Field Service. -
scheduleLabel:
string
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. -
scheduleShifts:
array 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. -
shiftLabel:
string
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. -
shiftType:
string
Title:
Shift Type
Allowed Values:[ "regular", "on-call" ]
The type of the work shift. -
startDate(required):
string(date)
Title:
Start Date
The date when this schedule takes effect. The format is 'YYYY-MM-DD'. -
workTimeEnd:
string(time)
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. -
workTimeStart:
string(time)
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.
object
Recurrence
-
dayFrom:
string
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. -
dayTo:
string
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. -
recurEvery:
integer
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. -
recurrenceType(required):
string
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. -
weekdays:
array Recurrence Weekdays
Title:
Recurrence Weekdays
The weekdays on which the work shift recurs.
array
Shifts
-
Array of:
object Resource Shift Item
Title:
Resource Shift Item
An object containing the resource shift item.
array
Recurrence Weekdays
-
Array of:
string
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.
object
Resource Shift Item
-
comments:
string
Title:
Comments
The description of this shift in Oracle Field Service. -
endDate:
string(date)
Title:
End Date
The date when this shift ends. The date is in 'YYYY-MM-DD' format. -
isWorking:
boolean
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.
-
nonWorkingReason:
string
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. -
points:
integer
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. -
recordType:
string
Title:
Record Type
Allowed Values:[ "shift", "extra_shift" ]
The type of the work shift record. -
recurrence:
object 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. -
scheduleItemId:
integer
Title:
Work Schedule Item ID
The identifier of the work schedule item in Oracle Field Service. -
scheduleLabel:
string
Title:
Work Schedule Label
The label of the work schedule in Oracle Field Service. This property is only available for the record type schedule. -
shiftLabel:
string
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. -
shiftType:
string
Title:
Shift Type
Allowed Values:[ "regular", "on-call" ]
The type of the work shift. -
startDate:
string(date)
Title:
Start Date
The date when this shift takes effect. The date is in 'YYYY-MM-DD'. -
workTimeEnd:
string(time)
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. -
workTimeStart:
string(time)
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.
object
Recurrence
-
dayFrom:
string
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. -
dayTo:
string
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. -
recurEvery:
integer
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. -
recurrenceType:
string
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. -
weekdays:
array Recurrence Weekdays
Title:
Recurrence Weekdays
The weekdays on which the work schedule recurs.
array
Recurrence Weekdays
-
Array of:
string
Title:
Weekday
Allowed Values:[ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]
The weekday on which the work schedule recurs.
Default Response
object
-
detail:
string
The detailed description of this error.
-
status:
string
The HTTP status code of this error.
-
title(required):
string
The brief description of this error.
-
type(required):
string
The URL of the web page containing more details about this error.
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" } ] }