Get activity duration statistics

get

/rest/ofscStatistics/v1/activityDurationStats

This operation retrieves a collection of activity duration statistics. The maximum number of records that can be retrieved in a single response is 10000. If there are more than 10000 records, the remaining records can be accessed using the 'next' link available at the bottom of the response.

This operation can be used only when the following conditions are satisfied:

  • The customer must have a subscription to Oracle Field Service Professional or Enterprise Cloud Service.
  • The required application must have permission to access the Statistics API. To grant the permission, navigate to Configuration > Applications screen. For the required application, in the API access section, click Add new and select Statistics API.

Request

Query Parameters
  • Allow Empty value: true
    Maximum Length: 50
    The value of the activity duration key. It appears as 'Appointment Key' in the report.
  • Contains one of the following values: true or false. If true, then the details of child resources are included in the response. If false, then the details of child resources are not included in the response. The default value is 'true'.
  • Minimum Value: 1
    Maximum Value: 10000
    The number of records to be returned in the response.
  • Minimum Value: 0
    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.
  • Maximum Length: 32
    The external identifier of the resource. To fetch the activity duration statistics at the company level, provide '' (single quotes) as the value for this parameter.
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation. The response contains the collection of activity duration statistics. If neither the 'resourceId' nor the 'akey' is specified as a parameter, the application returns the records for all the applicable values.
Body ()
Root Schema : activityDurationsList
Type: object
The array of items containing the activity duration statistics.
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : Activity Duration Response
Type: object
Title: Activity Duration Response
Show Source
  • Title: Appointment Key
    The value of the activity duration key. It appears as 'Appointment Key' in the report.
  • Title: Average
    The average value of the estimated activity duration.
    Example: 10
  • Title: Count
    The number of activities considered for estimation.
    Example: 100
  • Title: Deviation
    The deviation with respect to the estimated activity duration value.
    Example: 10
  • Title: Level
    The level of the resource. It can be 'company', 'aggregate', or 'provider' based on the level of the data.
  • Title: Override
    The override value of the activity duration.
    Example: 100
  • Title: Resource ID
    The external Identifier of the resource.

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 retrieve a collection of activity duration statistics by submitting a GET request on the REST resource using cURL:

cURL command Example

curl -s -u '<CLIENT-ID>@<INSTANCE-NAME>:<CLIENT-SECRET>' -X GET 'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscStatistics/v1/activityDurationStats?resourceId=33000001&include_children=true&akey=11&limit=2&offset=1'

Response Header Example

The following shows an example of the response header.

HTTP/1.1 200 OK
Server: nginx/1.2.7
Date: Mon, 18 Dec 2017 02:20:33 GMT
Content-Type: application/json; charset=utf-8

Response Body Example

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

{
    "totalResults": "296",
    "limit": 2,
    "offset": 1,
    "items": [
        {
            "resourceId": "33000001",
            "akey": "11",
            "override": 0,
            "avg": 35,
            "dev": 13,
            "count": 13,
            "level": "company"
        },
        {
            "resourceId": "33000002",
            "akey": "11",
            "override": 0,
            "avg": 42,
            "dev": 8,
            "count": 8,
            "level": "company"
        }
    ],
    "links": [
        {
            "rel": "canonical",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscStatistics/v1/activityDurationStats?resourceId=33000001&include_children=true&akey=11&limit=2&offset=1"
        },
        {
            "rel": "describedby",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscStatistics/v1/activityDurationStats"
        },
        {
            "rel": "next",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscStatistics/v1/activityDurationStats?resourceId=33000001&include_children=true&akey=11&limit=2&offset=3"
        },
        {
            "rel": "prev",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscStatistics/v1/activityDurationStats?resourceId=33000001&include_children=true&akey=11&limit=2&offset=0"
        }
    ]
}
Back to Top