Set a work schedule

post

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

This operation creates a work schedule for 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.

This operation overwrites any work schedules that are assigned for the dates specified in the request.

For example, if schedule X is currently assigned (startDate=2015-10-06, endDate=indefinite), and then an API call assigns the schedule Y (startDate=2015-11-06, endDate=2015-11-07), the schedules after the new assignment are:

  • Schedule X is assigned to the resource on the start date specified as 2015-10-06.
  • Schedule Y is assigned on the start date specified as 2015-11-06.
  • Schedule Y ends on 2015-11-07 according to the specified end date.
  • Schedule X is assigned again on 2015-11-07 because its end date is specified as indefinite.

Request

Path Parameters
Body ()
Root 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.
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 set work schedules for a resource by submitting a POST request on the REST resource.

Example of Request Header

The following shows an example of the request header.

POST /rest/ofscCore/v1/resources/44040/workSchedules HTTP/1.0
Authorization: Basic c29hcEB5YW1hdG86MQ==
Host: <instance_name>.fs.ocs.oraclecloud.com
Accept: */*

Example of Request Body

The following example shows the contents of the request body in JSON format.

{
        "recordType": "working",
        "startDate":  "2015-11-06",
        "endDate": "2015-11-07",
        "workTimeStart": "12:00:00",
        "workTimeEnd": "22:00:00",
        "shiftType": "regular",
        "recurrence": {
            "recurrenceType": "weekly",
            "recurEvery": 5
        }
}

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, 24 Jul 2015 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.

{
        "items": [
            {
                "recordType": "working",
                "startDate": "2015-11-06",
                "endDate": "2015-11-07",
                "shiftType": "regular",
                "workTimeStart": "12:00:00",
                "workTimeEnd": "22:00:00",
                "isWorking": true,
                "scheduleItemId": 24902,
                "recurrence": {
                    "recurrenceType": "weekly",
                    "recurEvery": 5
                }
            },
            {
                "recordType": "schedule",
                "startDate": "2011-01-30",
                "scheduleLabel": "on-call",
                "isWorking": true,
                "scheduleItemId": 1040,
                "scheduleShifts": [
                    {
                        "recordType": "shift",
                        "startDate": "2011-01-30",
                        "scheduleLabel": "on-call",
                        "shiftLabel": "on-call",
                        "shiftType": "on-call",
                        "workTimeStart": "08:00:00",
                        "workTimeEnd": "22:00:00",
                        "isWorking": true,
                        "scheduleItemId": 1041
                    }
                ]
            }
        ],
        "totalResults": 2,
        "links": [
            {
                "rel": "canonical",
                "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/workSchedules"
            },
            {
                "rel": "describedby",
                "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/metadata-catalog/resources"
            }
        ]
    }
Back to Top