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:
object
Title:
Resource Preferences
The collection of resource preferences that can be assigned to an activity.
Show Source
-
items:
array Items
Title:
Items
The array of required preferences for the specified activity.
Nested Schema : Items
Type:
array
Title:
Items
The array of required preferences for the specified activity.
Show Source
-
Array of:
object Resource Preference
Title:
Resource Preference
The resource preference of an activity.
Nested Schema : Resource Preference
Type:
object
Title:
Resource Preference
The resource preference of an activity.
Show Source
-
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.
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:
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 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