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
-
akey: string
Allow Empty value:
true
Maximum Length:50
The value of the activity duration key. It appears as 'Appointment Key' in the report. -
includeChildren: boolean
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'.
-
limit: integer
Minimum Value:
1
Maximum Value:10000
The number of records to be returned in the response. -
offset: integer
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. -
resourceId: string
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.
Response
Supported Media Types
- application/json
- application/schema+json
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.
Root Schema : activityDurationsList
Type:
object
The array of items containing the activity duration statistics.
Show Source
Nested Schema : items
Type:
Show Source
array
-
Array of:
object Activity Duration Response
Title:
Activity Duration Response
Nested Schema : Activity Duration Response
Type:
object
Title:
Show Source
Activity Duration Response
-
akey:
string
Title:
Appointment Key
The value of the activity duration key. It appears as 'Appointment Key' in the report. -
avg:
integer
Title:
Average
The average value of the estimated activity duration.Example:10
-
count:
integer
Title:
Count
The number of activities considered for estimation.Example:100
-
dev:
integer
Title:
Deviation
The deviation with respect to the estimated activity duration value.Example:10
-
level:
string
Title:
Level
The level of the resource. It can be 'company', 'aggregate', or 'provider' based on the level of the data. -
override:
integer
Title:
Override
The override value of the activity duration.Example:100
-
resourceId:
string
Title:
Resource ID
The external Identifier of the resource.
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 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" } ] }