endpoint-api-key-usage-by-time

The following shows how to generate the endpoint-api-key-usage-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

Shows usage of API keys for given API endpoint in time.

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: 90 days

Required products: API Gateway

Available metrics

MetricDescription
Data metrics
edgeBytesThe volume for the amount of API traffic that left the Akamai network.
edgeHitsThe request count delivered from Akamai edge servers to the end user.
midgressBytesThe volume for the amount of internal API traffic exchanged between Akamai edge servers.
Summary metrics
edgeBytesMaxThe highest volume for the amount of API traffic that left the Akamai network.
edgeBytesMinThe lowest volume for the amount of API traffic that left the Akamai network.
edgeBytesTotalThe total volume of edge traffic for given objects and filters.
edgeHitsMaxThe highest number of requests.
edgeHitsMinThe lowest number of requests.
edgeHitsTotalThe total number of edge requests for given objects and filters.
midgressBytesMaxThe highest volume for the amount of internal API traffic exchanged between Akamai edge servers.
midgressBytesMinThe lowest volume for the amount of internal API traffic exchanged between Akamai edge servers.
midgressBytesTotalThe total volume for the amount of internal API traffic exchanged between Akamai edge servers.

Available filters

FilterTypeDescription
Optional filters
api_keyIntegerAPI key for which to show quota usage.
endpoint_idIntegerAPI endpoint for which to show usage

POST request

POST /reporting-api/v1/reports/endpoint-api-key-usage-by-time/versions/1/report-data{?start,​end,​interval}

Sample: /reporting-api/v1/reports/endpoint-api-key-usage-by-time/versions/1/report-data?start​=2020-06-26T13%3A40%3A00Z​&end​=2020-06-26T14%3A00%3A00Z​&interval​=FIVE_MINUTES

Query parameters

ParameterTypeSampleDescription
Required
startString2020-06-26T13:40:00ZSpecifies 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.
endString2020-06-26T14:00:00ZSpecifies 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.
intervalEnumerationFIVE_MINUTESThe duration of each data record. Available values: MONTH, WEEK, DAY, HOUR, FIVE_MINUTES.

JSON request members

MemberTypeDescription
objectIdsArraySpecifies the set of cpcode values you want to report on.
objectIdsEnumerationAs an alternative to an array of ID values, specify all as a string for unfiltered data. Either way, objectIds is required.
metricsArrayThe set of desired metrics. If omitted, the report includes all available metrics.
filtersMap of arraysSpecifies a set of custom filters, with each filter's name keying an array with each filter's set of values.

Request body:

{
    "objectIds": [
        "55232",
        "23433",
        "32433"
    ],
    "metrics": [
        "edgeBytes",
        "edgeBytesMax",
        "edgeBytesMin",
        "edgeBytesTotal",
        "edgeHits",
        "edgeHitsMax",
        "edgeHitsMin",
        "edgeHitsTotal",
        "midgressBytes",
        "midgressBytesMax",
        "midgressBytesMin",
        "midgressBytesTotal"
    ],
    "filters": {
        "api_key": [
            "577595",
            "577599"
        ],
        "endpoint_id": [
            "577595",
            "577597"
        ]
    }
}

GET request

GET /reporting-api/v1/reports/endpoint-api-key-usage-by-time/versions/1/report-data{?start,​end,​interval,​objectIds,​allObjectIds,​metrics,​filters}

Sample: /reporting-api/v1/reports/endpoint-api-key-usage-by-time/versions/1/report-data?start​=2020-06-26T13%3A40%3A00Z​&end​=2020-06-26T14%3A00%3A00Z​&interval​=FIVE_MINUTES​&objectIds​=55232,​23433,​32433​&metrics​=edgeBytes%2CedgeBytesMax​&filters​=api_key%3D577595%2Capi_key%3D577599%2Cendpoint_id%3D577598%2Cendpoint_id%3D577596

Query parameters

ParameterTypeSampleDescription
Required
startString2020-06-26T13:40:00ZSpecifies 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.
endString2020-06-26T14:00:00ZSpecifies if unavailable reports should be shown.
intervalEnumerationFIVE_MINUTESThe duration of each data record. Available values: MONTH, WEEK, DAY, HOUR, FIVE_MINUTES.
Optional
allObjectIdsBooleantrueAs 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.
objectIdsString55232,​23433,​32433As 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.
metricsStringedgeBytes,​edgeBytesMaxSpecifies 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.
filtersStringapi_key=​577595,​api_key=​577599,​endpoint_id=​577598,​endpoint_id=​577596Specifies criteria to filter the report's data. The set of available filters depends on the type of report. Separate each filter name and value with an equals (=) character, and separate various name/value pairs with commas (,). To specify more than one filter value, repeat the filter name. See the accompanying example for guidance. URL-encode the entire value in the GET request.

JSON response

Status 200 application/json

Response body:

{
    "metadata": {
        "name": "endpoint-api-key-usage-by-time",
        "version": "1",
        "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": [
            {
                "name": "api_key",
                "values": [
                    "577595",
                    "577597"
                ]
            },
            {
                "name": "endpoint_id",
                "values": [
                    "577596",
                    "577595"
                ]
            }
        ],
        "columns": [
            {
                "name": "groupBy",
                "label": "startdatetime"
            },
            {
                "name": "edgeBytes",
                "label": "Edge Bytes"
            },
            {
                "name": "edgeHits",
                "label": "Edge Bytes"
            },
            {
                "name": "midgressBytes",
                "label": "Midgress Bytes"
            }
        ],
        "objectType": "cpcode",
        "objectIds": [
            "55232",
            "23433",
            "32433"
        ]
    },
    "data": [
        {
            "startdatetime": "2020-06-26T13:40:00Z",
            "edgeBytes": "3638",
            "edgeHits": "3634",
            "midgressBytes": "4487"
        },
        {
            "startdatetime": "2020-06-26T13:45:00Z",
            "edgeBytes": "720",
            "edgeHits": "581",
            "midgressBytes": "3309"
        },
        {
            "startdatetime": "2020-06-26T13:50:00Z",
            "edgeBytes": "4624",
            "edgeHits": "4330",
            "midgressBytes": "157"
        },
        {
            "startdatetime": "2020-06-26T13:55:00Z",
            "edgeBytes": "4636",
            "edgeHits": "4002",
            "midgressBytes": "1488"
        }
    ],
    "summaryStatistics": {
        "edgeBytesMax": {
            "value": "3245",
            "details": {}
        },
        "edgeBytesMin": {
            "value": "4737",
            "details": {}
        },
        "edgeBytesTotal": {
            "value": "4145",
            "details": {}
        },
        "edgeHitsMax": {
            "value": "3652",
            "details": {}
        },
        "edgeHitsMin": {
            "value": "1963",
            "details": {}
        },
        "edgeHitsTotal": {
            "value": "1859",
            "details": {}
        },
        "midgressBytesMax": {
            "value": "2688",
            "details": {}
        },
        "midgressBytesMin": {
            "value": "3483",
            "details": {}
        },
        "midgressBytesTotal": {
            "value": "1164",
            "details": {}
        }
    }
}

CSV response

Status 200 text/csv

Response Body:

#METADATA_START
name,​endpoint-api-key-usage-by-time
version,​1
source,​endpoint-api-key-usage-by-time/versions/1
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
api_key,​577595,​577597
endpoint_id,​577596,​577595
#METADATA_END

#SUMMARYSTATISTICS_START
edgeBytesMax,​3245
edgeBytesMin,​4737
edgeBytesTotal,​4145
edgeHitsMax,​3652
edgeHitsMin,​1963
edgeHitsTotal,​1859
midgressBytesMax,​2688
midgressBytesMin,​3483
midgressBytesTotal,​1164
#SUMMARYSTATISTICS_END

#COLUMNS_START
startdatetime,​edgeBytes,​edgeHits,​midgressBytes
#COLUMNS_END

#DATA_START
2020-06-26T13:40:00Z,3638,​3634,​4487
2020-06-26T13:45:00Z,720,​581,​3309
2020-06-26T13:50:00Z,4624,​4330,​157
2020-06-26T13:55:00Z,4636,​4002,​1488
#DATA_END

Get report details

This sample Get a report type operation gets the same information you need to run the endpoint-api-key-usage-by-time report as provided in this reference documentation, but available dynamically to your API client application.

GET /reporting-api/v1/reports/endpoint-api-key-usage-by-time/versions/1

Status 200 application/json

Response body:

{
    "name": "endpoint-api-key-usage-by-time",
    "description": "Shows usage of API keys for given API endpoint in time.",
    "businessObjectName": "cpcode",
    "version": 1,
    "status": "PUBLISHED",
    "deprecated": false,
    "timeBased": true,
    "outputType": "FLAT",
    "requiredProducts": [
        "API Gateway"
    ],
    "requiredRoles": [
        "API Gateway Viewer",
        "API Gateway Administrator"
    ],
    "available": true,
    "metrics": [
        {
            "name": "edgeBytes",
            "description": "The volume for the amount of API traffic that left the Akamai network.",
            "label": "Edge Bytes",
            "unit": "BYTE",
            "summaryStatistic": false
        },
        {
            "name": "edgeBytesMax",
            "description": "The highest volume for the amount of API traffic that left the Akamai network.",
            "label": "Edge Bytes Max",
            "unit": "BYTE",
            "summaryStatistic": true
        },
        {
            "name": "edgeBytesMin",
            "description": "The lowest volume for the amount of API traffic that left the Akamai network.",
            "label": "Edge Bytes Min",
            "unit": "BYTE",
            "summaryStatistic": true
        },
        {
            "name": "edgeBytesTotal",
            "description": "The total volume of edge traffic for given objects and filters.",
            "label": "Total Edge Bytes",
            "unit": "BYTE",
            "summaryStatistic": true
        },
        {
            "name": "edgeHits",
            "description": "The request count delivered from Akamai edge servers to the end user.",
            "label": "Edge Bytes",
            "unit": "COUNT",
            "summaryStatistic": false
        },
        {
            "name": "edgeHitsMax",
            "description": "The highest number of requests.",
            "label": "Edge Hits Max",
            "unit": "COUNT",
            "summaryStatistic": true
        },
        {
            "name": "edgeHitsMin",
            "description": "The lowest number of requests.",
            "label": "Edge Hits Min",
            "unit": "COUNT",
            "summaryStatistic": true
        },
        {
            "name": "edgeHitsTotal",
            "description": "The total number of edge requests for given objects and filters.",
            "label": "Total Edge Hits",
            "unit": "COUNT",
            "summaryStatistic": true
        },
        {
            "name": "midgressBytes",
            "description": "The volume for the amount of internal API traffic exchanged between Akamai edge servers. ",
            "label": "Midgress Bytes",
            "unit": "BYTE",
            "summaryStatistic": false
        },
        {
            "name": "midgressBytesMax",
            "description": "The highest volume for the amount of internal API traffic exchanged between Akamai edge servers.",
            "label": "Midgress Bytes Max",
            "unit": "BYTE",
            "summaryStatistic": true
        },
        {
            "name": "midgressBytesMin",
            "description": "The lowest volume for the amount of internal API traffic exchanged between Akamai edge servers.",
            "label": "Midgress Bytes Min",
            "unit": "BYTE",
            "summaryStatistic": true
        },
        {
            "name": "midgressBytesTotal",
            "description": "The total volume for the amount of internal API traffic exchanged between Akamai edge servers.",
            "label": "Total Midgress Bytes",
            "unit": "BYTE",
            "summaryStatistic": true
        }
    ],
    "groupOutlyingValues": {
        "enabled": false
    },
    "groupBy": [
        "startdatetime"
    ],
    "filters": [
        {
            "name": "api_key",
            "type": "int",
            "description": "API key for which to show quota usage.",
            "required": false
        },
        {
            "name": "endpoint_id",
            "type": "int",
            "description": "API endpoint for which to show usage",
            "required": false
        }
    ],
    "intervals": [
        "MONTH",
        "WEEK",
        "DAY",
        "HOUR",
        "FIVE_MINUTES"
    ],
    "dataRetentionDays": 90,
    "links": [
        {
            "rel": "self",
            "href": "/reporting-api/v1/reports/endpoint-api-key-usage-by-time/versions/1"
        },
        {
            "rel": "versions",
            "href": "/reporting-api/v1/reports/endpoint-api-key-usage-by-time/versions"
        },
        {
            "rel": "all-reports",
            "href": "/reporting-api/v1/reports"
        },
        {
            "rel": "execute-report",
            "href": "/reporting-api/v1/reports/endpoint-api-key-usage-by-time/versions/1/report-data"
        }
    ]
}