apiusagedetails-by-time report

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

Metric Description
Data metrics
clientId ID of client generating API request.
clientIp IP generating API request.
clientOwner Username of client owner.
clientToken Client token used for generating API request.
method A request method indicating the action performed on a resource.
responseCode Response code for the API request.
timestamp Date and time of API request.
uri API request details.

Available filters

Filter Type Description
Optional filters
contract_type String Contract type.
endpoint String An API endpoint enabled by Akamai.
http_method Enumeration A 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_class Enumeration A 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_code String An HTTP response status code, for example, 201.
response_status Enumeration An indicator of whether the HTTP response resulted in success or an error.
success: Successful HTTP response status.
error: Error HTTP response status.Y
url_contain String URL contains the specified string.
url_end_with String URL ends with the specified string.
url_exact_match String URL is an exact match for the specified string.
url_match String URL matches the specified string.
url_not_contain String URL does not contain the specified string.
url_not_end_with String URL does not end with the specified string.
url_not_match String URL does not match the specified string.
url_not_start_with String URL does not start with the specified string.
url_start_with String URL starts with the specified string.
username String Name of client generating API request.

Sample report

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=2020-10-01T00%3A00%3A00Z&end=2020-11-01T00%3A00%3A00Z&page=2&pageSize=4

Object type: Query

Download schema: report-request-schema.json

Query parameters

Parameter Type Sample Description
Required
start String 2020-10-01T00:00: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-11-01T00: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.
Optional
dataWrapNumberOfItems Number 2 Number of top values to be yield in response. Default value: . Special values: `0` - will group all values to single record, `-1` - will disable outlaying values grouping. | | `dataWrapLabel` | String | `Other` | Label used as title for grouped record of data which is wrapped. Default value:.
page Number 2 Selected page of data. If one of the page parameters is passed, other not present is set to default. Default value: 1 page. If one of the page parameters is passed, other not present is set to default. Default value: 25

JSON request members

Member Type Description
objectIds Array Specifies the set of account_id 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.
filters Map of Arrays Specifies 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": [
        "clientId",
        "clientIp",
        "clientOwner",
        "clientToken",
        "method",
        "responseCode",
        "timestamp",
        "uri"
    ],
    "filters": {
        "contract_type": [
            "1-3CV382",
            "1-6T5ZND"
        ],
        "endpoint": [
            "endpoint/1",
            "endpoint/2"
        ],
        "http_method": [
            "patch",
            "put"
        ],
        "response_class": [
            "4xx",
            "0xx"
        ],
        "response_code": [
            "100",
            "200"
        ],
        "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"
        ]
    }
}

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=2020-10-01T00%3A00%3A00Z&end=2020-11-01T00%3A00%3A00Z&objectIds=account1,account2,account3&metrics=clientId%2CclientIp&filters=contract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND%2Cendpoint%3Dendpoint%2F1%2Cendpoint%3Dendpoint%2F2&page=2&pageSize=4

Query parameters

Parameter Type Sample Description
Required
start String 2020-10-01T00: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.
end String 2020-11-01T00:00:00Z Specifies if unavailable reports should be shown.
Optional
allObjectIds Boolean true As 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.
objectIds String account1,account2,account3 As 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.
metrics String clientId,clientIp 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.
filters String contract_type=1–3CV382,contract_type=1–6T5ZND,endpoint=endpoint/1,endpoint=endpoint/2 Specifies 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.
page Number 2 Selected page of data. If one of the page parameters is passed, other not present is set to default. Default value: 1
pageSize Number 4 Selected size of data per single page. If one of the page parameters is passed, other not present is set to default. Default value: 25

Status 200 application/json

Object type: Report

Download schema: report-response-schema.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=2020-10-01T00%3A00%3A00Z&end=2020-11-01T00%3A00%3A00Z&objectIds=account1,account2,account3&metrics=clientId%2CclientIp&filters=contract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND%2Cendpoint%3Dendpoint%2F1%2Cendpoint%3Dendpoint%2F2&page=2&pageSize=25",
            "prev": "/reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data?start=2020-10-01T00%3A00%3A00Z&end=2020-11-01T00%3A00%3A00Z&objectIds=account1,account2,account3&metrics=clientId%2CclientIp&filters=contract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND%2Cendpoint%3Dendpoint%2F1%2Cendpoint%3Dendpoint%2F2&page=1&pageSize=25",
            "next": "/reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data?start=2020-10-01T00%3A00%3A00Z&end=2020-11-01T00%3A00%3A00Z&objectIds=account1,account2,account3&metrics=clientId%2CclientIp&filters=contract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND%2Cendpoint%3Dendpoint%2F1%2Cendpoint%3Dendpoint%2F2&page=3&pageSize=25"
        },
        "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": "http_method",
                "values": [
                    "patch",
                    "put"
                ]
            },
            {
                "name": "response_class",
                "values": [
                    "5xx",
                    "0xx"
                ]
            },
            {
                "name": "response_code",
                "values": [
                    "403",
                    "500"
                ]
            },
            {
                "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": [
                    ".js",
                    ".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": [
            "account1",
            "account2",
            "account3"
        ]
    },
    "data": [
        {
            "clientId": "client5",
            "clientIp": "0.0.0.0",
            "clientOwner": "owner1",
            "clientToken": "token1",
            "method": "patch",
            "responseCode": "403",
            "timestamp": "2019-05-01T00:00:25Z",
            "uri": "example.com/static/css"
        },
        {
            "clientId": "client1",
            "clientIp": "127.0.0.1",
            "clientOwner": "owner3",
            "clientToken": "token1",
            "method": "put",
            "responseCode": "503",
            "timestamp": "2019-05-01T00:00:30Z",
            "uri": "example.com/live/service"
        },
        {
            "clientId": "Other",
            "clientIp": "Other",
            "clientOwner": "Other",
            "clientToken": "Other",
            "method": "Other",
            "responseCode": "Other",
            "timestamp": "Other",
            "uri": "Other"
        },
        {
            "clientId": "client3",
            "clientIp": "0.0.0.0",
            "clientOwner": "owner3",
            "clientToken": "token1",
            "method": "get",
            "responseCode": "404",
            "timestamp": "2019-05-01T00:00:10Z",
            "uri": "stream.example.com/subscribe"
        }
    ],
    "summaryStatistics": {}
}

Status 200 text/csv

Response Body:

#METADATA_START
name,apiusagedetails-by-time
version,1
source,apiusagedetails-by-time/versions/1
start,2020-10-01T00:00:00Z
end,2020-11-01T00:00:00Z
page,2
pageSize,4
_links.prev,/reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data?start=2020-10-01T00%3A00%3A00Z&end=2020-11-01T00%3A00%3A00Z&objectIds=account1,account2,account3&metrics=clientId%2CclientIp&filters=contract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND%2Cendpoint%3Dendpoint%2F1%2Cendpoint%3Dendpoint%2F2&page=1&pageSize=25
_links.self,/reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data?start=2020-10-01T00%3A00%3A00Z&end=2020-11-01T00%3A00%3A00Z&objectIds=account1,account2,account3&metrics=clientId%2CclientIp&filters=contract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND%2Cendpoint%3Dendpoint%2F1%2Cendpoint%3Dendpoint%2F2&page=2&pageSize=25
_links.next,/reporting-api/v1/reports/apiusagedetails-by-time/versions/1/report-data?start=2020-10-01T00%3A00%3A00Z&end=2020-11-01T00%3A00%3A00Z&objectIds=account1,account2,account3&metrics=clientId%2CclientIp&filters=contract_type%3D1-3CV382%2Ccontract_type%3D1-6T5ZND%2Cendpoint%3Dendpoint%2F1%2Cendpoint%3Dendpoint%2F2&page=3&pageSize=25
availableDataEnds,
suggestedRetryTime,
rowCount,4
objectType,account_id
objectIds,account1,account2,account3
contract_type,1-3CV382,1-6T5ZND
endpoint,endpoint/1,endpoint/2
http_method,patch,put
response_class,5xx,0xx
response_code,403,500
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,.js,.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
client5,0.0.0.0,owner1,token1,patch,403,2019-05-01T00:00:25Z,example.com/static/css
client1,127.0.0.1,owner3,token1,put,503,2019-05-01T00:00:30Z,example.com/live/service
Other,Other,Other,Other,Other,Other,Other,Other
client3,0.0.0.0,owner3,token1,get,404,2019-05-01T00:00:10Z,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

Object type: ReportType

Download schema: data-row-schema.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_match",
            "type": "string",
            "description": "URL does not match the specified string.",
            "required": false
        },
        {
            "name": "url_match",
            "type": "string",
            "description": "URL matches 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": "url_end_with",
            "type": "string",
            "description": "URL ends 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": "username",
            "type": "string",
            "description": "Name of client generating API request.",
            "required": false
        },
        {
            "name": "endpoint",
            "type": "string",
            "description": "An API endpoint enabled by Akamai.",
            "required": false
        },
        {
            "name": "url_start_with",
            "type": "string",
            "description": "URL starts with the specified string.",
            "required": false
        },
        {
            "name": "url_exact_match",
            "type": "string",
            "description": "URL is an exact match for 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_contain",
            "type": "string",
            "description": "URL contains the specified string.",
            "required": false
        },
        {
            "name": "contract_type",
            "type": "string",
            "description": "Contract type.",
            "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": "url_not_start_with",
            "type": "string",
            "description": "URL does not start with 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
        }
    ],
    "intervals": [
        "MONTH",
        "WEEK",
        "DAY",
        "HOUR",
        "FIVE_MINUTES"
    ],
    "dataRetentionDays": 92,
    "limit": 5000,
    "maxLimit": 25000,
    "links": [
        {
            "rel": "self",
            "href": "/reporting-reports-executor-api/v1/reports/apiusagedetails-by-time/versions/1"
        },
        {
            "rel": "versions",
            "href": "/reporting-reports-executor-api/v1/reports/apiusagedetails-by-time/versions"
        },
        {
            "rel": "all-reports",
            "href": "/reporting-reports-executor-api/v1/reports"
        },
        {
            "rel": "execute-report",
            "href": "/reporting-reports-executor-api/v1/reports/apiusagedetails-by-time/versions/1/report-data"
        }
    ]
}