Get activity travel statistics
/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
-
fkey: string
Allow Empty value:
trueMaximum Length:50The travel key value corresponding to the starting location of the travel. For example, 'SRT D3'. -
keyId: integer
Minimum Value:
1Key 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.
-
limit: integer
Minimum Value:
1Maximum Value:10000The number of records to be returned in the response. -
offset: integer
Minimum Value:
0The 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. -
region: string
The label for the region. For example, 'xyz_enterprise'.
-
tkey: string
Allow Empty value:
trueMaximum Length:50The travel key value corresponding to the destination of the travel. For example, '11 AY'.
Response
- application/schema+json
- application/json
200 Response
objectarray-
Array of:
object Activity Travel
Title:
Activity Travel
objectActivity Travel-
avg:
integer
Title:
AverageThe average value of the estimated travel duration.Example:10 -
count:
integer
Title:
CountThe number of travels considered for the travel duration estimation.Example:100 -
dev:
integer
Title:
DeviationThe deviation with respect to the estimated travel duration value.Example:10 -
fkey:
string
Title:
From KeyThe travel key value corresponding to the starting location of the travel. For example, 'SRT D3'. -
keyId:
integer
Title:
Key IDKey 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 -
org:
array List of Organizations
Title:
List of OrganizationsAn 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.
-
override:
integer
Title:
OverrideThe 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 -
region:
string
Title:
Region LabelThe label for the region. For example, 'xyz_enterprise'. -
tkey:
string
Title:
To KeyThe travel key value corresponding to the destination of the travel. For example, '11 AY'.
arrayList of OrganizationsAn 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.
-
Array of:
string
Title:
Organization label
Default Response
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 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®ion=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®ion=xyz_enterprise"
},
{
"rel": "describedby",
"href":"https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscStatistics/v1/activityTravelStats"
}
]
}