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
objectWork schedules-
items:
array Items
Title:
ItemsAn array of work schedule items.
arrayItems-
Array of:
object Resource Work Schedule Item
Title:
Resource Work Schedule ItemThe array of work schedule item of the resource.
objectResource Work Schedule Item-
comments:
string
Title:
CommentsThe description of the schedule in Oracle Field Service. -
endDate:
string(date)
Title:
End DateThe date when this schedule ends. The date is in 'YYYY-MM-DD' format. -
isWorking:
boolean
Title:
Is Working ShiftContains 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 ReasonThe reason for the non-working day (for example, holiday, vacation). These reasons are preconfigured in the Oracle Field Service UI. -
points:
integer
Title:
PointsThe 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 TypeAllowed Values:[ "schedule", "shift", "extra_shift", "working", "extra_working", "non-working" ]The type of work schedule record. -
recurrence:
object Recurrence
Title:
RecurrenceAn 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 IDThe identifier of the work schedule item in Oracle Field Service. -
scheduleLabel:
string
Title:
Work Schedule LabelThe label of the work schedule in Oracle Field Service. This property is only available if the record type is schedule. -
scheduleShifts:
array Shifts
Title:
ShiftsThe 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 LabelThe 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 TypeAllowed Values:[ "regular", "on-call" ]The type of the work shift. -
startDate(required):
string(date)
Title:
Start DateThe date when this schedule takes effect. The format is 'YYYY-MM-DD'. -
workTimeEnd:
string(time)
Title:
Work Time EndThe 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 StartThe 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.
objectRecurrence-
dayFrom:
string
Title:
Day FromThe 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 ToThe 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 EveryMinimum Value:1Maximum Value:255The 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 TypeAllowed 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 WeekdaysThe weekdays on which the work shift recurs.
arrayShifts-
Array of:
object Resource Shift Item
Title:
Resource Shift ItemAn object containing the resource shift item.
arrayRecurrence Weekdays-
Array of:
string
Title:
WeekdayAllowed 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.
objectResource Shift Item-
comments:
string
Title:
CommentsThe description of this shift in Oracle Field Service. -
endDate:
string(date)
Title:
End DateThe date when this shift ends. The date is in 'YYYY-MM-DD' format. -
isWorking:
boolean
Title:
Is Working ShiftContains 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 ReasonThe reason for the non-working day (for example, holiday, vacation). These reasons are preconfigured in the Oracle Field Service UI. -
points:
integer
Title:
PointsThe 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 TypeAllowed Values:[ "shift", "extra_shift" ]The type of the work shift record. -
recurrence:
object Recurrence
Title:
RecurrenceAn 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 IDThe identifier of the work schedule item in Oracle Field Service. -
scheduleLabel:
string
Title:
Work Schedule LabelThe label of the work schedule in Oracle Field Service. This property is only available for the record type schedule. -
shiftLabel:
string
Title:
Work Shift LabelThe 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 TypeAllowed Values:[ "regular", "on-call" ]The type of the work shift. -
startDate:
string(date)
Title:
Start DateThe date when this shift takes effect. The date is in 'YYYY-MM-DD'. -
workTimeEnd:
string(time)
Title:
Work Time EndThe 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 StartThe 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.
objectRecurrence-
dayFrom:
string
Title:
Day FromThe 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 ToThe 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 EveryMinimum Value:1Maximum Value:255The 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 TypeAllowed 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 WeekdaysThe weekdays on which the work schedule recurs.
arrayRecurrence Weekdays-
Array of:
string
Title:
WeekdayAllowed 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"
}
]
}