Get resource descendants

get

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

This operation retrieves all the descendants of the specified resource. Descendant resources are the resources that are located below the specified resource on a resource tree in Oracle Field Service Manage.

Request

Supported Media Types
Path Parameters
Query Parameters
  • If specified, the response will be filtered accordingly to the resource type feature 'Can be a team holder'
  • If specified, the response will be filtered accordingly to the resource type feature 'Can participate in team'
  • Collection Format: csv

    The sub-entities that are embedded into each resource item returned in the response. The value is a comma-separated string containing a combination of the following values: inventories, workZones, workSkills, and workSchedules.

    If one or more values are specified then the appropriate sub-entities are embedded into each resource item. For example, the following query returns the work zones and work skills linked to the specified resource: https://<environment_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/{resourceId}?expand=workZones,workSkills. If the value is not specified then none of the sub-entities are expanded, and they are provided as links that can be retrieved by another call.

    To avoid huge responses, any sub-entity that contains more than 500 items is not expanded, and it is returned as a usual link. The link can be used to retrieve the sub-entity in a separate call using the limit and offset parameters to control the response size.

    • Allowed Values: [ "inventories", "workSkills", "workZones", "workSchedules" ]
  • Collection Format: csv
    The comma-separated names of the resource fields that are returned in the response.
    • If the value of this parameter is not specified, then all the resource fields and custom properties are returned by default.
    • If the resource fields are specified, then only the 'resourceId' field and requested fields are returned. For example: https://<environment_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/john.smith?fields=resourceId,resourceType,status.
    • If incorrect resource fields are specified, then the 400 error code is returned.
  • The number of items to be returned in the response. The minimum value that can be specified is 1 and the maximum value that can be specified is 100. If the specified value is greater than 100, zero, or if no value is specified, then it defaults to 100.
  • The record number from which the retrieval starts. The default value is zero. If no value is specified, then it defaults to zero. The value zero indicates that the retrieval will start from the beginning of the collection.
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation.
Body ()
Root Schema : Resources
Type: object
Title: Resources
The collection of resources.
Show Source
Nested Schema : Items
Type: array
Title: Items
An array of resource items.
Show Source
  • 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.

Nested 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 get resource descendants for resources by submitting a GET request on the REST resource.

Example of Request Header

The following shows an example of the request header.

GET /rest/ofscCore/v1/resources/66000/children/?offset=5&limit=2 HTTP/1.0
Authorization: Basic c29hcEBwZXRyb2xpYXNoZXZ5Y2gucmVzdDox
Host: etadev1f
Accept: */*

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 200 OK
Server: nginx/1.6.3
Date: Wed, 16 Sep 2015 15:32:19 GMT
Content-Type: application/json; charset=utf-8
Connection: close
X-Powered-By: PHP/5.5.28

Example of Response Body

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

{
        "totalResults": 25,
        "limit": 2,
        "offset": 5,
        "items": [
            {
                "resourceId": "660111",
                "status": "active",
                "parentResourceId": "66000",
                "resourceType": "PR",
                "name": "CROUCH, Peter",
                "email": "44011@sunrise.demo",
                "phone": "555004401100",
                "language": "en",
                "timeZoneDiff": -150,
                "timeZone": "Newfoundland",
                "dateFormat": 12,
                "timeFormat": 14,
                "Resource type": "2",
                "gender": "2",
                "inventories": 
...
           }
        ]
}
Back to Top