Get activity travel statistics

get

/rest/ofscStatistics/v1/activityTravelStats

This operation retrieves a collection of activity travel statistics at the company level. 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 travel key value corresponding to the starting location of the travel. For example, 'SRT D3'.
  • Minimum Value: 1

    Key ID of one of the configured travel keys.

    • If the parameter 'keyId' is not specified, data for all travel key pairs will be retrieved.
    • If 'keyId' is specified and if it exists in the system, data will be retrieved for the travel key pairs of the corresponding Key ID.
    • If 'keyId' is specified but if does not exist in the system, an error message will be returned

    If 'Detect activity travel keys automatically' is checked in Statistics configuration, then this parameter will be ignored.

  • 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.
  • The label for the region. For example, 'xyz_enterprise'.
  • Allow Empty value: true
    Maximum Length: 50
    The travel key value corresponding to the destination of the travel. For example, '11 AY'.
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 travel statistics. If any of the listed request parameters are not specified, all the available records are returned.
Body ()
Root Schema : activityTravelsList
Type: object
The array of items containing the activity travel statistics.
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : Activity Travel
Type: object
Title: Activity Travel
Show Source
  • Title: Average
    The average value of the estimated travel duration.
    Example: 10
  • Title: Count
    The number of travels considered for the travel duration estimation.
    Example: 100
  • Title: Deviation
    The deviation with respect to the estimated travel duration value.
    Example: 10
  • Title: From Key
    The travel key value corresponding to the starting location of the travel. For example, 'SRT D3'.
  • Title: Key ID

    Key ID of one of the configured travel keys.

    If 'Detect activity travel keys automatically' is checked in Statistics configuration, then this field will not be returned as part of the response.

    Example: 100
  • List of Organizations
    Title: List of Organizations

    An array of all the Organizations(labels) for which the key pairs are applicable.

    If 'Detect activity travel keys automatically' is checked in Statistics configuration, then this field will not be returned as part of the response.

  • Title: Override

    The override value for the activity travel duration that is set for the 'fkey' and 'tkey' combination.

    If 'Detect activity travel keys automatically' is checked in Statistics configuration, then this field will not be returned as part of the response.

    Example: 100
  • Title: Region Label
    The label for the region. For example, 'xyz_enterprise'.
  • Title: To Key
    The travel key value corresponding to the destination of the travel. For example, '11 AY'.
Nested Schema : List of Organizations
Type: array
Title: List of Organizations

An array of all the Organizations(labels) for which the key pairs are applicable.

If 'Detect activity travel keys automatically' is checked in Statistics configuration, then this field will not be returned as part of the response.

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 retrieve a collection of activity travel statistics at the company level 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/activityTravelStats?tkey=79764&fkey=79763&region=xyz_enterprise'

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": "1",
    "limit": 10000,
    "offset": 0,
    "items": [
        {
            "tkey": "79764",
            "fkey": "79763",
            "override": 10,
            "avg": 11,
            "dev": 1,
            "count": 5,
            "region": "xyz_enterprise",
            "keyId": 1,
            "org" : ["Org1", "Org3"]
        }
    ],
    "links": [
        {
            "rel": "canonical",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscStatistics/v1/activityTravelStats?tkey=79764&fkey=79763&region=xyz_enterprise"
        },
        {
            "rel": "describedby",
         "href":"https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscStatistics/v1/activityTravelStats"
        }
    ]
}
Back to Top