upsrtraffic-by-time report
The following shows how to generate the
upsrtraffic-by-time
report using either the Reporting API’s
Generate a report POST operation or the
Get a cacheable report GET operation.
Details about each report’s supported products, metrics, filters, and
available data intervals are also available dynamically by running the
API’s Get a report type operation,
also shown below. See also other available reports.
Report definition
Provides the percentage of traffic for which SureRoute provided a faster route for responses. Since this report only produces daily data, the only valid interval value is DAY.
This report allows you to configure the aggregation interval for each data record. Available interval
values are: MONTH
, WEEK
, DAY
, HOUR
, FIVE_MINUTES
.
Business object: cpcode
Data available for: 92 days
Available metrics
Metric | Description | |
---|---|---|
Data metrics | ||
routeOptimization |
Route optimization percentage. | |
Summary metrics | ||
avgRouteOptimization |
Average route optimization percentage. | |
avgRouteOptimization |
The average highest percentage of requests for which SureRoute provided a faster route. | |
avgRouteOptimization |
The average lowest percentage of requests for which SureRoute provided a faster route. | |
avgRouteOptimization |
Average route optimization percentage slope. |
Sample report
POST /reporting-api/v1/reports/upsrtraffic-by-time/versions/2/report-data{?start,end,interval}
Sample: /reporting-api/v1/reports/upsrtraffic-by-time/versions/2/report-data?start=2020-06-26T13%3A40%3A00Z&end=2020-06-26T14%3A00%3A00Z&interval=FIVE_MINUTES
Object type: Query
Download schema: report-request-schema.json
Query parameters
Parameter | Type | Sample | Description |
---|---|---|---|
Required | |||
start |
String | 2020-06-26T13:40:00Z |
Specifies the start of the reported period as an ISO–8601 timestamp with optional time zone. The report includes data that matches the start value’s timestamp. |
end |
String | 2020-06-26T14:00:00Z |
Specifies the end of the reported period as an ISO–8601 timestamp with optional time zone. The report excludes any data that matches the end value’s timestamp. |
interval |
Enumeration | FIVE_MINUTES |
The duration of each data record. Available values: MONTH , WEEK , DAY , HOUR , FIVE_MINUTES . |
JSON request members
Member | Type | Description |
---|---|---|
objectIds |
Array | Specifies the set of cpcode values you want to report on. |
objectIds |
Enumeration | As an alternative to an array of ID values, specify all as a string for unfiltered data. Either way, objectIds is required. |
metrics |
Array | The set of desired metrics. If omitted, the report includes all available metrics. |
Request body:
{
"objectIds": [
"55232",
"23433",
"32433"
],
"metrics": [
"avgRouteOptimizationPercent",
"avgRouteOptimizationPercentMax",
"avgRouteOptimizationPercentMin",
"avgRouteOptimizationPercentSlope",
"routeOptimizationPercent"
]
}
GET /reporting-api/v1/reports/upsrtraffic-by-time/versions/2/report-data{?start,end,interval,objectIds,allObjectIds,metrics}
Sample: /reporting-api/v1/reports/upsrtraffic-by-time/versions/2/report-data?start=2020-06-26T13%3A40%3A00Z&end=2020-06-26T14%3A00%3A00Z&interval=FIVE_MINUTES&objectIds=55232,23433,32433&metrics=avgRouteOptimizationPercent%2CavgRouteOptimizationPercentMax
Query parameters
Parameter | Type | Sample | Description |
---|---|---|---|
Required | |||
start |
String | 2020-06-26T13:40:00Z |
Specifies the end of the reported period as an ISO–8601 timestamp with optional time zone. The report excludes any data that matches the end value’s timestamp. |
end |
String | 2020-06-26T14:00:00Z |
Specifies if unavailable reports should be shown. |
interval |
Enumeration | FIVE_MINUTES |
The duration of each data record. Available values: MONTH , WEEK , DAY , HOUR , FIVE_MINUTES . |
Optional | |||
allObjectIds |
Boolean | true |
As an alternative to objectIds , enabling this generates a report that includes all IDs available for the cpcode objectType. This parameter is ignored if the request also specifies a set of objectIds. |
objectIds |
String | 55232,23433,32433 |
As an alternative to allObjectIds , specifies the set of unique IDs for the cpcode objectType you want to report on, formatted as a comma-delimited list. |
metrics |
String | avgRouteOptimization |
Specifies a comma-separated list of metrics to include in the report, otherwise all metrics if omitted. The set of available metrics depends on the type of report. URL-encode the entire value in the GET request. |
Status 200
application/json
Object type: Report
Download schema: report-response-schema.json
Response body:
{
"metadata": {
"name": "upsrtraffic-by-time",
"version": "2",
"outputType": "FLAT",
"groupBy": [
"startdatetime"
],
"interval": "FIVE_MINUTES",
"start": "2020-06-26T13:40:00Z",
"end": "2020-06-26T14:00:00Z",
"availableDataEnds": null,
"suggestedRetryTime": null,
"rowCount": 4,
"filters": [],
"columns": [
{
"name": "groupBy",
"label": "startdatetime"
},
{
"name": "routeOptimizationPercent",
"label": "Optimization %"
}
],
"objectType": "cpcode",
"objectIds": [
"55232",
"23433",
"32433"
]
},
"data": [
{
"startdatetime": "2020-06-26T13:40:00Z",
"routeOptimizationPercent": "63"
},
{
"startdatetime": "2020-06-26T13:45:00Z",
"routeOptimizationPercent": "91"
},
{
"startdatetime": "2020-06-26T13:50:00Z",
"routeOptimizationPercent": "9"
},
{
"startdatetime": "2020-06-26T13:55:00Z",
"routeOptimizationPercent": "70"
}
],
"summaryStatistics": {
"avgRouteOptimizationPercent": {
"value": "37",
"details": {}
},
"avgRouteOptimizationPercentMax": {
"value": "10",
"details": {}
},
"avgRouteOptimizationPercentMin": {
"value": "87",
"details": {}
},
"avgRouteOptimizationPercentSlope": {
"value": "3165",
"details": {}
}
}
}
Status 200
text/csv
Response Body:
#METADATA_START
name,upsrtraffic-by-time
version,2
source,upsrtraffic-by-time/versions/2
groupBy,startdatetime
start,2020-06-26T13:40:00Z
end,2020-06-26T14:00:00Z
interval,`FIVE_MINUTES`
availableDataEnds,
suggestedRetryTime,
rowCount,4
objectType,cpcode
objectIds,55232,23433,32433
#METADATA_END
#SUMMARYSTATISTICS_START
avgRouteOptimizationPercent,37
avgRouteOptimizationPercentMax,10
avgRouteOptimizationPercentMin,87
avgRouteOptimizationPercentSlope,3165
#SUMMARYSTATISTICS_END
#COLUMNS_START
startdatetime,routeOptimizationPercent
#COLUMNS_END
#DATA_START
2020-06-26T13:40:00Z,63
2020-06-26T13:45:00Z,91
2020-06-26T13:50:00Z,9
2020-06-26T13:55:00Z,70
#DATA_END
Get report details
This sample
Get a report type
operation gets the same information you need to run the
upsrtraffic-by-time
report as provided in this reference documentation,
but available dynamically to your API client application.
GET /reporting-api/v1/reports/upsrtraffic-by-time/versions/2
Status 200
application/json
Object type: ReportType
Download schema: data-row-schema.json
Response body:
{
"name": "upsrtraffic-by-time",
"description": "Provides the percentage of traffic for which SureRoute provided a faster route for responses. Since this report only produces daily data, the only valid interval value is DAY.",
"businessObjectName": "cpcode",
"version": 2,
"status": "PUBLISHED",
"deprecated": false,
"timeBased": true,
"outputType": "FLAT",
"requiredRoles": [
"Widget Reports - View Only",
"OTA App User"
],
"available": true,
"metrics": [
{
"name": "avgRouteOptimizationPercent",
"description": "Average route optimization percentage.",
"label": "Average Route Optimization %",
"unit": "RATIO",
"summaryStatistic": true
},
{
"name": "avgRouteOptimizationPercentMin",
"description": "The average lowest percentage of requests for which SureRoute provided a faster route.",
"label": "Average Route Optimization % Min",
"unit": "RATIO",
"summaryStatistic": true
},
{
"name": "avgRouteOptimizationPercentSlope",
"description": "Average route optimization percentage slope.",
"label": "Average Route Optimization % Slope",
"unit": "COUNT",
"summaryStatistic": true
},
{
"name": "avgRouteOptimizationPercentMax",
"description": "The average highest percentage of requests for which SureRoute provided a faster route.",
"label": "Average Route Optimization % Max",
"unit": "RATIO",
"summaryStatistic": true
},
{
"name": "routeOptimizationPercent",
"description": "Route optimization percentage.",
"label": "Optimization %",
"unit": "RATIO",
"summaryStatistic": false
}
],
"groupOutlyingValues": {
"enabled": false
},
"groupBy": [
"startdatetime"
],
"intervals": [
"MONTH",
"WEEK",
"DAY",
"HOUR",
"FIVE_MINUTES"
],
"dataRetentionDays": 92,
"links": [
{
"rel": "self",
"href": "/reporting-reports-executor-api/v1/reports/upsrtraffic-by-time/versions/2"
},
{
"rel": "versions",
"href": "/reporting-reports-executor-api/v1/reports/upsrtraffic-by-time/versions"
},
{
"rel": "all-reports",
"href": "/reporting-reports-executor-api/v1/reports"
},
{
"rel": "execute-report",
"href": "/reporting-reports-executor-api/v1/reports/upsrtraffic-by-time/versions/2/report-data"
}
]
}