apivolume-by-owner

The following shows how to generate the apivolume-by-owner 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 number of bytes by client owner.

Business object: account_id

Data available for: 92 days

Required products: EDGECONTROL

Available metrics

MetricDescription
Data metrics
bytesPercentBytes percentage.
bytesTotalThe total bandwidth used for requests

Available filters

FilterTypeDescription
Optional filters
contract_typeStringThe list of accounts and contract type IDs a given user has access to.
endpointStringAn API configuration registered with Akamai.
response_classEnumerationA class of HTTP response status codes, from 0xx through 6xx.
response_codeStringAn HTTP response status code, for example, 201.
response_statusEnumerationAn indicator of whether the HTTP response resulted in success or an error.
usernameStringName of client generating API request.

POST request

POST /reporting-api/v1/reports/apivolume-by-owner/versions/1/report-data{?start,​end}

Sample: /reporting-api/v1/reports/apivolume-by-owner/versions/1/report-data?start​=2020-10-01T00%3A00%3A00Z​&end​=2020-11-01T00%3A00%3A00Z

Query parameters

ParameterTypeSampleDescription
Required
startString2020-10-01T00:00: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-11-01T00: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.

JSON request members

MemberTypeDescription
objectIdsArraySpecifies the set of account_id 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": [
        "account1",
        "account2",
        "account3"
    ],
    "metrics": [
        "bytesPercent",
        "bytesTotal"
    ],
    "filters": {
        "contract_type": [
            "1-3CV382",
            "1-6T5ZND"
        ],
        "endpoint": [
            "endpoint/1",
            "endpoint/2"
        ],
        "response_class": [
            "1xx",
            "4xx"
        ],
        "response_code": [
            "201",
            "200"
        ],
        "response_status": [
            "success",
            "error"
        ],
        "username": [
            "username1",
            "username2"
        ]
    }
}

GET request

GET /reporting-api/v1/reports/apivolume-by-owner/versions/1/report-data{?start,​end,​objectIds,​allObjectIds,​metrics,​filters}

Sample: /reporting-api/v1/reports/apivolume-by-owner/versions/1/report-data?start​=2020-10-01T00%3A00%3A00Z​&end​=2020-11-01T00%3A00%3A00Z​&objectIds​=account1,​account2,​account3​&metrics​=bytesPercent%2CbytesTotal​&filters​=contract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND%2Cendpoint%3Dendpoint%2F1%2Cendpoint%3Dendpoint%2F2

Query parameters

ParameterTypeSampleDescription
Required
startString2020-10-01T00: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.
endString2020-11-01T00:00:00ZSpecifies if unavailable reports should be shown.
allObjectIdsBooleantrueAs an alternative to objectIds, enabling this generates a report that includes all IDs available for the account_id objectType. This parameter is ignored if the request also specifies a set of objectIds.
objectIdsStringaccount1,​account2,​account3As an alternative to allObjectIds, specifies the set of unique IDs for the account_id objectType you want to report on, formatted as a comma-delimited list.
Optional
metricsStringbytesPercent,​bytesTotalSpecifies 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.
filtersStringcontract_type=​1-3CV382,​contract_type=​1-6T5ZND,endpoint=​endpoint/1,​endpoint=​endpoint/2Specifies 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": "apivolume-by-owner",
        "version": "1",
        "outputType": "FLAT",
        "groupBy": [
            "username"
        ],
        "start": "2020-10-01T00:00:00Z",
        "end": "2020-11-01T00:00:00Z",
        "availableDataEnds": null,
        "suggestedRetryTime": null,
        "rowCount": 4,
        "filters": [
            {
                "name": "contract_type",
                "values": [
                    "1-3CV382",
                    "1-6T5ZND"
                ]
            },
            {
                "name": "endpoint",
                "values": [
                    "endpoint/1",
                    "endpoint/2"
                ]
            },
            {
                "name": "response_class",
                "values": [
                    "2xx",
                    "0xx"
                ]
            },
            {
                "name": "response_code",
                "values": [
                    "500",
                    "503"
                ]
            },
            {
                "name": "response_status",
                "values": [
                    "success",
                    "error"
                ]
            },
            {
                "name": "username",
                "values": [
                    "username1",
                    "username2"
                ]
            }
        ],
        "columns": [
            {
                "name": "groupBy",
                "label": "username"
            },
            {
                "name": "bytesPercent",
                "label": "Bytes %"
            },
            {
                "name": "bytesTotal",
                "label": "Total Bytes"
            }
        ],
        "objectType": "account_id",
        "objectIds": [
            "account1",
            "account2",
            "account3"
        ]
    },
    "data": [
        {
            "username": "johndoe1@akamai.com",
            "bytesPercent": "47",
            "bytesTotal": "317"
        },
        {
            "username": "johndoe2@akamai.com",
            "bytesPercent": "72",
            "bytesTotal": "409"
        },
        {
            "username": "janedoe3@akamai.com",
            "bytesPercent": "43",
            "bytesTotal": "3247"
        },
        {
            "username": "janedoe4@akamai.com",
            "bytesPercent": "26",
            "bytesTotal": "2721"
        }
    ],
    "summaryStatistics": {}
}

CSV response

Status 200 text/csv

Response Body:

#METADATA_START
name,​apivolume-by-owner
version,​1
source,​apivolume-by-owner/versions/1
groupBy,​username
start,​2020-10-01T00:00:00Z
end,​2020-11-01T00:00:00Z
availableDataEnds,
suggestedRetryTime,
rowCount,​4
objectType,​account_id
objectIds,​account1,​account2,​account3
contract_type,​1-3CV382,​1-6T5ZND
endpoint,​endpoint/1,​endpoint/2
response_class,​2xx,​0xx
response_code,​500,​503
response_status,​success,​error
username,​username1,​username2
#METADATA_END

#SUMMARYSTATISTICS_START

#SUMMARYSTATISTICS_END

#COLUMNS_START
username,​bytesPercent,​bytesTotal
#COLUMNS_END

#DATA_START
johndoe1,​47,​317
johndoe2,​72,​409
janedoe3,​43,​3247
janedoe4,​26,​2721
#DATA_END

Get report details

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

GET /reporting-api/v1/reports/apivolume-by-owner/versions/1

Status 200 application/json

Response body:

{
    "name": "apivolume-by-owner",
    "businessObjectName": "account_id",
    "version": 1,
    "status": "PUBLISHED",
    "deprecated": false,
    "timeBased": false,
    "supportsPagination": false,
    "outputType": "FLAT",
    "requiredProducts": [
        "EDGECONTROL"
    ],
    "requiredRoles": [
        "IDM: API Clients - Admin Access"
    ],
    "available": true,
    "metrics": [
        {
            "name": "bytesPercent",
            "label": "Bytes %",
            "unit": "RATIO",
            "summaryStatistic": false
        },
        {
            "name": "bytesTotal",
            "label": "Total Bytes",
            "unit": "BYTE",
            "summaryStatistic": false
        }
    ],
    "groupOutlyingValues": {
        "enabled": false
    },
    "groupBy": [
        "username"
    ],
    "filters": [
        {
            "name": "endpoint",
            "type": "string",
            "required": false
        },
        {
            "name": "response_class",
            "type": "enum",
            "values": [
                {
                    "value": "0xx"
                },
                {
                    "value": "1xx"
                },
                {
                    "value": "2xx"
                },
                {
                    "value": "3xx"
                },
                {
                    "value": "4xx"
                },
                {
                    "value": "5xx"
                },
                {
                    "value": "6xx"
                }
            ],
            "required": false
        },
        {
            "name": "username",
            "type": "string",
            "required": false
        },
        {
            "name": "contract_type",
            "type": "string",
            "required": false
        },
        {
            "name": "response_code",
            "type": "string",
            "required": false
        },
        {
            "name": "response_status",
            "type": "enum",
            "values": [
                {
                    "value": "success"
                },
                {
                    "value": "error"
                }
            ],
            "required": false
        }
    ],
    "intervals": [
        "MONTH",
        "WEEK",
        "DAY",
        "HOUR"
    ],
    "dataRetentionDays": 92,
    "limit": 5000,
    "maxLimit": 25000,
    "links": [
        {
            "rel": "self",
            "href": "/reporting-api/v1/reports/apivolume-by-owner/versions/1"
        },
        {
            "rel": "versions",
            "href": "/reporting-api/v1/reports/apivolume-by-owner/versions"
        },
        {
            "rel": "all-reports",
            "href": "/reporting-api/v1/reports"
        },
        {
            "rel": "execute-report",
            "href": "/reporting-api/v1/reports/apivolume-by-owner/versions/1/report-data"
        }
    ]
}