Set resource preferences of an activity
put
/rest/ofscCore/v1/activities/{activityId}/resourcePreferences
This operation sets the resource preferences for the specified activity.
Resource preferences are used to identify if a resource is preferred/required or forbidden from being assigned to an activity.
If the specified activity already contains resource preferences, this operation replaces them with the values specified in the request.
Request
Path Parameters
-
activityId(required): string
The unique identifier of the activity in Oracle Field Service.
Root Schema : Resource Preferences
Type:
objectTitle:
Resource PreferencesThe collection of resource preferences that can be assigned to an activity.
Show Source
-
items:
array Items
Title:
ItemsThe array of required preferences for the specified activity.
Nested Schema : Items
Type:
arrayTitle:
ItemsThe array of required preferences for the specified activity.
Show Source
-
Array of:
object Resource Preference
Title:
Resource PreferenceThe resource preference of an activity.
Nested Schema : Resource Preference
Type:
objectTitle:
Resource PreferenceThe resource preference of an activity.
Show Source
-
preferenceType(required):
string
Title:
Preference TypeAllowed 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 IDThe unique identifier of the resource in Oracle Field Service.
Response
Supported Media Types
- application/json
- application/schema+json
204 Response
This section describes the 204 status response for this operation. This response code indicates that the operation completed successfully.
Default Response
This section describes the default error response for this operation.
Root Schema : Error
Type:
objectError response
Show Source
-
detail:
string
The detailed information about the error.
-
status:
string
The HTTP status code.
-
title:
string
The summary of the error message.
-
type:
string
The URL of the page containing the error details.
Examples
The following example shows how to set resource preferences of an activity by submitting a PUT request on the REST resource using cURL.
curl -X 'PUT' \
-u '<CLIENT-ID>@<INSTANCE-NAME>:<CLIENT-SECRET>' \
-H 'Content-Type: application/json' \
--data-binary '{
"items": [
{
"resourceId": "11103",
"preferenceType": "preferred"
},
{
"resourceId": "11104",
"preferenceType": "preferred"
},
{
"resourceId": "11105",
"preferenceType": "forbidden"
}
]
}' \
'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/activities/4225269/resourcePreferences'Example of Response Header
The following shows an example of the response header.
HTTP/1.1 204 No Content Server: nginx/1.2.7 Date: Fri, 18 Mar 2016 02:20:17 GMT Content-Type: application/json; charset=utf-8 Connection: close