jwt-usage-by-error

The following shows how to generate the jwt-usage-by-error 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 information for your JSON Web Tokens.

Business object: cpcode

Data available for: 90 days

Required products: API Gateway

Available metrics

MetricDescription
Data metrics
edgeHitsThe request count.
Summary metrics
edgeHitsMaxThe highest number of requests.
edgeHitsMinThe lowest number of requests.
edgeHitsTotalThe total number of edge requests for given objects and filters.

Available filters

FilterTypeDescription
Optional filters
endpoint_idIntegerThe ID of an API configuration registered with Akamai.
error_stateEnumerationA JWT-related reason for rejecting a request. Possible values are o: success/ok; u: unknown JWT or key definition; f: invalid token format; d: base64-decoding errors; p: JSON parsing errors; a: unsupported algorithm; j: invalid token type in the header; s: signature mismatch; t: failed timestamp claim; c: failed claim check; k: missing required claim; z: all other errors.
p: JSON parsing errors
a: unsupported algorithm
c: failed claim check
s: signature mismatch
d: base64-decoding errors
t: failed timestamp claim
u: unknown JWT or key definition
f: invalid token format
j: invalid token type in the header
z: all other errors
k: missing required claim
o: success/ok
failed_claimStringA JWT claim that failed the validation. Possible values are iss: issuer of the claim; sub: subject of this token; aud: audiences of this token; exp: expiration time; nbf: not before; alg: unsupported algorithm; typ: unsupported type.

POST request

POST /reporting-api/v1/reports/jwt-usage-by-error/versions/1/report-data{?start,​end}

Sample: /reporting-api/v1/reports/jwt-usage-by-error/versions/1/report-data?start​=2020-05-01T00%3A00%3A00Z​&end​=2020-06-01T00%3A00%3A00Z

Query parameters

ParameterTypeSampleDescription
Required
startString2020-05-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-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.

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": [
        "edgeHits",
        "edgeHitsMax",
        "edgeHitsMin",
        "edgeHitsTotal"
    ],
    "filters": {
        "endpoint_id": [
            "577597",
            "577596"
        ],
        "error_state": [
            "z",
            "f"
        ],
        "failed_claim": [
            "aud",
            "iss"
        ]
    }
}

GET request

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

Sample: /reporting-api/v1/reports/jwt-usage-by-error/versions/1/report-data?start​=2020-05-01T00%3A00%3A00Z​&end​=2020-06-01T00%3A00%3A00Z​&objectIds​=55232,​23433,​32433​&metrics​=edgeHits%2CedgeHitsMax​&filters​=endpoint_id%3D577598%2Cendpoint_id%3D577596%2Cerror_state%3Dp%2Cerror_state%3Da

Query parameters

ParameterTypeSampleDescription
Required
startString2020-05-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-06-01T00:00:00ZSpecifies if unavailable reports should be shown.
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.
metricsStringedgeHits,​edgeHitsMaxSpecifies 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.
filtersStringendpoint_id=​577598,​endpoint_id=​577596,​error_state=​p,​error_state=​aSpecifies 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": "jwt-usage-by-error",
        "version": "1",
        "outputType": "FLAT",
        "groupBy": [
            "error_state"
        ],
        "start": "2020-05-01T00:00:00Z",
        "end": "2020-06-01T00:00:00Z",
        "availableDataEnds": null,
        "suggestedRetryTime": null,
        "rowCount": 4,
        "filters": [
            {
                "name": "endpoint_id",
                "values": [
                    "577597",
                    "577595"
                ]
            },
            {
                "name": "error_state",
                "values": [
                    "p",
                    "u"
                ]
            },
            {
                "name": "failed_claim",
                "values": [
                    "alg",
                    "typ"
                ]
            }
        ],
        "columns": [
            {
                "name": "groupBy",
                "label": "error_state"
            },
            {
                "name": "edgeHits",
                "label": "Edge Hits"
            }
        ],
        "objectType": "cpcode",
        "objectIds": [
            "55232",
            "23433",
            "32433"
        ]
    },
    "data": [
        {
            "error_state": "a",
            "edgeHits": "2779"
        },
        {
            "error_state": "u",
            "edgeHits": "2514"
        },
        {
            "error_state": "f",
            "edgeHits": "3630"
        },
        {
            "error_state": "p",
            "edgeHits": "3746"
        }
    ],
    "summaryStatistics": {
        "edgeHitsMax": {
            "value": "4580",
            "details": {}
        },
        "edgeHitsMin": {
            "value": "3599",
            "details": {}
        },
        "edgeHitsTotal": {
            "value": "2000",
            "details": {}
        }
    }
}

CSV response

Status 200 text/csv

Response Body:

#METADATA_START
name,​jwt-usage-by-error
version,​1
source,​jwt-usage-by-error/versions/1
groupBy,​error_state
start,​2020-05-01T00:00:00Z
end,​2020-06-01T00:00:00Z
availableDataEnds,
suggestedRetryTime,
rowCount,​4
objectType,​cpcode
objectIds,​55232,​23433,​32433
endpoint_id,​577597,​577595
error_state,​p,u
failed_claim,​alg,​typ
#METADATA_END

#SUMMARYSTATISTICS_START
edgeHitsMax,​4580
edgeHitsMin,​3599
edgeHitsTotal,​2000
#SUMMARYSTATISTICS_END

#COLUMNS_START
error_state,​edgeHits
#COLUMNS_END

#DATA_START
a,​2779
u,​2514
f,​3630
p,​3746
#DATA_END

Get report details

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

GET /reporting-api/v1/reports/jwt-usage-by-error/versions/1

Status 200 application/json

Response body:

{
    "name": "jwt-usage-by-error",
    "description": "Provides error information for your JSON Web Tokens.",
    "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 request count.",
            "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": [
        "error_state"
    ],
    "filters": [
        {
            "name": "failed_claim",
            "type": "string",
            "description": "A JWT claim that failed the validation. Possible values are iss: issuer of the claim; sub: subject of this token; aud: audiences of this token; exp: expiration time; nbf: not before; alg: unsupported algorithm; typ: unsupported type.",
            "required": false
        },
        {
            "name": "error_state",
            "type": "enum",
            "description": "A JWT-related reason for rejecting a request. Possible values are o: success/ok; u: unknown JWT or key definition; f: invalid token format; d: base64-decoding errors; p: JSON parsing errors; a: unsupported algorithm; j: invalid token type in the header; s: signature mismatch; t: failed timestamp claim; c: failed claim check; k: missing required claim; z: all other errors.",
            "values": [
                {
                    "value": "p",
                    "description": "JSON parsing errors"
                },
                {
                    "value": "a",
                    "description": "unsupported algorithm"
                },
                {
                    "value": "c",
                    "description": "failed claim check"
                },
                {
                    "value": "s",
                    "description": "signature mismatch"
                },
                {
                    "value": "d",
                    "description": "base64-decoding errors"
                },
                {
                    "value": "t",
                    "description": "failed timestamp claim"
                },
                {
                    "value": "u",
                    "description": "unknown JWT or key definition"
                },
                {
                    "value": "f",
                    "description": "invalid token format"
                },
                {
                    "value": "j",
                    "description": "invalid token type in the header"
                },
                {
                    "value": "z",
                    "description": "all other errors"
                },
                {
                    "value": "k",
                    "description": "missing required claim"
                },
                {
                    "value": "o",
                    "description": "success/ok"
                }
            ],
            "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/jwt-usage-by-error/versions/1"
        },
        {
            "rel": "versions",
            "href": "/reporting-api/v1/reports/jwt-usage-by-error/versions"
        },
        {
            "rel": "all-reports",
            "href": "/reporting-api/v1/reports"
        },
        {
            "rel": "execute-report",
            "href": "/reporting-api/v1/reports/jwt-usage-by-error/versions/1/report-data"
        }
    ]
}