Skip to main content

Requests

A request defines:

  • the type of export
  • the format options
  • any notification details

Export types

Connhex Exporter supports both one time exports and recurring exports. The difference is quite obvious: the former are triggered once, whereas the latter are triggered at periodic interval - its duration being defined using the ISO 8601 format.

Export format

The export format contains all the formatting options associated with the export request, including:

  • export file extension
  • target timezone
  • column selection and metric name remapping. This feature allows you to choose and retain only the columns of interest from the original data and re-map their default names. There are multiple use cases for it, the prime example being translation purposes-

Notification details

Export notifications are optional. Their details include:

  • medium (i.e. email, slack, ...)
  • title
  • body

Notification will be sent using the custom layout defined by Connhex Notifications.

Requests and Connhex IAM

For every CRUD operation, the Connhex Exporter service emits an internal event. This is used by Connhex IAM to update the policies related to the export request.

Structure

Typescript

The following sections use Typescript to describe the structure of the data. This is done to facilitate the understanding of the data structure, but there's obviously no requirement to use Typescript in any of your code. For the complete API reference, please refer to the API documentation.

export interface CptExportRequest {
type: 'recurring' | 'oneTime';
format: {
extension: 'csv' | 'xls' | 'pdf' | 'json';
columns: {
id: 'publisher' | 'channel' | 'name' | 'time' | 'value' | 'created';
label: string;
}[];
timezone: string;
};
items: CptExportItem[];
periodicity?: string;
notification?: {
title: string;
text: string;
medium:
| CptNotificationMedium.Email
| CptNotificationMedium.Telegram
| CptNotificationMedium.Discord
| CptNotificationMedium.Slack;
};
}