Get a calendar
get
/rest/ofscCore/v1/resources/{resourceId}/workSchedules/calendarView
This operation retrieves the work schedule assigned to the specified resource for the specified duration. Use this operation to render the resource's work schedule on a calendar view control, such as a monthly view or a weekly view.
Work schedules represent a resource's work calendar, which includes working hours, working and non-working days, reasons for absence, and so on.
Note: Work schedules configured for parent resources are retrieved only if Oracle Field Service supports them.
Request
Supported Media Types
- application/x-www-form-urlencoded
Path Parameters
-
resourceId(required): string
The unique identifier of the resource in Oracle Field Service.
Query Parameters
-
dateFrom(required): string
The date from which the work schedule is retrieved. Specify the date in YYYY-MM-DD format.
-
dateTo(required): string
The date till when the work schedule is retrieved. Specify the date in YYYY-MM-DD format.
Response
Supported Media Types
- application/json
200 Response
This section describes the 200 status response for this operation.
Root Schema : Work Schedules Calendar View
Type:
object
Title:
Work Schedules Calendar View
Additional Properties Allowed
Show Source
-
object calendarViewItem
An object containing one calendar item. This calendar item is a data structure that contains information about the resource's work schedule.
The work schedule items of a resource in a calendar view. Each property name is date in 'YYYY-MM-DD' form.
Show Source
Nested Schema : calendarViewItem
Type:
object
An object containing one calendar item. This calendar item is a data structure that contains information about the resource's work schedule.
Show Source
-
comments:
string
Title:
Comments
The description of the work schedule item in Oracle Field Service. -
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:[ "schedule", "shift", "extra_shift", "working", "extra_working", "non-working", "error" ]
The type of the work schedule item. The value 'error' is returned if the resource calendar is misconfigured for the particular date. -
scheduleLabel:
string
Title:
Work Schedule Label
A work schedule previously set up on Oracle Field Service UI. This property is only available if recordType= 'schedule'. -
shiftLabel:
string
Title:
Work Shift Label
A work shift previously set up on Oracle Field Service UI. This property is only available if recordType is either 'shift' or 'extra_shift'. -
workTimeEnd:
string(time)
Title:
Work Time End
The end time of a work day when this work schedule is in effect. The format is HH:MM. This property is not available if recordType='non-working'. -
workTimeStart:
string(time)
Title:
Work Time Start
The start time of a work day when this work schedule is in effect. The format is HH:MM. This property is not available if recordType='non-working'.
Default Response
This section describes the default error response for this operation.
Root Schema : Error
Type:
Show Source
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 a calendar view by submitting a GET request on the REST resource using cURL.
curl -u '<CLIENT-ID>@<INSTANCE-NAME>:<CLIENT-SECRET>' \ -H 'Accept: application/json' \ 'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/testResourceWorkScheFKTGUCHIOM/workSchedules/calendarView?dateFrom=2016-03-18&dateTo=2016-03-18'
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 200 OK Server: nginx/1.2.7 Date: Fri, 18 Mar 2016 02:25:42 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.
{ "2016-03-18": { "regular": { "recordType": "working", "workTimeStart": "08:00", "workTimeEnd": "17:00", "points": 100 } }, "links": [ { "rel": "canonical", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore//v1/resources/workSchedules/calendarView?dateFrom=2016-03-18&dateTo=2016-03-18" }, { "rel": "describedby", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore//v1/metadata-catalog/resources" } ] }