fastmon Docs
Analytics

CSP reports grouped by one dimension

Fehler melden

The reports of POST /analytics/csp grouped by one dimension.

One row per value with its report_count, its affected_visitors, its share of the reports of the whole answer, and first_seen_at and last_seen_at, the browser's time of its first and latest report in the window. order_by puts the most reports first by default, or the newest group first with last_seen_at, a tie by key. The filters and the limits of the visitor count are those of the aggregate route.

blocked_url answers which source a policy would break, page_url on which pages, source_url which script caused it, stitch which visitors. A key passed back to the filter of the same name selects its row, unless it holds a *, which the filter reads as a wildcard. A stitch key goes back as filters.stitch: [key], a status_code_range key as filters.status_code_range: {gte: key, lte: key}. Reports without a source_url, a disposition, a stitch or a status code form a row with an empty key, which no filter selects.

A site_id row's last_seen_at tells whether a site's policy reaches fastmon at all.

Authentifizierung

bearerAuth
headerAuthentifizierungBearer <token>

API token generated from the fastmon dashboard (Account → API Token) or at organization level (fmo_…, one that outlives its creator). Send as Authorization: Bearer fm_... or paste the full token (including its prefix) into the Authorize dialog.

Pfad-Parameter

org_id*Org Id
Formatuuid

Request-Body

application/json
  1. body

Request for the CSP reports grouped by one dimension.

time_range*

Time range, on the time the browser saw the violation

filters?

The filters of POST /analytics/csp, with its 422 for a filter the table cannot answer. A filter on the dimension itself narrows the rows

dimension*CspDimension

The one dimension the rows group by. page_url is the page that broke the policy, blocked_url what the policy blocked, source_url the script that broke it, effective_directive and disposition the report's own, bot_class derived from the edge labels as the filter derives it, the rest the edge labels. browser_version keys mix browsers that share a version number, so pair it with filters.browser. Reports without a source_url or a disposition form one row with an empty key. stitch is the visitor, its key the visitor_id of the report list, and the reports without a stitch form one row with an empty key. status_code_range groups by the page's status code, its key the code as text, and the reports without one form one row with an empty key. bot_name is the edge label

Value in"site_id""page_url""blocked_url""source_url""effective_directive""disposition""device_type""browser""browser_version""os""country""asn""bot_class""stitch""status_code_range""bot_name"
order_by?

The order of the rows before limit cuts them, the most reports first by default. last_seen_at puts the newest group first

limit?Limit

Max rows, in the order_by order

Range1 <= value <= 100
Default50

Response-Body

Successful Response

application/json
  1. response

CSP reports grouped by one dimension.

meta*

Facts about the result. total is the number of values the dimension has in the window, limit the cap on data

request*

The request as the server resolved it

report_count*Report Count

Reports in the window, the rows the limit cut included, which every share is measured against

data*array<>

At most meta.limit rows, in the order_by order

POST
/organizations/{org_id}/analytics/csp/breakdown
curl -X POST 'https://api.fastmon.eu/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/analytics/csp/breakdown' \  -H 'Content-Type: application/json' \  -d '{  "time_range": {    "from": "2019-08-24T14:15:22Z",    "to": "2019-08-24T14:15:22Z"  },  "dimension": "site_id"}'
{  "meta": {    "execution_time_ms": 0,    "total": 0,    "limit": 0,    "offset": 0,    "has_more": true,    "next_cursor": "string",    "sampling": {      "sampling_rate": 0,      "is_sampled": true,      "estimated_metrics": [        "string"      ]    },    "is_identity_mixed": true,    "stitchless_site_ids": [      "69469e5a-8ce7-4bbc-8031-8525fff71fc6"    ]  },  "request": {    "time_range": {      "from": "2019-08-24T14:15:22Z",      "to": "2019-08-24T14:15:22Z"    },    "comparison_time_range": {      "from": "2019-08-24T14:15:22Z",      "to": "2019-08-24T14:15:22Z"    },    "granularity": "minute",    "identity": "stitch",    "window_seconds": 0,    "filters": {}  },  "report_count": 0,  "data": [    {      "key": "string",      "report_count": 0,      "affected_visitors": 0,      "share": 0,      "isp": "string",      "first_seen_at": "2019-08-24T14:15:22Z",      "last_seen_at": "2019-08-24T14:15:22Z"    }  ]}