Get airline distance based travel

get

/rest/ofscStatistics/v1/airlineDistanceBasedTravel

This operation retrieves a collection of statistically estimated and override values of airline distance based travel time (in minutes) at the travel key level for the specified distances (in km). You can specify up to five distances. If no distances are specified, the operation retrieves data for 1 km, 5 kms, 10 kms, 20 kms and 50 kms. If no travel key is specified, the operation retrieves data for all possible travel keys will be retrieved. The maximum number of records that can be retrieved in a single response is 10000. If there are more than 10000 records, you can use the 'next' link available at the bottom of the response to access the remaining records.

Before you use this operation, ensure that:

  • You have a subscription to Oracle Field Service Professional or Enterprise Cloud Service.
  • The application has the 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
    Pattern: ^$|^(\d+(,\d+)*)$
    The list of comma separated distances (in km) for which the statistically estimated and override travel time at the travel key level has to be retrieved. Maximum number of distances allowed is 5. If no distance is specified, the application retrieves values for the distances 1, 5, 10, 20, 50.
  • Allow Empty value: true
    Maximum Length: 50
    The value of the travel key. It appears as 'Start Location' and 'End Location' in the Travel Statistics report.

    If 'key' is provided in request and :

    • If 'key' is present in the application, the application estimated and override values for travel time of the travel key is retrieved.
    • If 'key' is not present in the application, HTTP Code 404 response is displayed.

    If 'key' is not provided in request, the application estimated and override values for travel time of all the travel keys are retrieved. If none of the travel keys have application estimated or override values, then HTTP Code 404 response is displayed.

  • Minimum Value: 1

    Key ID of one of the configured travel keys.

    • If the parameter 'keyId' is not specified, data for all travel keys will be retrieved.
    • If 'keyId' is specified and if it exists in the system, data will be retrieved for the travel keys of the corresponding Key ID.
    • If 'keyId' is specified but if it 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.
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 application estimated and override values for travel time at the travel key level for the specified list of distances. If 'key' is not specified as a parameter, the application returns the records for all the travel keys that have either application estimated or override values or both for travel time at the travel key level.
Body ()
Root Schema : airlineDistanceBasedTravelList
Type: object
The array of items containing the statistically estimated and override travel time at travel key level for the specified distances.
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : Travel Key Level estimated and override Travel Time Response
Type: object
Title: Travel Key Level estimated and override Travel Time Response
Show Source
  • Travel Key level estimated and override values of travel time (in minutes).
    Title: Travel Key level estimated and override values of travel time (in minutes).
  • Title: Travel Key
    The value of the travel key. It appears as 'Start Location' and 'End Location' in the Travel Statistics report.
  • 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 is applicable.

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

Nested Schema : Travel Key level estimated and override values of travel time (in minutes).
Type: array
Title: Travel Key level estimated and override values of travel time (in minutes).
Show Source
Nested Schema : List of Organizations
Type: array
Title: List of Organizations

An array of all the Organizations(labels) for which the key is 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
Nested Schema : Travel Key level estimated and override travel time (in minutes) for the list of specified distances.
Type: object
Title: Travel Key level estimated and override travel time (in minutes) for the list of specified distances.
Show Source
  • Title: Distance
    Maximum Value: 999
    The distance (in km) for which the override value of travel time is specified at travel key level.
    Example: 15
  • Title: Statistically estimated Travel Time
    The statistically estimated value for the travel time (in minutes) for the distance at travel key level.
    Example: 25
  • Title: Override Travel Time

    The override value for the travel time (in minutes) for the distance at travel key level.

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

    Example: 28

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 get airline distance based travel by submitting a GET request on the REST resource using cURL:

cURL command Example

curl 'clientId@instance:clientSecret' \
-X GET \
https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscStatistics/v1/airlineDistanceBasedTravel \
  -u '<CLIENT-ID>@<INSTANCE-NAME>:<CLIENT-SECRET>' \
  -H 'content-type: application/json' \

Response Header Example

HTTP/1.1 200 OK
Server: nginx/1.2.7
Date: Mon, Wed, 31 May 2021 11:53:49 GMT
Content-Type: application/json; charset=utf-8

Response Body Example

{
    "totalResults": "1",
    "limit": 10000,
    "offset": 0,
    "items": [
        {
            "key": "32771",
            "keyId": 2,
            "org" : ["Org1", "Org3"],
            "data": [
                {
                    "distance": 1,
                    "estimated": 11,
                    "override": 7
                },
                {
                    "distance": 5,
                    "estimated": 15,
                    "override": 15
                },
                {
                    "distance": 10,
                    "estimated": 20,
                    "override": 25
                },
                {
                    "distance": 20,
                    "estimated": 30,
                    "override": 45
                },
                {
                    "distance": 50,
                    "estimated": 60,
                    "override": 105
                }
            ]
        }
    ],
    "links": [
        {
            "rel": "canonical",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscStatistics/v1/airlineDistanceBasedTravel?key=32771"
        },
        {
            "rel": "describedby",
            "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscStatistics/v1/airlineDistanceBasedTravel"
        }
    ]
}
Back to Top