Update airline distance based travel

patch

/rest/ofscStatistics/v1/airlineDistanceBasedTravel

This operation overrides the airline distance based travel time (in minutes) at the travel key level.

For the specified travel key, the application considers the provided pair of distances (in km) and override values (in minutes) to calculate the corresponding override values for all possible distances. Airline distance based travel time for the travel key is based on these values, instead of the estimated values. The override values are stored in the application along with the corresponding statistically estimated values. If overrides are specified, then the override values are used instead of the statistically estimated values. However, the statistically estimated value is updated based on the new travels reported. At any point of time, you can stop using the overrides by importing the data again with value '-1' in one of the 'override' fields. In such cases, the application uses the statistically estimated value for the airline distance based travel time estimates for the travel key.

The limit for each API request is 10000 records. To update more records, you can use multiple requests.

Note: When the Statistics API is used to make airline distance based travel changes, the changes are reflected for all future travels in the application only after the next run of the statistics agent. The statistics agent is run once a day, usually in the early morning hours.

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.
  • If 'Detect activity travel keys automatically' is checked in Statistics configuration, then this API cannot be used.

Request

Body ()
This section describes the request body parameters for this operation.
Root Schema : airlineDistanceBasedTravelRequestList
Type: object
The schema of the request body object for this operation.
Show Source
Nested Schema : items
Type: array
Minimum Number of Items: 1
Maximum Number of Items: 10000
Show Source
Nested Schema : Travel Key Request
Type: object
Title: Travel Key Request
Show Source
  • data
    Minimum Number of Items: 1
    Maximum Number of Items: 2
  • Title: Travel Key
    Maximum Length: 50
    The value of the travel key. It appears as 'Start Location' and 'End Location' in the Travel Statistics report.
  • Title: Key ID
    Maximum Length: 99999

    Key ID of one of the configured travel keys.

    • If 'keyId' is not specified, data corresponding to the default travel key will be updated.
    • If 'keyId' is specified and if it exists in the system, data will be updated for the corresponding key.
    • If 'keyId' is specified but does not exist in the system, an error message will be returned
Nested Schema : data
Type: array
Minimum Number of Items: 1
Maximum Number of Items: 2
Show Source
Nested Schema : Travel Key Override Data
Type: object
Title: Travel Key Override Data
Show Source
  • Minimum Value: -1
    Maximum Value: 999
    The distance (in km) for which the override value of travel time is specified at travel key level. For example, 15
  • Minimum Value: -1
    Maximum Value: 999
    The override value for the travel time (in minutes) that needs to be set for the distance at travel key level. For example, 25
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation.
Body ()
Root Schema : airlineDistanceBasedTravelPatchResponse
Type: object
Show Source
Nested Schema : results
Type: object
Show Source

409 Response

The API returns the HTTP 409 status code error with the description, 'Cannot override airline distance based travel time if Activity Travel Keys are detected automatically' if 'Detect activity travel keys automatically' is checked in Statistics configuration.

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

cURL command Example

curl -X PATCH \
  https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscStatistics/v1/airlineDistanceBasedTravel \
  -u '<CLIENT-ID>@<INSTANCE-NAME>:<CLIENT-SECRET>' \
  -H 'content-type: application/json' \
  -d '{
	"items" : [ {
                "key" : "32771",
                "keyId": 4,
                "data" : [ {
                              "distance" : 10,
                              "override" : 25
                        }, {
                               "distance" : 50,
                              "override" : 53
                        } ]
                  } ]
    }

Response Header Example

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

Response Body Example

{
    "status": "OK",
    "updatedrecords": 2
}
Back to Top