Get resource work zones
get
/rest/ofscCore/v1/resources/{resourceId}/workZones
This operation retrieves the details of the work zones assigned to the specified resource.
Request
Path Parameters
-
resourceId(required): string
The unique identifier of the resource in Oracle Field Service.
Query Parameters
-
dateFrom: string(date)
The work zones, which are active starting from the specified date, are retrieved in the response. Specify the date in YYYY-MM-DD format.
-
dateTo: string(date)
The work zones, which are active starting from the date in the dateFrom parameter till the specified date, are retrieved in the response. Specify the date in YYYY-MM-DD format. If you specify the dateTo parameter, then you must also specify the dateFrom parameter.
-
onlyActiveWorkZones: boolean
Indicates if the records related to inactive work zones should be returned in the response.
If onlyActiveWorkZones=true parameter is specified, the resource work zone assignments related to inactive work zones will be skipped.
Default Value:false
Response
Supported Media Types
- application/json
200 Response
This section describes the 200 status response for this operation.
Root Schema : Work Zones
Type:
objectTitle:
Work ZonesThe list of the existing work zones.
Show Source
-
items:
array Items
Title:
ItemsAn array of objects containing the details of the work zones assigned to the resource.
Nested Schema : Items
Type:
arrayTitle:
ItemsAn array of objects containing the details of the work zones assigned to the resource.
Show Source
-
Array of:
object Work Zone
Title:
Work Zone
Nested Schema : Work Zone
Type:
objectTitle:
Show Source
Work Zone-
endDate:
string
Title:
End DateThe date until when the work zone assignment is effective. Specify the date in 'YYYY-MM-DD' format. -
ratio:
integer
Title:
RatioMinimum Value:1Maximum Value:100The work zone ratio of the resource. The default value is 100. -
recurEvery:
integer
Title:
Recur EveryMinimum Value:1Maximum Value:10000The time between each recurrence of the work zone assignment. 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. -
recurrence:
string
Title:
RecurrenceAllowed Values:[ "weekly", "daily" ]The value of this parameter along with the 'Recur Every' parameter defines the time between each recurrence of the work zone assignment. For example, if you specify 'daily' as the value of this parameter and '4' as the value of the 'recurEvery' parameter, then the time between each recurrence is four days. -
startDate(required):
string
Title:
Start DateThe date when the work zone assignment takes effect. Specify the date in 'YYYY-MM-DD' format. -
type:
string
Title:
TypeAllowed Values:[ "regular", "override" ]The type of the work zone assignment. -
weekdays:
array Weekdays
Title:
WeekdaysUnique Items Required:trueThe weekdays on which the work zone is assigned to the resources. This parameter is mandatory when the recurrence is weekly. -
workZone(required):
string
Title:
Work Zone LabelMaximum Length:255The identifier of the work zone. -
workZoneItemId:
integer
Title:
Work Zone Item IDThe identifier of the work zone assignment. -
workZoneStatus(required):
string
Title:
Work zone statusAllowed Values:[ "active", "inactive" ]Status of the work zone. Note that this is not a status of this workzone assignment to a resource. To modify this parameter use "Work Zones" functions in Metadata API.
Nested Schema : Weekdays
Type:
arrayTitle:
WeekdaysUnique Items Required:
trueThe weekdays on which the work zone is assigned to the resources. This parameter is mandatory when the recurrence is weekly.
Show Source
-
Array of:
string
Allowed Values:
[ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]
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 work zones for a resource by submitting a GET request on the REST resource.
cURL command Example
curl -X GET \ https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/SUNRISE/workZones'\ -u '<CLIENT-ID>@<INSTANCE-NAME>:<CLIENT-SECRET>' \ -H 'content-type: application/json' \
Response Header Example
HTTP/1.1 200 OK Server: nginx/1.2.7 Date: Mon, Wed, 02 Jun 2021 11:53:49 GMT Content-Type: application/json; charset=utf-8
Response Body Example
{
"items": [
{
"workZoneItemId": 11,
"workZoneStatus": "active",
"workZone": "ALTAMONTE SPRINGS",
"startDate": "2008-03-27",
"ratio": 100,
"recurrence": "none",
"recurEvery": 0,
"type": "regular"
},
{
"workZoneItemId": 12,
"workZoneStatus": "active",
"workZone": "CASSELBERRY",
"startDate": "2008-03-27",
"ratio": 100,
"recurrence": "none",
"recurEvery": 0,
"type": "regular"
},
{
"workZoneItemId": 13,
"workZoneStatus": "active",
"workZone": "CHULUOTA",
"startDate": "2008-03-27",
"ratio": 100,
"recurrence": "none",
"recurEvery": 0,
"type": "regular"
}
],
"totalResults": 3,
"links": [
{
"rel": "canonical",
"href": "https:// <instance_name>.fs.ocs.oraclecloud.com /rest/ofscCore/v1/resources/SUNRISE/workZones"
},
{
"rel": "describedby",
"href": "https:// <instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/metadata-catalog/resources"
}
]
}