Find matching resources
/rest/ofscCore/v1/resources/custom-actions/findMatchingResources
Overnight
Overnight is represented as ["FROM_TIME","TO_TIME"] where, the FROM_TIME is greater than the TO_TIME.
For example, ["12:00","10:00"] indicates that the provider working time is from 12:00 to 10:00 of the next day, that is, 22 hours.
Fitness formula for "workTime"
The length (in minutes) of intersection interval of "activity window" with "technician working schedule".
The interval "activity window" is the time of activity service window for the parameter "date" without time which is earlier then the SLA start (SLA end is ignored).
If service window and SLA start are not defined, then the value is equal to the duration of technicians working day.
Fitness formula for "workZone"
The Resource's workzone ratio for the activity workzone (0-100).- The value is 100 if the activity does not have a work zone (no work zone requirements).
- The value is 0 if this resource does not have the activity's work zone assigned to it.
- Else, the value is equal to the 'ratio' of the resource's assigned work zone.
Fitness formula for "workSkill"
- The value is 100 if:
- the activity does not have any work skill requirements.
- the resource meets all the work skill requirements for this activity, that is, all resource's skill ratios ≥ activity's preferred ratios.
- The value is 0 if the resource does not have the work skills required for this activity, that is, all resource's skill ratios are less than activity's required ratios.
- Else, the following formula is used:
∏[skill]( resource[skill].ratio - activity[skill].required ) / ( activity[skill].preferable - activity[skill].required )
with the following exceptions:
- if dividend ≤ 0, then it is set to 0
- if divisor is 0, then it is set to 1
Fitness formula for "resourcePreference"
The level of correspondence to activity resource preferences.
- The value is 0 if:
- the resource is in the Denied Resources list, or
- the required Resources list is not empty and the Resource is not in the list
- The value is 1 if Preferred Resources list is empty or the Resource is in the list.
- The value is 0.5 for other cases.
From Release 18A onwards, this operation has the ability to search for resources without having to create an activity first. The activity information can be sent in the request using the 'activity' field/property. Some of the important implementation details of the function are as follows:
- Only one of the parameters (activity, activityId, or activitySearchFields) can be used in each request, if more then one is sent together, then it results in a 400 error.
- The 'actvityType' value must always be provided in the activity information as it specifies the activity features in Oracle Field Service.
- Depending on the configuration some other activity fields may be required:
- If Activity type supports work skills, all fields that are used in the work skill conditions are mandatory in the request, and the Oracle Field Service configuration is'Activity type Work skill conditions'
- If Activity type supports work zones, all fields that are part of the work zone key are mandatory in the request, and the Oracle Field Service configuration is 'Activity type Work zone key configuration'
- If the Activity type feature 'Calculate duration' is enabled, then all the fields that are used in the activity duration key are mandatory in the request, and the 'Activity type Statistic parameters - Activity duration key' configuration is used.
- If the Activity type feature 'Calculate travel' is enabled, then travel key value will be calculated based on the Activity Travel Key fields that are provided in the request. If any field is not provided, then the value of that field will be considered as empty when calculating travel key. If 'Detect activity travel keys automatically' is checked in Statistics configuration, then it is recommended to pass country_code, city and postalCode.
Segmentable activities:
For requests related to segmentable activities the "date" parameter is mandatory. The function looks for resources that could begin the first segment on the specified date.
The function will try to estimate the date of activity completion for each matching resource, considering the duration of the activity and available working hours in each date. Note that the system will only scan a limited amount of days into the future (not further than 2500 days from activity start) and also stops calculations if a resource has a long period of non working days consequently. If the complete date was not successfully estimated, the parameter "estimatedCompleteDate" will not be present in the response for that resource.
This operation is subject to the following conditions:
Number of Requests: The maximum number of requests that can be processed in parallel is 20. Any additional requests are rejected with an error message.Request
object
Find Matching Resources Request
-
activity:
activity
The data structure that is used to provide the activity information.
-
activityId:
integer
Title:
Activity ID
The unique identifier of the activity in Oracle Field Service. If the Activity ID is specified, then the API uses the properties of the specified activity to find matching resources. Only one of the following parameters can be specified in a same request: 'activity', 'activityId' or 'activitySearchFields'. -
activitySearchFields:
object Activity Search Fields
Title:
Activity Search Fields
If specified, the API looks for existing activity with matching Appointment Number, Customer Number or both. Then API returns resources to which this activity may be assigned. Only one of the following parameters can be specified in a same request: 'activity', 'activityId' or 'activitySearchFields'. -
criteria:
object Criteria
Title:
Criteria
The criteria used to filter the results.Results with fitness value greater than the specified cutoff point are removed from response. If a particular criteria is not present, then the API does use the criteria to filter the results. If the criteria parameter is not specified in request, then by default all the criteria is applied.
-
date:
string
Title:
Date
The date for which the operation calculates the fitness formula. Specify the date in 'YYYY-MM-DD' format. For regular activity type this field can be omitted if schedulesToReturn parameter is specified. -
fields:
array Fields
Title:
Fields
The array of resource fields that are returned in the response. The specified fields are returned in the response.- If the parameter 'fields' is not present, then the default fields 'resourceId', 'status', 'language', and 'languageISO' are returned.
- If the fields are specified, then the default fields and requested fields are returned.
- If incorrect fields are specified then, then a 400 error is returned.
- If the array is empty, then only the default fields are returned.
-
forecastDuringBooking:
object Forecast During Booking
Title:
Forecast During Booking
The criteria used to sort and filter the results by means of forecasting the future activity flow to calculate the average additional travel per activity.Results with travel more then an average per bucket are filtered out before the end of forecasting period. If a particular parameter is not present or not specified in request, then the default values are applied.
-
limit:
integer
Title:
Limit
The maximum number of resources to be returned in the response. The maximum value that can be specified is 100. If you specify a value greater than 100, it defaults to 100. It is ignored for request with segmentable activity types. -
offset:
integer
Title:
Offset
The number of items to be skipped in the response. It is ignored for request with segmentable activity types. -
schedulesFields:
array Schedules Fields
Title:
Schedules Fields
The schedules fields to be returned in the response. The value of this parameter is specified, then only the specified fields are returned in the 'schedules' items for each date. This parameter must be specified along with the 'schedulesToReturn' parameter because the schedules information is returned only if it is specified. It is ignored for request with segmentable activity types. -
schedulesToReturn:
array Schedules to Return
Title:
Schedules to Return
The array of dates for which additional schedules information is returned. It is ignored for request with segmentable activity types.In case of Date parameter is passed the fitness functions will only be compared against the date provided in the Date field and not against each date in the schedulesToReturn array. If the resources could have different work skills or work zones over the dates in the array, you need to submit a separate findMatchingResources request for each individual day in the Date field.
If Date parameter is omitted the function includes a resource in the response in case the resource is matched for any date from the list. This way allows to run single request for date list instead of running many requests for a single date. In this case it is allowed to specify 14 items max.
-
object
New Activity Properties
Title:
New Activity Properties
The properties of the new activity.
object
Activity Search Fields
-
apptNumber:
string
Title:
Appt Number
The apptNumber parameter may be used by integrations to store the identifier of the activity in the origin system. This field has no business significance in Oracle Field Service and can be left empty. -
customerNumber:
string
Title:
Customer Number
The account number of the customer. This field is used by integrations as a placeholder for the external identifier of the Account ID in the application. This parameter has no business significance in Oracle Field Service and can be left empty.
object
Criteria
Results with fitness value greater than the specified cutoff point are removed from response. If a particular criteria is not present, then the API does use the criteria to filter the results. If the criteria parameter is not specified in request, then by default all the criteria is applied.
-
includeResources:
string
Title:
Include Resources Filter Criteria
Allowed Values:[ "technicians", "buckets", "all" ]
The criteria to filter the results by resources. For example, include only technician resource, only bucket resources, or both. -
requiredInventoryMatch:
boolean
Title:
Required Inventories Filter Criteria
Indicates whether OFSC should apply resource filtration by inventory set matching. Note that the function only checks the inventory in the resource pool, teamworks and warehouses are not considered. -
resourcePreference:
number
Title:
Resource Preference Filter Criteria
Minimum Value:0
Maximum Value:1
The criteria to filter the results by preference level of the resource. -
workSkill:
integer
Title:
Work Skill Filter Criteria
Minimum Value:0
Maximum Value:100
The criteria to filter the results by work skills required to do the activity. -
workTime:
integer
Title:
Work Time Filter Criteria
The criteria to filter the results by the time (in minutes) required to complete the activity. -
workZone:
integer
Title:
Work Zone Filter Criteria
Minimum Value:0
Maximum Value:100
The criteria to filter the results by work zone of the activity.
array
Fields
- If the parameter 'fields' is not present, then the default fields 'resourceId', 'status', 'language', and 'languageISO' are returned.
- If the fields are specified, then the default fields and requested fields are returned.
- If incorrect fields are specified then, then a 400 error is returned.
- If the array is empty, then only the default fields are returned.
object
Forecast During Booking
Results with travel more then an average per bucket are filtered out before the end of forecasting period. If a particular parameter is not present or not specified in request, then the default values are applied.
-
explainRemovedOptions:
boolean
Title:
Enable Explanation Of the Removed Sub-optimal Arrival Time Options
Turn on to add to the response particular reasons for arrival time options being removed due to additional travel value is over than average travel on the bucket +20% threshold along with the actual schedule statistics information. -
maxForecastRangeDay:
integer
Title:
Maximum Forecast Range Day
Minimum Value:0
Maximum Value:31
Number of days, counted from current day, where current day is 0. Should be greater then Minimum Forecast Range Day. System does the activity flow forecasting between Minimum Forecast Range Day and Maximum Forecast Range Day. During this period the average additional travel is calculated based on the number of the forecasted activities within the close proximity of the activity being booked and only results having the additional travel lesser then the average per-bucket travel are returned. After the Maximum Forecast Range Day all the available results are returned, despite the additional travel. No activity flow forecasting is done after Maximum Forecast Range Day. -
minForecastRangeDay:
integer
Title:
Minimum Forecast Range Day
Minimum Value:0
Maximum Value:31
Number of days, counted from current day, where current day is 0. before which only results that has an existing activity within the close proximity are returned. No activity flow forecasting is done before Minimum Forecast Range Day. -
optimizationGoal:
string
Title:
Optimization Goal
Allowed Values:[ "default", "minimizeAdditionalTravel" ]
Choose minimizeAdditionalTravel to sort the results by increasing of additional travel added. Default option sorts the results by ETA from minimal to maximal. -
useForecastDuringBooking:
boolean
Title:
Enable Forecast During Booking
Turn on to sort and filter the results by means of forecasting the future activity flow to calculate the average additional travel per activity.
array
Schedules Fields
-
Array of:
string
Title:
Schedules Field
Allowed Values:[ "fitness", "workShift", "freeTimeWindows", "arrivalTimeOptions", "routeDetails", "forecastDuringBookingDetails" ]
array
Schedules to Return
In case of Date parameter is passed the fitness functions will only be compared against the date provided in the Date field and not against each date in the schedulesToReturn array. If the resources could have different work skills or work zones over the dates in the array, you need to submit a separate findMatchingResources request for each individual day in the Date field.
If Date parameter is omitted the function includes a resource in the response in case the resource is matched for any date from the list. This way allows to run single request for date list instead of running many requests for a single date. In this case it is allowed to specify 14 items max.
-
Array of:
string
Title:
Date
The date for which the schedules are returned. Specify the date in 'YYYY-MM-DD' format.
object
New Activity Properties
-
accessSchedule:
string
Title:
Access Schedule
The schedule (that is, the set of time intervals or access hours, two intervals per week day) when the asset or the activity location is accessible. Work must start and complete during this interval. It is generally not possible to work beyond the access hours. Maximum field length is 1020.Access Schedule Field Format
This field is a string, which contains an inner json object (encoded as a string). For example, "accessSchedule": "{\"schedule\":[{\"daysOfWeek\":[\"Mon\",\"Tue\"],\"hours\":[[\"07:00\",\"12:00\"]]}]}"The inner json object has the following schema:
{
"type": "object",
"properties": {
"schedule": {
"type": "array",
"items": {
"type": "object",
"properties": {
"daysOfWeek": {
"type": "array",
"items": {
"type": "string",
"enum": [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" ]
}
},
"hours": {
"type": "array",
"items": {
"type": "array",
"items": { "type": "string" }
}
}
}
}
},
"exceptDates": {
"type": "array",
"items": { "type": "string" }
}
}
} -
activityType:
string
Title:
Activity Type
The label of the activity type. Based on the activity type, predefined company-specific rules are applied when processing an activity. Predefined company-specific rules cover the following:
- The resources that the activity can be assigned to.
- The activity processing details.
- The interaction of the activity with different modules of Oracle Field Service.
-
apptNumber:
string
Title:
Appt Number
The apptNumber parameter may be used by integrations to store the identifier of the activity in the origin system. This field has no business significance in Oracle Field Service and can be left empty. Maximum field length is 40. -
city:
string
Title:
City
The city of the customer. This field is used for geocoding and must contain a valid address. Maximum field length is 60. -
country_code:
string
Title:
Country Code
The code of the country where the activity is scheduled. -
customerCell:
string
Title:
Customer Cell
The cell phone number of the customer. The phone number is saved in Oracle Field Service with the '+' symbol and all other non-digit characters are removed. For example, if you enter the phone number as +1(234)234-23_42, it is saved in Oracle Field Service as +12342342342. Maximum field length is 240. -
customerEmail:
string
Title:
Customer Email
The email address of the customer. Maximum field length is 320. -
customerName:
string
Title:
Customer Name
The name of the customer. Maximum field length is 420. -
customerNumber:
string
Title:
Customer Number
The account number of the customer. This field is used by integrations as a placeholder for the external identifier of the Account ID in the application. This parameter has no business significance in Oracle Field Service and can be left empty. Maximum field length is 40. -
customerPhone:
string
Title:
Customer Phone
The regular (land) phone number of the customer. The phone number is saved in Oracle Field Service with the '+' symbol and all other non-digit characters are removed. For example, if you enter the phone number as +1(234)234-23_42, it is saved in Oracle Field Service as +12342342342. Maximum field length is 240. -
date:
string
Title:
Date
The date on which the activity is scheduled. This field is not present in the response, if the activity is not scheduled for any particular date. -
deliveryWindowEnd:
string
Title:
Delivery Window End
The time when the activity delivery window ends. The time is displayed in the time zone of the resource to which the activity is assigned, and is in 'HH:MM:SS' format. -
deliveryWindowStart:
string
Title:
Delivery Window Start
The time when the activity delivery window starts. The time is displayed in the time zone of the resource to which the activity is assigned, and is in 'HH:MM:SS' format. -
duration:
integer
Title:
Duration
Estimated activity duration in minutes. The duration specified in request will only be applied if the 'Calculate activity duration using statistics' checkbox is unchecked for the Activity Type of the activity being created/updated. For segmentable activities this field is only used when a new activity is created. To change the length of the segmentable activities use the field "multidayTimeToComplete" instead. -
language:
string
Title:
Language
The preferred language of the customer. This parameter returns two-character code (e.g. "en") in API responses. To obtain ISO code of the language (e.g. "en-US") read the "languageISO" parameter. In the requests this parameter accepts both formats (e.g. "en" or "en-US"). It is recommended to use ISO format. The language codes listed on: Supported Language Codes. -
languageISO:
string
Title:
Language ISO
The preferred language of the customer. This parameter is only present in the responses and will be ignored if it is present in a request. To update language use the parameter "language". The language codes listed on: Supported Language Codes. -
latitude:
number
Title:
Latitude
Minimum Value:-90
Maximum Value:90
The geographic coordinates that specify the location of the activity. -
longitude:
number
Title:
Longitude
Minimum Value:-180
Maximum Value:180
The geographic coordinates that specify the location of the activity. -
points:
integer
Title:
Points
Minimum Value:0
Maximum Value:65535
The cost of the activity in 'points'. This field is intended for use by the Routing module. -
postalCode:
string
Title:
Postal Code
The postal code of the customer. This field is used for geocoding and must contain a valid address. Maximum field length is 60. -
reminderTime:
integer
Title:
Reminder Time
The number of minutes before the activity start time the customer must be notified of the activity. -
requiredInventories:
array requiredInventories
List of inventories required by activity. Max 100 items.
-
resourceId:
string
Title:
Resource ID
The identifier of the resource to which this activity is assigned. This field is not returned if the resource ID is empty.
Note: Do not use empty strings in requests.
-
resourcePreferences:
array resourcePreferences
List of resource preferences for the activity. Max 100 items.
-
serviceWindowEnd:
string
Title:
Service Window End
The time when the service window ends for the activity. The time is displayed in 'HH:MM:SS' format.If the activity type feature 'SLA and Service window use customer time zone' is enabled, then the service window is accepted in the time zone of the customer. If it is not enabled, then the Service Window is accepted in the time zone of the resource to which the activity is currently assigned.
If the activity is later assigned to another resource and the activity type feature 'SLA and Service window use customer time zone' is enabled, then the Service Window is recalculated so that the fields are not changed in the customer's time zone, but they are changed in the time zone of the new resource.
-
serviceWindowStart:
string
Title:
Service Window Start
The time when the service window starts for the activity. The time is displayed in 'HH:MM:SS' format.If the activity type feature 'SLA and Service window use customer time zone' is enabled, then the service window is accepted in the time zone of the customer. If it is not enabled, then the Service Window is accepted in the time zone of the resource to which the activity is currently assigned.
If the activity is later assigned to another resource and the activity type feature 'SLA and Service window use customer time zone' is enabled, then the Service Window is recalculated so that the fields are not changed in the customer's time zone, but they are changed in the time zone of the new resource.
-
setPositionInRoute:
object Set Position in Route
Title:
Set Position in Route
The value of this element determines the position of the activity in the route. If this element is present then activity will be put to specified position in route. The parameter is optional, if it is absent then the value "position: byServiceWindow" is used. -
setTravelTime:
object Set Travel Time
Title:
Set Travel Time
The objects used to set the travel time of the activity. The travel time is set only if the specified previousActivity/previousActivityId is ordered before the activity for which the travel time is set. -
slaWindowEnd:
string
Title:
Sla Window End
The time when the service level agreement (SLA) window ends. The time is displayed in 'YYYY-MM-DD HH:MM:SS' format.
If the activity type feature 'SLA and Service window use customer time zone' is enabled, then the SLA is accepted in the time zone of the customer. If it is not enabled, then the SLA is accepted in the time zone of the resource to which the activity is currently assigned.
If the activity is later assigned to another resource and the activity type feature 'SLA and Service window use customer time zone' is enabled, then the SLA is recalculated so that the fields are not changed in the customer's time zone, but they are changed in the time zone of the new resource.
-
slaWindowStart:
string
Title:
Sla Window Start
The time when the service level agreement (SLA) window starts. The time is displayed in 'YYYY-MM-DD HH:MM:SS' format.
If the activity type feature 'SLA and Service window use customer time zone' is enabled, then the SLA is accepted in the time zone of the customer. If it is not enabled, then the SLA is accepted in the time zone of the resource to which the activity is currently assigned.
If the activity is later assigned to another resource and the activity type feature 'SLA and Service window use customer time zone' is enabled, then the SLA is recalculated so that the fields are not changed in the customer's time zone, but they are changed in the time zone of the new resource.
-
stateProvince:
string
Title:
State or Province
The state or province of the customer. This field is used for geocoding and must contain a valid address. Maximum field length is 60. -
streetAddress:
string
Title:
Street Address
The street address of the customer. This field is used for geocoding and must contain a valid address. Maximum field length is 240. -
teamResourceId:
string
Title:
Team Resource ID
The identifier of the team resource for a teamwork activity. -
timeOfBooking:
string
Title:
Time of Booking
The time when the customer booked the activity. The time is displayed in the time zone of the customer. -
timeSlot:
string
Title:
Time Slot
The time slot during which the activity is completed. Time Slot also indicates the service window for the activity. This time is displayed in the time zone of the resource to which the activity is assigned. -
timeZone:
string
Title:
Time Zone
The name of the customer's time zone. By default, the time zone of the resource (to which the activity is assigned) is used.
This parameter accepts both Oracle Field Service time zone names (for example, Eastern) and IANA standard time zone names (for example, America/New_York). It is recommended that you specify IANA names. For a list of supported time zones, see Supported Time Zones.
array
-
Array of:
object Required Inventory
Title:
Required Inventory
The array of required inventory item objects assigned to the specified activity.
array
-
Array of:
object Resource Preference
Title:
Resource Preference
The resource preference of an activity.
object
Set Position in Route
-
activityId:
integer
Title:
Activity ID
The unique identifier of some pending ordered activity in the target route. It is used along with the 'afterActivity' value of the 'position' parameter so that to put one activity in the position after another. -
position(required):
string
Title:
Position
Allowed Values:[ "first", "last", "notOrdered", "byServiceWindow", "afterActivity" ]
The position of the activity in the route.
object
Set Travel Time
-
position(required):
string
Title:
Position
Allowed Values:[ "first", "afterActivity" ]
The expected position of the activity in a route.To adjust the travel time of an activity, specify the location from where the travel is starting. The location can be the start of the route or another activity. This information is used when activities are reordered or moved while performing a sequence of operations.
-
previousActivity:
object Previous Activity
Title:
Previous Activity
The objects in this array are used instead of the 'previousActivityId' parameter to find activities when internal IDs cannot be used. For example, it is used for the bulkUpdate operation.The 'previousActivity' activity array contains two items: 'apptNumber' and 'customerNumber'. The parameter 'apptNumber' is mandatory. The parameter 'customerNumber' is only required when the 'bulkUpdate/identifyActivityBy' option is set to 'apptNumberPlusCustomerNumber'.
The operation returns an error if the system is unable to find any activity using the specified 'apptNumber' and 'customerNumber' values.
-
previousActivityId:
integer
Title:
Previous Activity ID
The identifier of a previous activity that requires travel time calculation.If an activity doesn't require traveling (for example, calling your manager), then the identifier of the activity cannot be used as the 'Travel previous activity ID'. In such case, it is assigned to an ID of a previous activity that required travel.
This parameter is mandatory when the value of the parameter 'position' is 'afterActivity'.
Note: The operation does not return any error if the adjustment cannot be made because the specified 'previousActivityId' doesn't correspond to a real-time activity. This can be detected by verifying the 'travelTime' value returned.
-
source:
string
Title:
Source
Allowed Values:[ "manual", "external" ]
The origin of the travel time data. The following are the allowed values:- manual - indicates that the travel time value is entered manually by a user.
- external - indicates that the travel time value is estimated based on the statistics or street-level routing service results.
-
travelTime(required):
integer
Title:
Travel Time
Minimum Value:0
Maximum Value:65535
The travel time for the specified activity.
object
Required Inventory
-
inventoryType(required):
string
Title:
Required Inventory Type
The required inventory type for the specified activity. -
model(required):
string
Title:
Required Inventory Model
The required inventory model for the specified activity. -
quantity(required):
number
Title:
Required Inventory Quantity
The required quantity of inventory for the specified activity.
object
Resource Preference
-
preferenceType(required):
string
Title:
Preference Type
Allowed Values:[ "required", "preferred", "forbidden", "warehouse" ]
The type of resource preference for the activity.- preferred - the resource is preferred while routing.
- required - the activity can only be assigned to a required resource.
- forbidden - the activity cannot be assigned to the specified resource.
- warehouse - inventory may be installed from the specified resource
-
resourceId:
string
Title:
Resource ID
The unique identifier of the resource in Oracle Field Service.
object
Previous Activity
The 'previousActivity' activity array contains two items: 'apptNumber' and 'customerNumber'. The parameter 'apptNumber' is mandatory. The parameter 'customerNumber' is only required when the 'bulkUpdate/identifyActivityBy' option is set to 'apptNumberPlusCustomerNumber'.
The operation returns an error if the system is unable to find any activity using the specified 'apptNumber' and 'customerNumber' values.
Response
- application/json
200 Response
object
Find Matching Resources
-
items:
array Resource Matches
Title:
Resource Matches
The resources matching the criteria specified in the request. -
limit:
integer
Title:
Limit
The limit value specified in the request. Not returned if requested activity is segmentable. -
offset:
integer
Title:
Offset
The offset value specified in the request. Not returned if requested activity is segmentable. -
totalResults:
integer
Title:
Total Results
The total number of resources returned. Not returned if requested activity is segmentable.
array
Resource Matches
-
Array of:
object Resource Match
Title:
Resource Match
The record of the resource that has matched the specified criteria. For segmentable activity maximum number of items in the response is 25
object
Resource Match
-
estimatedCompleteDate:
string
Title:
Estimated Complete Date
The date when the resource is expected to complete the activity. The date is in 'YYYY-MM-DD' format. This field is returned if the requested activity is segmentable. -
fitness:
object Fitness
Title:
Fitness
The fitness values for the resource calculated for the particular schedule date. Note that these fitness values are calculated for all criteria, regardless if they are present in the request or not. Only the values that are specified in the request "criteria" parameter and only for the date specified in the "date" request parameter may cause resources exclusion from the response. The others fitness values are provided only as additional information. -
resource:
object Resource
Title:
Resource
The resource used for an activity. For example, a resource can be a technician, a truck, or a bucket.Note: This resource is not the same as a REST resource.
-
schedule:
object List of Resource Schedules
Title:
List of Resource Schedules
Additional Properties Allowed: Resource Schedule InformationThe list of records with the schedule information for each date requested in the schedulesToReturn parameter. Not returned if requested activity is segmentable.
object
Fitness
-
resourcePreference:
number
Title:
Resource Preference
Minimum Value:0
Maximum Value:1
The calculated fitness value for the preference level of the resource. If the request criteria "resourcePreference" was not sent, then this value is not calculated, the value "0" is returned here and used for the fitness instead. As the result, resources are not excluded by this criteria. -
workSkill:
integer
Title:
Work Skill
Minimum Value:0
Maximum Value:100
The calculated fitness value for the resource work skills required to complete the activity. If the request criteria "workSkill" was not sent, then this value is not calculated, the value "100" is returned here and used for the fitness instead. As the result, resources are not excluded by this criteria. -
workTime:
integer
Title:
Work Time
The calculated time frame based on the resource calendar and activity time constraints. If the request criteria "workTime" was not sent, then this value is not calculated, the value "0" is returned here and used for the fitness instead. As the result, resources are not excluded by this criteria. -
workZone:
integer
Title:
Work Zone
Minimum Value:0
Maximum Value:100
The calculated fitness value for the resource work zone. If the request criteria "workSkill" was not sent, then this value is not calculated, the value "100" is returned here and used for the fitness instead. As the result, resources are not excluded by this criteria.
object
Resource
Note: This resource is not the same as a REST resource.
-
avatar:
object Avatar
Title:
Avatar
The profile picture of the user.If an Oracle Field Service user has a profile picture uploaded (into the 'user.avatar' field) and the specified resource is the user's main resource, then the profile picture can be obtained directly from the resource. This helps to avoid multiple API calls that are otherwise required to find the appropriate user and retrieve the user's profile picture from the 'avatar' field. In order to upload the picture it is necessary to use the "Set a file property" function for appropriate user (using 'avatar' property label).
-
dateFormat:
string
Title:
Date Format
The date format for the resource. Allowed Values: ["dd/mm/yy", "mm/dd/yy","dd.mm.yy","yyyy/mm/dd"]. -
durationStatisticsInitialPeriod:
integer
Title:
Duration Statistics Initial Period
The number of days the initial ratio is used after a new resource is created. After the specified number of days, the reported duration starts impacting the company estimations. This field is used only if the 'Use durations reported to enhance company-wide estimations' option is selected in the Manage application screen 'Configuration -> Resource Types'. The default value is 5. -
durationStatisticsInitialRatio:
number
Title:
Duration Statistics Initial Ratio
The ratio applied over the company estimations if the user hasn't performed any activity. All modifications to the personal profile ratio are done using this value as the starting point. The default value is 1. -
email:
string
Title:
Email
The email ID of the resource. The maximum character length of this field is 255 characters. If more than 255 characters are specified, then only the first 255 characters are saved and the rest are ignored. -
language(required):
string
Title:
Language
The preferred language of the resource. This field accepts the language codes listed on: Supported Language Codes. -
name(required):
string
Title:
Name
Minimum Length:1
The name of the resource. The maximum character length of this field is 40 characters. If more than 40 characters are specified, then only the first 40 characters are saved and the rest are ignored. -
organization:
string
Title:
Organization
The label of an organization of the resource. -
parentResourceId:
string
Title:
Parent Resource ID
The unique identifier of the parent resource. -
phone:
string
Title:
Phone
The phone number of the resource. The maximum character length of this field is 16 characters. If more than 16 characters are specified, then only the first 16 characters are saved and the rest are ignored.
Note: The phone number is saved in Oracle Field Service with the '+' symbol and all other non-digit characters are removed. For example, if you enter the phone number as +1(234)234-23_42, it is saved in Oracle Field Service as +12342342342.
-
resourceId:
string
Title:
Resource ID
The identifier of the resource in the external system. The maximum character length of this field is 32 characters. If more than 32 characters are specified, the operation fails with HTTP status 400 error. -
resourceInternalId:
integer
Title:
Resource Internal ID
The unique identifier of the resource in Oracle Field Service. This is a read-only field. -
resourceType:
string
Title:
Resource Type
The type of the resource. -
status:
string
Title:
Status
Allowed Values:[ "active", "inactive" ]
The status of the resource. -
timeFormat:
string
Title:
Time Format
The time format of the resource. Allowed Values: [ "12-hour", "24-hour" ]. -
timeZone(required):
string
Title:
Time Zone
The name of the resource's time zone. This field accepts both Oracle Field Service time zone names (for example, Eastern) and IANA standard time zone names (for example, America/New_York). It is recommended that you specify IANA names. In the response, this field contains the Oracle Field Service time zone name, while the field 'timeZoneIANA' contains the IANA time zone name. For a list of supported time zones, see Supported Time Zones. -
timeZoneDiff:
integer
Title:
Time Zone Diff
The difference between UTC and the resource's local time, displayed in minutes. For example, -180 means that the resource time is 3 hours behind UTC. -
timeZoneIANA:
string
Title:
Time Zone IANA Name
The IANA name of the resource's time zone (for example, America/New_York). For the list of IANA time zone names, see IANA Time ZonesThis is a read-only field and is only returned in responses.
object
List of Resource Schedules
-
object Resource Schedule Information
Title:
Resource Schedule Information
The schedule information of the resource for the specified date.
object
Avatar
If an Oracle Field Service user has a profile picture uploaded (into the 'user.avatar' field) and the specified resource is the user's main resource, then the profile picture can be obtained directly from the resource. This helps to avoid multiple API calls that are otherwise required to find the appropriate user and retrieve the user's profile picture from the 'avatar' field. In order to upload the picture it is necessary to use the "Set a file property" function for appropriate user (using 'avatar' property label).
object
Resource Schedule Information
-
arrivalTimeOptions:
array Arrival Time Options
Title:
Arrival Time Options
Provides list of possible options how the activity can be assigned in the resource's route. This information is not useful for buckets. -
fitness:
object Fitness
Title:
Fitness
The fitness values for the resource calculated for the particular schedule date. Note that these fitness values are calculated for all criteria, regardless if they are present in the request or not. Only the values that are specified in the request "criteria" parameter and only for the date specified in the "date" request parameter may cause resources exclusion from the response. The others fitness values are provided only as additional information. -
forecastDuringBookingDetails:
object Forecast During Booking Details
Title:
Forecast During Booking Details
Provides list of possible options to assign activity in the resource's route for the case when forecasting activity flow was used. This information is not useful for buckets. -
freeTimeWindows:
array Free Time Windows
Title:
Free Time Windows
The array of time (in HH:MM format) pairs that specify when the resource is free in a day depending on the working hours and already assigned activities. For example, [["12:00","14:00"],["15:00","18:00"]]. -
workShift:
object Resource Work Schedule Item
Title:
Resource Work Schedule Item
The array of work schedule item of the resource.
array
Arrival Time Options
object
Forecast During Booking Details
-
averageBucketTravel:
integer
Title:
Average Travel Time On The Technician Bucket
Contains the value of average travel time over the bucket. -
averageTravelKeyTravel:
integer
Title:
Average Travel Time On The FMR Activity Travel Key
Contains the value of average travel time for the traveling withing the same travel key as of FMR activity. -
hasForecastedActivities:
boolean
Title:
Contains Forecasted Activities
Contains one of the following values: true or false. If true, the activity flow forecast was used to calculate the additional travel. If false, then only activities already present in the route were used to calculate the additional travel. -
hasNearbyActivities:
boolean
Title:
Contains Nearby Activities
Contains one of the following values: true or false. If true, either the previous or the following activity is in close proximity of the activity specified in request. If false, then the previous or the following activity is not in close proximity of the activity specified in request. -
removedOptions:
array Removed Arrival Time Options
Title:
Removed Arrival Time Options
Arrival Time Options that were removed due to additional travel value is over than average travel on the bucket +20% threshold along with the actual for this schedule statistics information.
array
Free Time Windows
-
Array of:
array items
Minimum Number of Items:
2
Maximum Number of Items:2
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:
string
Title:
Is Working Shift
Contains one of the following values: "1" or "0". The value "1" means it is a working day, the value "0" is retutned for a non-working day. -
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
-
additionalTravel:
integer
Title:
Additional Travel
The difference in minutes between total travel in the current route and travel in the proposed route where the booking activity added. -
maxStartTime:
string
Title:
Possible Activity Start To
The time (in HH:MM format) after which the activity should not start. The activity must not violate any constraints for the particular position in the route. -
minStartTime:
string
Title:
Possible Activity Start From
The time (in HH:MM format) when the activity can start. It is calculated as the sum of end time of previous activity and travel time to the new activity. The activity must not violate any constraints for the particular position in the route. -
setPositionInRoute:
object Set Position in Route
Title:
Set Position in Route
The data structure used to assign the activity to a particular position in the technician's route. It has the same format as the 'setPositionInRoute' parameter in the 'Create activity' operation. -
travelKeyMatch:
boolean
Title:
Travel Key Match
Contains one of the following values: true or false. If true, either the previous or the following activity has the same travel travel key value as the activity specified in request. If false, then the previous or the following activity has the different travel travel key values as the activity specified in request. -
workZoneMatch:
boolean
Title:
Work Zone Match
Contains one of the following values: true or false. If true, either the previous or the following activity is in the same work zone as the activity specified in request. If false, then the previous or the following activity are not in the same work zone as the activity specified in request.
object
Set Position in Route
array
Removed Arrival Time Options
object
-
additionalTravel:
integer
Title:
Additional Travel
If the activity flow forecast were not used, contains the difference in minutes between total travel in the current route and travel in the proposed route where the booking activity is added. If the activity flow forecast were used, contains the difference in minutes between total travel in the current route and travel in the proposed route where the booking activity is added divided for the number of the activities being forecasting for the given day + 1. -
maxStartTime:
string
Title:
Possible Activity Start To
The time (in HH:MM format) after which the activity should not start. The activity must not violate any constraints for the particular position in the route. -
minStartTime:
string
Title:
Possible Activity Start From
The time (in HH:MM format) when the activity can start. It is calculated as the sum of end time of previous activity and travel time to the new activity. The activity must not violate any constraints for the particular position in the route.
array
2
2
-
Array of:
string
Pattern:
^\d{2}:\d{2}$
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(required):
string
The detailed description of this error.
-
status(required):
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
Example 1
The following example shows how to find matching resources for segmentable activities by submitting a POST request on the REST resource using cURL.
cURL command for Example 1
curl -u '<CLIENT-ID>@<INSTANCE-NAME>:<CLIENT-SECRET>' -X POST --url 'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/custom-actions/findMatchingResources' --data-binary '{ "criteria": { "resourcePreference":0.0, "includeResources":"technicians" }, "date":"2019-09-26", "fields": ["resourceId","resourceType"], "activity": { "duration":500, "date":"2019-09-26", "activityType":"Multiday", "timeZone":"America/New_York", "city":"ALTAMONTE SPRINGS" } }'
Response Body for Example 1
{ "items": [ { "resource": { "resourceId": "Aslan_Atees", "status": "active", "resourceType": "PR", "language": "en", "languageISO": "en-US" }, "fitness": { "workTime": 0, "workZone": 100, "workSkill": 100, "resourcePreference": 1 }, "estimatedCompleteDate": "2019-09-27" }, { "resource": { "resourceId": "Ayisha_Bolukbasi", "status": "active", "resourceType": "PR", "language": "en", "languageISO": "en-US" }, "fitness": { "workTime": 0, "workZone": 100, "workSkill": 100, "resourcePreference": 1 }, "estimatedCompleteDate": "2019-09-27" } ] }
Example 2
The following example shows how to find matching resources without having to create an activity first, by submitting a POST request on the REST resource.
Request for Example 2
POST https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/custom-actions/findMatchingResources { "criteria": { "resourcePreference": 0.0, "workSkill": 100, "workTime": 100, "workZone": 100, "includeResources": "technicians" }, "limit": 3, "date": "2018-01-16", "fields": [ "resourceId", "resourceType", "parentResourceId" ], "schedulesToReturn": [ "2018-01-16" ], "activity": { "activityType": "default_customer_activity_type", "timeZone": "Eastern", "customerName": "fmr customer name", "city": "07158", "string_text_activity_property": "IN" } }
Response for Example 2
{ "totalResults": 5884, "limit": 3, "offset": 0, "items": [ { "resource": { "resourceId": "test_change_password", "status": "active", "parentResourceId": "change_password_login_policy", "resourceType": "provider_team_holder_share_full", "language": "en", "languageISO": "en-US" }, "fitness": { "workTime": 1435, "workZone": 100, "workSkill": 100, "resourcePreference": 1 }, "schedules": { "2018-01-16": { "fitness": { "workTime": 1435, "workSkill": 100, "workZone": 100, "resourcePreference": 1 }, "workShift": { "comments": "Regular", "endDate": "", "startDate": "2013-12-30", "isWorking": "1", "nonWorkingReason": "", "points": "0", "recordType": "working", "recurrence": { "dayFrom": "", "dayTo": "", "recurEvery": "1", "recurrenceType": "weekly", "weekdays": [ "Mon", "Tue", "Wed", "Thu", "Fri" ] }, "workTimeEnd": "23:55", "workTimeStart": "00:00", "shiftType": "", "shiftLabel": "", "scheduleShifts": [] }, "freeTimeWindows": [] } } }, ... "links": [ { "rel": "next", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/custom-action/findMatchingResources/?limit=3&offset=3" } ] }
Example 3
The following example shows how to find matching resources based on the access schedule specified in the request as part of the activity information.
Request for Example 3
POST https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/custom-actions/findMatchingResources { "activity": { "activityType": "default_customer_activity_type", "timeZone": "Eastern", "city": "11111", "duration": 60, "string_text_activity_property": "IN", "accessSchedule": "{\"schedule\":[{\"daysOfWeek\":[\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\",\"Sun\"],\"hours\":[[\"09:00\",\"12:00\"]]}],\"exceptDates\":[]}" }, "date" : "2020-05-19", "fields" : ["workTime", "workZone", "workSkill", "resourcePreference", "resourceId"], "schedulesToReturn" : ["2020-05-20"], "criteria" : {"workTime":100,"workSkill":0,"workZone":0,"resourcePreference":0}, "schedulesFields":["fitness","freeTimeWindows","arrivalTimeOptions"], "limit" : 1, "offset" : 1 }
Response for Example 3
{ "totalResults": 8532, "limit": 1, "offset": 1, "items": [ { "resource": { "resourceId": "fmr_tech", "status": "active", "language": "en", "languageISO": "en-US" }, "fitness": { "workTime": 180, "workZone": 100, "workSkill": 100, "resourcePreference": 1 }, "schedules": { "2020-05-20": { "fitness": { "workTime": 180, "workSkill": 100, "workZone": 100, "resourcePreference": 1 }, "freeTimeWindows": [ [ "00:05", "23:55" ] ], "arrivalTimeOptions": [ { "minStartTime": "09:00", "maxStartTime": "12:00", "workZoneMatch": false, "setPositionInRoute": { "position": "first" } } ] } } } ], "links": [ { "rel": "prev", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/custom-action/findMatchingResources/?limit=1&offset=0" }, { "rel": "next", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/custom-action/findMatchingResources/?limit=1&offset=2" } ]