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.

The error message 'Invalid Resource ID provided in request' is displayed for the HTTP Code 400 response on this operation.

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
  • 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'.
  • 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 system 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

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 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>.etadirect.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>.etadirect.com/rest/ofscStatistics/v1/activityDurationStats?resourceId=33000001&include_children=true&akey=11&limit=2&offset=1"
        },
        {
            "rel": "describedby",
            "href": "https://<instance_name>.etadirect.com/rest/ofscStatistics/v1/activityDurationStats"
        },
        {
            "rel": "next",
            "href": "https://<instance_name>.etadirect.com/rest/ofscStatistics/v1/activityDurationStats?resourceId=33000001&include_children=true&akey=11&limit=2&offset=3"
        },
        {
            "rel": "prev",
            "href": "https://<instance_name>.etadirect.com/rest/ofscStatistics/v1/activityDurationStats?resourceId=33000001&include_children=true&akey=11&limit=2&offset=0"
        }
    ]
}
Back to Top