apiusagedetails-by-time

The following shows how to generate the apiusagedetails-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

This report allows you to audit details of the latest individual API calls for a given timeframe.

Business object: account_id

Data available for: 92 days

Required products: EDGECONTROL

Available metrics

MetricDescription
Data metrics
clientIdID of client generating API request.
clientIpIP generating API request.
clientOwnerUsername of client owner.
clientTokenClient token used for generating API request.
methodA request method indicating the action performed on a resource.
responseCodeResponse code for the API request.
timestampDate and time of API request.
uriAPI request details.

Available filters

FilterTypeDescription
Optional filters
client_tokenStringClient token used for generating an API request.
contract_typeStringContract type.
endpointStringAn API endpoint enabled by Akamai.
http_methodEnumerationA request method indicating the action performed on a resource.
head: Retrieves header information about the target resource, with no message body in the response.
post: Sends information to the server.
get: Retrieves information about the target resource.
notcare: Not care.
delete: Removes all information about the target resource.
put: Replaces existing information about the target resource.
response_classEnumerationA class of HTTP response status codes, from 0xx through 6xx.
0xx: An aborted action on the client side.
1xx: An informational response, like Continue.
2xx: A successful response.
3xx: Success, but a redirect where the thing you want is somewhere else.
4xx: Error, where there's some problem with the client request.
5xx: Error, where there's some problem with how the API server responded to the client request.
6xx: Invalid headers (defined by Akamai).
response_codeStringAn HTTP response status code, for example, 201.
response_statusEnumerationAn indicator of whether the HTTP response resulted in success or an error.
success: Successful HTTP response status.
error: Error HTTP response status.Y
url_containStringURL contains the specified string.
url_end_withStringURL ends with the specified string.
url_exact_matchStringURL is an exact match for the specified string.
url_matchStringURL matches the specified string.
url_not_containStringURL does not contain the specified string.
url_not_end_withStringURL does not end with the specified string.
url_not_matchStringURL does not match the specified string.
url_not_start_withStringURL does not start with the specified string.
url_start_withStringURL starts with the specified string.
usernameStringName of client generating API request.

POST request

POST /reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data{?start,​end,​page,​pageSize}

Sample: /reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data?start​=2021-06-01T00%3A00%3A00Z​&end​=2021-07-01T00%3A00%3A00Z​&page​=2​&pageSize​=4

Query parameters

ParameterTypeSampleDescription
Required
startString2021-06-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.
endString2021-07-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.
Optional
dataWrapNumberOfItemsNumber2Number of top values to be yield in response. Special values: 0 - will group all values to single record, -1 - will disable outlaying values grouping.
dataWrapLabelStringOtherLabel used as title for grouped record of data which is wrapped.
pageNumber2Selected page of data. If one of the page parameters is passed, the other not present is set to default. Default value: 1
pageSizeNumber4Selected size of data per single page. If one of the page parameters is passed, other not present is set to default. Default value: 25

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": [
        "1-123A",
        "1-1TGTG",
        "1-1TJZFB"
    ],
    "metrics": [
        "clientId",
        "clientIp",
        "clientOwner",
        "clientToken",
        "method",
        "responseCode",
        "timestamp",
        "uri"
    ],
    "filters": {
        "client_token": [
            "token_1",
            "token_2"
        ],
        "contract_type": [
            "1-3CV382",
            "1-6T5ZND"
        ],
        "endpoint": [
            "endpoint/1",
            "endpoint/2"
        ],
        "http_method": [
            "get",
            "put"
        ],
        "response_class": [
            "4xx",
            "1xx"
        ],
        "response_code": [
            "404",
            "201"
        ],
        "response_status": [
            "success",
            "error"
        ],
        "url_contain": [
            "/shop",
            "/about"
        ],
        "url_end_with": [
            ".html",
            ".jsp"
        ],
        "url_exact_match": [
            "https://www.example.com/shop/index.html",
            "https://www.example.com/about/index.html"
        ],
        "url_match": [
            "https://www.example.com/shop",
            "https://www.example.com/about"
        ],
        "url_not_contain": [
            "/blog",
            "/contact"
        ],
        "url_not_end_with": [
            ".css",
            ".js"
        ],
        "url_not_match": [
            "https://www.example.com/blog",
            "https://www.example.com/contact"
        ],
        "url_not_start_with": [
            "email:",
            "ftp:"
        ],
        "url_start_with": [
            "http:",
            "https:"
        ],
        "username": [
            "username1",
            "username2"
        ]
    }
}

GET request

GET /reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data{?start,​end,​objectIds,​allObjectIds,​metrics,​filters,​page,​pageSize}

Sample: /reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data?start​=2021-06-01T00%3A00%3A00Z​&end​=2021-07-01T00%3A00%3A00Z​&objectIds​=1-123A,1-1TGTG,1-1TJZFB​&metrics​=clientId%2CclientIp​&filters​=client_token%3Dtoken_1%2Cclient_token%3Dtoken_2%2Ccontract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND​&page​=2​&pageSize=4

Query parameters

ParameterTypeSampleDescription
Required
startString2021-06-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.
endString2021-07-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.
objectIdsString1-123A,1-1TGTG,1-1TJZFBAs 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
metricsStringclientId,​clientIpSpecifies 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.
filtersStringclient_token=​token_2,​client_token=​token_1,​contract_type=​1-3CV382,​contract_type=​1-6T5ZNDSpecifies 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.
pageNumber2Selected page of data. If one of the page parameters is passed, the other not present is set to default. Default value: 1
pageSizeNumber4Selected size of data per single page. If one of the page parameters is passed, other not present is set to default. Default value: 25

JSON response

Status 200 application/json

Response body:

{
    "metadata": {
        "name": "apiusagedetails-by-time",
        "version": "1",
        "outputType": "FLAT",
        "page": 2,
        "pageSize": 25,
        "_links": {
            "self": "/reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data?start=2021-06-01T00%3A00%3A00Z&end=2021-07-01T00%3A00%3A00Z&objectIds=1-123A,1-1TGTG,1-1TJZFB&metrics=clientId%2CclientIp&filters=client_token%3Dtoken_1%2Cclient_token%3Dtoken_2%2Ccontract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND&page=2&pageSize=25",
            "prev": "/reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data?start=2021-06-01T00%3A00%3A00Z&end=2021-07-01T00%3A00%3A00Z&objectIds=1-123A,1-1TGTG,1-1TJZFB&metrics=clientId%2CclientIp&filters=client_token%3Dtoken_1%2Cclient_token%3Dtoken_2%2Ccontract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND&page=1&pageSize=25",
            "next": "/reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data?start=2021-06-01T00%3A00%3A00Z&end=2021-07-01T00%3A00%3A00Z&objectIds=1-123A,1-1TGTG,1-1TJZFB&metrics=clientId%2CclientIp&filters=client_token%3Dtoken_1%2Cclient_token%3Dtoken_2%2Ccontract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND&page=3&pageSize=25"
        },
        "start": "2021-06-01T00:00:00Z",
        "end": "2021-07-01T00:00:00Z",
        "availableDataEnds": null,
        "suggestedRetryTime": null,
        "rowCount": 4,
        "filters": [
            {
                "name": "client_token",
                "values": [
                    "token_1",
                    "token_2"
                ]
            },
            {
                "name": "contract_type",
                "values": [
                    "1-3CV382",
                    "1-6T5ZND"
                ]
            },
            {
                "name": "endpoint",
                "values": [
                    "endpoint/1",
                    "endpoint/2"
                ]
            },
            {
                "name": "http_method",
                "values": [
                    "delete",
                    "put"
                ]
            },
            {
                "name": "response_class",
                "values": [
                    "4xx",
                    "2xx"
                ]
            },
            {
                "name": "response_code",
                "values": [
                    "200",
                    "201"
                ]
            },
            {
                "name": "response_status",
                "values": [
                    "success",
                    "error"
                ]
            },
            {
                "name": "url_contain",
                "values": [
                    "/shop",
                    "/about"
                ]
            },
            {
                "name": "url_end_with",
                "values": [
                    ".html",
                    ".jsp"
                ]
            },
            {
                "name": "url_exact_match",
                "values": [
                    "https://www.example.com/shop/index.html",
                    "https://www.example.com/about/index.html"
                ]
            },
            {
                "name": "url_match",
                "values": [
                    "https://www.example.com/shop",
                    "https://www.example.com/about"
                ]
            },
            {
                "name": "url_not_contain",
                "values": [
                    "/blog",
                    "/contact"
                ]
            },
            {
                "name": "url_not_end_with",
                "values": [
                    ".pdf",
                    ".css"
                ]
            },
            {
                "name": "url_not_match",
                "values": [
                    "https://www.example.com/blog",
                    "https://www.example.com/contact"
                ]
            },
            {
                "name": "url_not_start_with",
                "values": [
                    "email:",
                    "ftp:"
                ]
            },
            {
                "name": "url_start_with",
                "values": [
                    "http:",
                    "https:"
                ]
            },
            {
                "name": "username",
                "values": [
                    "username1",
                    "username2"
                ]
            }
        ],
        "columns": [
            {
                "name": "clientId",
                "label": "Client ID"
            },
            {
                "name": "clientIp",
                "label": "Client IP"
            },
            {
                "name": "clientOwner",
                "label": "Client owner"
            },
            {
                "name": "clientToken",
                "label": "Client token"
            },
            {
                "name": "method",
                "label": "Method"
            },
            {
                "name": "responseCode",
                "label": "Response code"
            },
            {
                "name": "timestamp",
                "label": "Timestamp"
            },
            {
                "name": "uri",
                "label": "URI"
            }
        ],
        "objectType": "account_id",
        "objectIds": [
            "1-123A",
            "1-1TGTG",
            "1-1TJZFB"
        ]
    },
    "data": [
        {
            "clientId": "client1",
            "clientIp": "0.0.0.0",
            "clientOwner": "owner1",
            "clientToken": "token2",
            "method": "get",
            "responseCode": "403",
            "timestamp": "2019-05-01T00:00:15Z",
            "uri": "example.com/static/html"
        },
        {
            "clientId": "client5",
            "clientIp": "127.0.0.1",
            "clientOwner": "owner2",
            "clientToken": "token1",
            "method": "post",
            "responseCode": "100",
            "timestamp": "2019-05-01T00:00:05Z",
            "uri": "data.example.com/download/file"
        },
        {
            "clientId": "Other",
            "clientIp": "Other",
            "clientOwner": "Other",
            "clientToken": "Other",
            "method": "Other",
            "responseCode": "Other",
            "timestamp": "Other",
            "uri": "Other"
        },
        {
            "clientId": "client4",
            "clientIp": "127.0.0.1",
            "clientOwner": "owner1",
            "clientToken": "token3",
            "method": "delete",
            "responseCode": "404",
            "timestamp": "2019-05-01T00:00:20Z",
            "uri": "stream.example.com/subscribe"
        }
    ],
    "summaryStatistics": {}
}

CSV response

Status 200 text/csv

Response Body:

#METADATA_START
name,​apiusagedetails-by-time
version,​1
source,​apiusagedetails-by-time/versions/1
start,​2021-06-01T00:00:00Z
end,​2021-07-01T00:00:00Z
page,​2
pageSize,​4
_links.prev,/reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data?start=2021-06-01T00%3A00%3A00Z&end=2021-07-01T00%3A00%3A00Z&objectIds=1-123A,1-1TGTG,1-1TJZFB&metrics=clientId%2CclientIp&filters=client_token%3Dtoken_1%2Cclient_token%3Dtoken_2%2Ccontract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND&page=1&pageSize=25
_links.self,/reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data?start=2021-06-01T00%3A00%3A00Z&end=2021-07-01T00%3A00%3A00Z&objectIds=1-123A,1-1TGTG,1-1TJZFB&metrics=clientId%2CclientIp&filters=client_token%3Dtoken_1%2Cclient_token%3Dtoken_2%2Ccontract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND&page=2&pageSize=25
_links.next,/reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data?start=2021-06-01T00%3A00%3A00Z&end=2021-07-01T00%3A00%3A00Z&objectIds=1-123A,1-1TGTG,1-1TJZFB&metrics=clientId%2CclientIp&filters=client_token%3Dtoken_1%2Cclient_token%3Dtoken_2%2Ccontract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND&page=3&pageSize=25
availableDataEnds,
suggestedRetryTime,
rowCount,​4
objectType,​account_id
objectIds,​1-123A,1-1TGTG,1-1TJZFB
client_token,​client_token2,​client_token3
contract_type,​1-3CV382,​1-6T5ZND
endpoint,​endpoint/1,​endpoint/2
http_method,​delete,​put
response_class,​4xx,​2xx
response_code,​200,​201
response_status,​success,​error
url_contain,/shop,/about
url_end_with,.html,.jsp
url_exact_match,​https://www.example.com/shop/index.html,​https://www.example.com/about/index.html
url_match,​https://www.example.com/shop,​https://www.example.com/about
url_not_contain,/blog,/contact
url_not_end_with,.pdf,.css
url_not_match,​https://www.example.com/blog,​https://www.example.com/contact
url_not_start_with,​email:,ftp:
url_start_with,​http:,https:
username,​username1,​username2
#METADATA_END

#SUMMARYSTATISTICS_START

#SUMMARYSTATISTICS_END

#COLUMNS_START
clientId,​clientIp,​clientOwner,​clientToken,​method,​responseCode,​timestamp,​uri
#COLUMNS_END

#DATA_START
client1,​0.0.0.0,​owner1,​token2,​get,​403,​2019-05-01T00:00:15Z,example.com/static/html
client5,​127.0.0.1,​owner2,​token1,​post,​100,​2019-05-01T00:00:05Z,data.example.com/download/file
Other,Other,Other,Other,Other,Other,Other,Other
client4,​127.0.0.1,​owner1,​token3,​delete,​404,​2019-05-01T00:00:20Z,stream.example.com/subscribe
#DATA_END

Get report details

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

GET /reporting-api/v1/reports/apiusagedetails-by-time/versions/1

Status 200 application/json

Response body:

{
    "name": "apiusagedetails-by-time",
    "description": "This report allows you to audit details of latest individual API calls for a given timeframe.",
    "businessObjectName": "account_id",
    "version": 1,
    "status": "PUBLISHED",
    "deprecated": false,
    "timeBased": false,
    "supportsPagination": true,
    "outputType": "FLAT",
    "requiredProducts": [
        "EDGECONTROL"
    ],
    "requiredRoles": [
        "IDM: API Clients - Admin Access"
    ],
    "available": true,
    "metrics": [
        {
            "name": "timestamp",
            "description": "Date and time of API request.",
            "label": "Timestamp",
            "unit": "STRING",
            "summaryStatistic": false
        },
        {
            "name": "clientOwner",
            "description": "Username of client owner.",
            "label": "Client owner",
            "unit": "STRING",
            "summaryStatistic": false
        },
        {
            "name": "clientIp",
            "description": "IP generating API request.",
            "label": "Client IP",
            "unit": "STRING",
            "summaryStatistic": false
        },
        {
            "name": "clientId",
            "description": "ID of client generating API request.",
            "label": "Client ID",
            "unit": "STRING",
            "summaryStatistic": false
        },
        {
            "name": "clientToken",
            "description": "Client token used for generating API request.",
            "label": "Client token",
            "unit": "STRING",
            "summaryStatistic": false
        },
        {
            "name": "method",
            "description": "A request method indicating the action performed on a resource.",
            "label": "Method",
            "unit": "STRING",
            "summaryStatistic": false
        },
        {
            "name": "uri",
            "description": "API request details.",
            "label": "URI",
            "unit": "STRING",
            "summaryStatistic": false
        },
        {
            "name": "responseCode",
            "description": "Response code for the API request.",
            "label": "Response code",
            "unit": "STRING",
            "summaryStatistic": false
        }
    ],
    "groupOutlyingValues": {
        "enabled": false
    },
    "filters": [
        {
            "name": "url_not_start_with",
            "type": "string",
            "description": "URL does not start with the specified string.",
            "required": false
        },
        {
            "name": "http_method",
            "type": "enum",
            "description": "A request method indicating the action performed on a resource.",
            "values": [
                {
                    "value": "head",
                    "description": "Retrieves header information about the target resource, with no message body in the response. "
                },
                {
                    "value": "post",
                    "description": "Sends information to the server."
                },
                {
                    "value": "get",
                    "description": "Retrieves information about the target resource."
                },
                {
                    "value": "notcare",
                    "description": "Not care."
                },
                {
                    "value": "delete",
                    "description": "Removes all information about the target resource."
                },
                {
                    "value": "put",
                    "description": "Replaces existing information about the target resource."
                }
            ],
            "required": false
        },
        {
            "name": "contract_type",
            "type": "string",
            "description": "Contract type.",
            "required": false
        },
        {
            "name": "url_exact_match",
            "type": "string",
            "description": "URL is an exact match for the specified string.",
            "required": false
        },
        {
            "name": "url_end_with",
            "type": "string",
            "description": "URL ends with the specified string.",
            "required": false
        },
        {
            "name": "url_not_end_with",
            "type": "string",
            "description": "URL does not end with the specified string.",
            "required": false
        },
        {
            "name": "url_not_match",
            "type": "string",
            "description": "URL does not match the specified string.",
            "required": false
        },
        {
            "name": "client_token",
            "type": "string",
            "required": false
        },
        {
            "name": "url_start_with",
            "type": "string",
            "description": "URL starts with the specified string.",
            "required": false
        },
        {
            "name": "response_class",
            "type": "enum",
            "description": "A class of HTTP response status codes, from 0xx through 6xx. ",
            "values": [
                {
                    "value": "0xx",
                    "description": "An aborted action on the client side."
                },
                {
                    "value": "1xx",
                    "description": "An informational response, like Continue."
                },
                {
                    "value": "2xx",
                    "description": "A successful response."
                },
                {
                    "value": "3xx",
                    "description": "Success, but a redirect where the thing you want is somewhere else."
                },
                {
                    "value": "4xx",
                    "description": "Error, where there's some problem with the client request."
                },
                {
                    "value": "5xx",
                    "description": "Error, where there's some problem with how the API server responded to the client request. "
                },
                {
                    "value": "6xx",
                    "description": "Invalid headers (defined by Akamai)."
                }
            ],
            "required": false
        },
        {
            "name": "endpoint",
            "type": "string",
            "description": "An API endpoint enabled by Akamai.",
            "required": false
        },
        {
            "name": "response_code",
            "type": "string",
            "description": "An HTTP response status code, for example, 201.",
            "required": false
        },
        {
            "name": "url_not_contain",
            "type": "string",
            "description": "URL does not contain the specified string.",
            "required": false
        },
        {
            "name": "username",
            "type": "string",
            "description": "Name of client generating API request.",
            "required": false
        },
        {
            "name": "url_match",
            "type": "string",
            "description": "URL matches the specified string.",
            "required": false
        },
        {
            "name": "response_status",
            "type": "enum",
            "description": "An indicator of whether the HTTP response resulted in success or an error.",
            "values": [
                {
                    "value": "success",
                    "description": "Successful HTTP response status."
                },
                {
                    "value": "error",
                    "description": "Error HTTP response status.Y"
                }
            ],
            "required": false
        },
        {
            "name": "url_contain",
            "type": "string",
            "description": "URL contains the specified string.",
            "required": false
        }
    ],
    "intervals": [
        "MONTH",
        "WEEK",
        "DAY",
        "HOUR",
        "FIVE_MINUTES"
    ],
    "dataRetentionDays": 92,
    "limit": 5000,
    "maxLimit": 25000,
    "links": [
        {
            "rel": "self",
            "href": "/reporting-api/v1/reports/apiusagedetails-by-time/versions/1"
        },
        {
            "rel": "versions",
            "href": "/reporting-api/v1/reports/apiusagedetails-by-time/versions"
        },
        {
            "rel": "all-reports",
            "href": "/reporting-api/v1/reports"
        },
        {
            "rel": "execute-report",
            "href": "/reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data"
        }
    ]
}