Update a resource

patch

/rest/ofscCore/v1/resources/{resourceId}

This operation updates the properties of an existing resource with the properties specified in the request.

All custom properties (except file properties) can be sent in the request in the same way as the built-in properties. The maximum character length for custom properties of type 'string' is 65535 characters. If the character length exceeds the limit, then only the first 65535 characters are saved and the rest are ignored.

Request

Path Parameters
  • The unique identifier of the resource. If the identifyResourceBy query parameter is specified as "resourceId" or absent then the resource is identified by its External Id. (maximum length is 32 characters). If the identifyResourceBy query parameter is specified as "resourceInternalId" then the resource is identified by its OFS internal id (integer value).
Query Parameters
  • Indicates what type of identifier is used in the path parameter resourceId.

    Note that only if the "resourceInternalId" value is specified and the resource is addressed by its internal id, the function allows to modify the resource external Id value among of others resource attributes.

    Default Value: resourceId
    Allowed Values: [ "resourceId", "resourceInternalId" ]
Body ()
Root Schema : Resource
Type: object
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.

Show Source
  • Title: Date Format
    The date format for the resource. Allowed Values: ["dd/mm/yy", "mm/dd/yy","dd.mm.yy","yyyy/mm/dd"].
  • 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.
  • 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.
  • 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.
  • Title: Language
    The preferred language of the resource. This field accepts the language codes listed on: Supported Language Codes.
  • 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.
  • Title: Organization
    The label of an organization of the resource.
  • Title: Parent Resource ID
    The unique identifier of the parent resource.
  • 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.

  • Title: Resource ID
    The unique identifier of the resource. The maximum length of this field is 32 characters.

    Note that this parameter cannot be changed and will be ignored in the update request if the resource is identified by its resourceId in the URL. This parameter can be modified only with the identifyResourceBy=resourceInternalId query parameter.

  • Title: Resource Type
    The type of the resource.
  • Title: Status
    Allowed Values: [ "active", "inactive" ]
    The status of the resource.
  • Title: Time Format
    The time format of the resource. Allowed Values: [ "12-hour", "24-hour" ].
  • 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.
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation.
Body ()
Root Schema : Resource
Type: object
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.

Show Source
  • 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).

  • Title: Date Format
    The date format for the resource. Allowed Values: ["dd/mm/yy", "mm/dd/yy","dd.mm.yy","yyyy/mm/dd"].
  • 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.
  • 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.
  • 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.
  • Title: Language
    The preferred language of the resource. This field accepts the language codes listed on: Supported Language Codes.
  • 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.
  • Title: Organization
    The label of an organization of the resource.
  • Title: Parent Resource ID
    The unique identifier of the parent resource.
  • 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.

  • 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.
  • Title: Resource Internal ID
    The unique identifier of the resource in Oracle Field Service. This is a read-only field.
  • Title: Resource Type
    The type of the resource.
  • Title: Status
    Allowed Values: [ "active", "inactive" ]
    The status of the resource.
  • Title: Time Format
    The time format of the resource. Allowed Values: [ "12-hour", "24-hour" ].
  • 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.
  • 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.
  • 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 Zones

    This is a read-only field and is only returned in responses.

Nested Schema : Avatar
Type: object
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).

Show Source

Default Response

This section describes the default error response for this operation.
Body ()
Root Schema : Error
Type: object
Show Source
Back to Top

Examples

The following example shows how to update a resource by submitting a PATCH request on the REST resource.

Example of Request Header

The following shows an example of the request header.

PATCH /rest/ofscCore/v1/resources/testPutResourceFYKFZHQOCP HTTP/1.0
Authorization: Basic c29hcEB5YW1hdG86MQ==
Host: <instance_name>.fs.ocs.oraclecloud.com
Accept: */*
Content-Type: application/json; charset=utf-8
Content-Length: 228

Example of Request Body

The following shows an example of the request body.

{
     "parentResourceId": "22",
     "resourceType": "BK",
     "name": "John Bucket",
     "email": "john.bucket@sunrise.demo",
     "phone": "555001100000",
     
}

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 201 Created
Server: nginx/1.6.2
Date: Mon, 06 Jul 2015 13:20:14 GMT
Content-Type: application/json; charset=utf-8
Connection: close

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
        "resourceId": "testPutResourceFYKFZHQOCP",
        "status": "active",
        "parentResourceId": "22",
        "resourceType": "BK",
        "name": "John Bucket",
        "email": "john.bucket@sunrise.demo",
        "phone": "555001100000",
        "language": "en",
        "timeZoneDiff": -240,
        "timeZone": "Eastern",
        "dateFormat": 12,
        "timeFormat": 14,
        "inventories": {
            "links": [
                {
                  "rel": "canonical",
                  "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/testPutResourceFYKFZHQOCP/inventories"
                }
            ]
        },
        "users": {
            "links": [
                {
                  "rel": "canonical",
                  "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/testPutResourceFYKFZHQOCP/users"
                }
            ]
        },
        "serviceRequests": {
            "links": [
                {
                  "rel": "canonical",
                  "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/testPutResourceFYKFZHQOCP/serviceRequests"
                }
            ]
        },
        "workZones": {
            "links": [
                {
                  "rel": "canonical",
                  "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/testPutResourceFYKFZHQOCP/workZones"
                }
            ]
        },
        "workSkills": {
          "links": [
                {
                    "rel": "canonical",
                    "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/testPutResourceFYKFZHQOCP/workSkills"
                }
          ]
        },
        "links": [
          {
                    "rel": "canonical",
                    "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/testPutResourceFYKFZHQOCP"
              },
              {
                    "rel": "describedby",
                    "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/metadata-catalog/resources"
              }
        ]
    }
Back to Top