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
Body ()
Root Schema : Resource Preferences
Type: object
Title: Resource Preferences
The collection of resource preferences that can be assigned to an activity.
Show Source
Nested Schema : Items
Type: array
Title: Items
The array of required preferences for the specified activity.
Show Source
Nested Schema : Resource Preference
Type: object
Title: Resource Preference
The resource preference of an activity.
Show Source
  • Title: Preference Type
    Allowed Values: [ "required", "preferred", "forbidden" ]
    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.
  • Title: Resource ID
    The unique identifier of the resource in Oracle Field Service Cloud.
Back to Top

Response

Supported Media Types

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.
Body ()
Root Schema : Error
Type: object
Error response
Show Source
Back to Top

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>.etadirect.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
Back to Top