Konnect Analytics Reports (2.0.0)

Download OpenAPI specification:Download

The API for managing custom reports.

Custom Reports

List Custom Reports

Returns a list of custom reports.

query Parameters
page[size]
integer
Example: page[size]=10

How many items to include in a page.

page[number]
integer
Example: page[number]=2

The specific page number in the collection results.

Responses

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "data": [
    ]
}

New Custom Report

Creates a new custom report.

Request Body schema: application/json

The request schema for the create report request.

If you pass the same name and description of an existing report in the request, a report with the same name and description will be created. The two reports will have different id values to differentiate them.

Note that all fields are optional: if you pass an empty JSON object as the request ({}), a new report will be created with a default configuration.

name
string [ 1 .. 255 ] characters

The user-provided name for the report. If not provided, the report will be named "Untitled Report" with a timestamp suffix.

description
string

An optional extended description for the report.

chart_type
string
Default: "HORIZONTAL_BAR"
Enum: "HORIZONTAL_BAR" "VERTICAL_BAR" "LINE"

Visualization type selected for this report.

any (TimeRange)
Default: {"type":"RELATIVE","time_period":"24H"}

The period of time to return data. Relative time ranges are relative to the current moment. Absolute time ranges specify an unchanging period of time. If not specified, a default relative timeframe of last 24 hours will be chosen.

object

Responses

Request samples

Content type
application/json
Example

A vertical bar chart grouping data first by API product, then by status code, for the past 24 hours.

{
  • "name": "Status codes by service",
  • "chart_type": "VERTICAL_BAR",
  • "time_range": {
    },
  • "query": {
    }
}

Response samples

Content type
application/json
{
  • "summary": "Bar chart of status codes by API product for the past 24 hours",
  • "description": "A vertical bar chart grouping data first by API product, then by status code, for the past 24 hours.",
  • "value": {
    }
}

Fetch Custom Report

Returns a single report.

path Parameters
reportId
required
string <uuid>
Example: d32d905a-ed33-46a3-a093-d8f536af9a8a

The report's ID

Responses

Response samples

Content type
application/json
{
  • "summary": "Bar chart of status codes by API product for the past 24 hours",
  • "description": "A vertical bar chart grouping data first by API product, then by status code, for the past 24 hours.",
  • "value": {
    }
}

Update Report

Updates a custom report.

path Parameters
reportId
required
string <uuid>
Example: d32d905a-ed33-46a3-a093-d8f536af9a8a

The report's ID

Request Body schema: application/json

The request schema for the update report request.

name
string [ 1 .. 255 ] characters

The user-provided name for the report. If not provided, the report will be named "Untitled Report" with a timestamp suffix.

description
string

An optional extended description for the report.

chart_type
string
Default: "HORIZONTAL_BAR"
Enum: "HORIZONTAL_BAR" "VERTICAL_BAR" "LINE"

Visualization type selected for this report.

any (TimeRange)
Default: {"type":"RELATIVE","time_period":"24H"}

The period of time to return data. Relative time ranges are relative to the current moment. Absolute time ranges specify an unchanging period of time. If not specified, a default relative timeframe of last 24 hours will be chosen.

object

Responses

Request samples

Content type
application/json
Example

A vertical bar chart grouping data first by API product, then by status code, for the past 24 hours.

{
  • "name": "Status codes by service",
  • "chart_type": "VERTICAL_BAR",
  • "time_range": {
    },
  • "query": {
    }
}

Response samples

Content type
application/json
{
  • "summary": "Bar chart of status codes by API product for the past 24 hours",
  • "description": "A vertical bar chart grouping data first by API product, then by status code, for the past 24 hours.",
  • "value": {
    }
}

Delete Custom Report

Deletes a custom report. Returns 404 if the report is not found.

path Parameters
reportId
required
string <uuid>
Example: d32d905a-ed33-46a3-a093-d8f536af9a8a

The report's ID

Responses

Response samples

Content type
application/problem+json
{
  • "type": "string",
  • "status": 400,
  • "title": "Bad Request",
  • "instance": "konnect:trace:3674017986744198214",
  • "invalid_parameters": [
    ]
}

Export as CSV

Exports report data in CSV format.

path Parameters
reportId
required
string <uuid>
Example: d32d905a-ed33-46a3-a093-d8f536af9a8a

The ID of the report to export

query Parameters
tz
string
Example: tz=Etc/UTC

The timezone to use for the report. This impacts several things:

  • The timestamps returned, if time is a dimension.
  • Day boundaries for reports, meaning that if the report implicitly has a granularity of DAILY or higher, the same query may return different data depending on the timezone selected.
utc_format
boolean

If true, export timestamps in "programmer friendly" format (ISO-8601, UTC timezone). If false, export in "spreadsheet friendly" format (local time without timezone specifier).

Note: this does NOT impact the timezone of the report, merely the format of the time column if one is present.

Responses

Response samples

Content type
text/csv
Example
TIMESTAMP,UTC_OFFSET,API_PRODUCT,TOTAL_REQUESTS
2023-01-01 00:00:00,-04:00,ProductA,2497079
2023-01-01 00:00:00,-04:00,ProductB,2029907