The following shows how to generate the endpoint-errors-by-response-code
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 error data for your API endpoints by specific response code.
Business object: cpcode
Data available for: 90 days
Required products: API Gateway
Available metrics
Metric | Description |
---|---|
Data metrics | |
edgeHits | The number egress and midgress hits. |
Summary metrics | |
edgeHitsMax | The highest number of requests. |
edgeHitsMin | The lowest number of requests. |
edgeHitsTotal | The total number of edge requests for given objects and filters. |
Available filters
Filter | Type | Description |
---|---|---|
Optional filters | ||
api_key | Integer | A unique identifier of an API consumer. |
endpoint_id | Integer | The ID of an API configuration registered with Akamai. |
response_class_errors | Enumeration | A class of HTTP response error status codes, for example, 4XX. |
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. | ||
response_code_errors | Integer | An HTTP response error status code, for example, 404. |
POST request
POST /reporting-api/v1/reports/endpoint-errors-by-response-code/versions/1/report-data{?start,end}
Sample: /reporting-api/v1/reports/endpoint-errors-by-response-code/versions/1/report-data?start=2020-05-01T00%3A00%3A00Z&end=2020-06-01T00%3A00%3A00Z
Query parameters
Parameter | Type | Sample | Description |
---|---|---|---|
Required | |||
start | String | 2020-05-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-06-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. |
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. |
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": [
"55232",
"23433",
"32433"
],
"metrics": [
"edgeHits",
"edgeHitsMax",
"edgeHitsMin",
"edgeHitsTotal"
],
"filters": {
"api_key": [
"577596",
"577599"
],
"endpoint_id": [
"577595",
"577597"
],
"response_class_errors": [
"2xx",
"1xx"
],
"response_code_errors": [
"100",
"200"
]
}
}
GET request
GET /reporting-api/v1/reports/endpoint-errors-by-response-code/versions/1/report-data{?start,end,objectIds,allObjectIds,metrics,filters}
Sample: /reporting-api/v1/reports/endpoint-errors-by-response-code/versions/1/report-data?start=2020-05-01T00%3A00%3A00Z&end=2020-06-01T00%3A00%3A00Z&objectIds=55232,23433,32433&metrics=edgeHits%2CedgeHitsMax&filters=api_key%3D577598%2Capi_key%3D577596%2Cendpoint_id%3D577599%2Cendpoint_id%3D577596
Query parameters
Parameter | Type | Sample | Description |
---|---|---|---|
Required | |||
start | String | 2022-06-23T13:55: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 | 2022-06-23T14:15: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 | |||
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 | edgeHits,edgeHitsMax | 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 | api_key=577598,api_key=577596,endpoint_id=577599,endpoint_id=577596 | 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. |
JSON response
Status 200 application/json
Response body:
{
"metadata": {
"name": "endpoint-errors-by-response-code",
"version": "1",
"outputType": "FLAT",
"groupBy": [
"endpoint_id",
"api_key",
"response_code_errors"
],
"start": "2020-05-01T00:00:00Z",
"end": "2020-06-01T00:00:00Z",
"availableDataEnds": null,
"suggestedRetryTime": null,
"rowCount": 4,
"filters": [
{
"name": "api_key",
"values": [
"577599",
"577598"
]
},
{
"name": "endpoint_id",
"values": [
"577597",
"577598"
]
},
{
"name": "response_class_errors",
"values": [
"0xx",
"1xx"
]
},
{
"name": "response_code_errors",
"values": [
"100",
"201"
]
}
],
"columns": [
{
"name": "groupBy",
"label": "endpoint_id"
},
{
"name": "groupBy",
"label": "api_key"
},
{
"name": "groupBy",
"label": "response_code_errors"
},
{
"name": "edgeHits",
"label": "Edge Hits"
}
],
"objectType": "cpcode",
"objectIds": [
"55232",
"23433",
"32433"
]
},
"data": [
{
"endpoint_id": "577598",
"api_key": "577595",
"response_code_errors": "100",
"edgeHits": "1664"
},
{
"endpoint_id": "577599",
"api_key": "577598",
"response_code_errors": "500",
"edgeHits": "1089"
},
{
"endpoint_id": "577596",
"api_key": "577597",
"response_code_errors": "403",
"edgeHits": "555"
},
{
"endpoint_id": "577597",
"api_key": "577596",
"response_code_errors": "200",
"edgeHits": "1714"
}
],
"summaryStatistics": {
"edgeHitsMax": {
"value": "849",
"details": {}
},
"edgeHitsMin": {
"value": "4627",
"details": {}
},
"edgeHitsTotal": {
"value": "3290",
"details": {}
}
}
}
CSV response
Status 200 text/csv
Response Body:
#METADATA_START
name,endpoint-errors-by-response-code
version,1
source,endpoint-errors-by-response-code/versions/1
groupBy,endpoint_id,api_key,response_code_errors
start,2020-05-01T00:00:00Z
end,2020-06-01T00:00:00Z
availableDataEnds,
suggestedRetryTime,
rowCount,4
objectType,cpcode
objectIds,55232,23433,32433
api_key,577599,577598
endpoint_id,577597,577598
response_class_errors,0xx,1xx
response_code_errors,100,201
#METADATA_END
#SUMMARYSTATISTICS_START
edgeHitsMax,849
edgeHitsMin,4627
edgeHitsTotal,3290
#SUMMARYSTATISTICS_END
#COLUMNS_START
endpoint_id,api_key,response_code_errors,edgeHits
#COLUMNS_END
#DATA_START
577598,577595,100,1664
577599,577598,500,1089
577596,577597,403,555
577597,577596,200,1714
#DATA_END
Get report details
This sample Get a report type operation gets the same information you need to run the endpoint-errors-by-response-code
report as provided in this reference documentation, but available dynamically to your API client application.
GET /reporting-api/v1/reports/endpoint-errors-by-response-code/versions/1
Status 200 application/json
Response body:
{
"name": "endpoint-errors-by-response-code",
"description": "Provides error data for your API endpoints by specific response code.",
"businessObjectName": "cpcode",
"version": 1,
"status": "PUBLISHED",
"deprecated": false,
"timeBased": false,
"outputType": "FLAT",
"requiredProducts": [
"API Gateway"
],
"requiredRoles": [
"API Gateway Viewer",
"API Gateway Administrator"
],
"available": true,
"metrics": [
{
"name": "edgeHits",
"description": "The number egress and midgress hits.",
"label": "Edge Hits",
"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
}
],
"groupOutlyingValues": {
"enabled": false
},
"groupBy": [
"endpoint_id",
"api_key",
"response_code_errors"
],
"filters": [
{
"name": "api_key",
"type": "int",
"description": "A unique identifier of an API consumer.",
"required": false
},
{
"name": "response_code_errors",
"type": "int",
"description": "An HTTP response error status code, for example, 404.",
"required": false
},
{
"name": "response_class_errors",
"type": "enum",
"description": "A class of HTTP response error status codes, for example, 4XX.",
"values": [
{
"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."
}
],
"required": false
},
{
"name": "endpoint_id",
"type": "int",
"description": "The ID of an API configuration registered with Akamai.",
"required": false
}
],
"intervals": [
"MONTH",
"WEEK",
"DAY",
"HOUR",
"FIVE_MINUTES"
],
"dataRetentionDays": 90,
"links": [
{
"rel": "self",
"href": "/reporting-api/v1/reports/endpoint-errors-by-response-code/versions/1"
},
{
"rel": "versions",
"href": "/reporting-api/v1/reports/endpoint-errors-by-response-code/versions"
},
{
"rel": "all-reports",
"href": "/reporting-api/v1/reports"
},
{
"rel": "execute-report",
"href": "/reporting-api/v1/reports/endpoint-errors-by-response-code/versions/1/report-data"
}
]
}