Skip to main content

Create export request

POST 

/exports

Create export request.

Authorization Action:

exporter:exports:create

Request

Bodyrequired

    format objectrequired
    filenamestring
    extensionstringrequired

    Possible values: [csv, xlsx, pdf]

    columns object[]

    Define how exported data fields are mapped to the output file

  • Array [
  • idstringrequired

    Column id.

    When exporting resource items it must be formatted as: <type>.<attribute>.

    labelstringrequired

    Column label

  • ]
  • timezonestring

    Target timezone: all data field will be remapped to this timezone

    Default value: utc
    templatestring

    Possible values: [tabular, expanded]

    Default value: tabular
    csvDelimiterstring
    typestringrequired

    Possible values: [recurring, oneTime]

    items object[]required
  • Array [
  • params objectrequired
    oneOf
    target objectrequired
    valuestringrequired

    Identifier of the resource the be exported: typically a URN. It is possible to export multiple resources by providing a comma separated list of values.

    labelstring

    Label that will replace the target value. If multiple values are provided, you can can pass a comma separated list of labels. The number of labels must match the number of values.

    channelIdstringrequired
    Example: 0115c85d-ef3e-4de9-9732-d0c5c4f2c482
    subtopicstringrequired

    Subtopic from which to retrieve data for export

    Example: events.data
    fromnumber

    Unix timestamp: number of seconds since 1970 UTC

    tonumber

    Unix timestamp: number of seconds since 1970 UTC

    periodstring

    ISO8601 Duration: https://en.wikipedia.org/wiki/ISO_8601#Durations

    Possible values: Value must match regular expression durationRegExp

    Example: P1Y6M4DT12H30M5S
    decimation object
    dsobjectrequired

    Decimation granularity. Only supports positive integer.

    Example: 15m
    dsfstringrequired

    Aggregation algotithm

    Possible values: [avg, max, min, sum, stddev, variance]

    transformstring

    Possible values: [delta]

    outputFormatstringrequired

    Determines how exported data will be formatted in the output file. Check the following link for more info: https://en.wikipedia.org/wiki/Wide_and_narrow_data

    In the long format exported variables are spread across multiple rows. In the wide format exported variables are spread across multiple columns, and each row represents a different timestamp.

    If wide format is selected, request.colums must be provided.

    Possible values: [long, wide]

    Default value: long
    filenamestring

    Name of the output file (without extension)

  • ]
  • periodicitystring

    ISO8601 Duration: https://en.wikipedia.org/wiki/ISO_8601#Durations

    Possible values: Value must match regular expression durationRegExp

    Example: P1Y6M4DT12H30M5S
    periodStartnumber

    Period start expressed in Unix timestamp. If not specified, the creation date of the request will be used.

    notification objectrequired
    messages object[]required

    Notification messages. For each notification, there must be exactly two notification messages with the two different policies (onSuccess, onFailure)

  • Array [
  • targetstring

    Notification target: can be an email address, a phone number or a telegram account. If not specified, the notification target is set to the user that created the rule.

    policystringrequired

    The notification policy: whether it is associated with a success event (export delivered), or a failure event (export failed)

    Possible values: [onSuccess, onFailure]

    mediumstringrequired

    Possible values: [email, telegram, slack, discord]

    titlestringrequired
    textstringrequired
  • ]

Responses

Schema
    format objectrequired
    filenamestring
    extensionstringrequired

    Possible values: [csv, xlsx, pdf]

    columns object[]

    Define how exported data fields are mapped to the output file

  • Array [
  • idstringrequired

    Column id.

    When exporting resource items it must be formatted as: <type>.<attribute>.

    labelstringrequired

    Column label

  • ]
  • timezonestring

    Target timezone: all data field will be remapped to this timezone

    Default value: utc
    templatestring

    Possible values: [tabular, expanded]

    Default value: tabular
    csvDelimiterstring
    typestringrequired

    Possible values: [recurring, oneTime]

    items object[]required
  • Array [
  • params objectrequired
    oneOf
    target objectrequired
    valuestringrequired

    Identifier of the resource the be exported: typically a URN. It is possible to export multiple resources by providing a comma separated list of values.

    labelstring

    Label that will replace the target value. If multiple values are provided, you can can pass a comma separated list of labels. The number of labels must match the number of values.

    channelIdstringrequired
    Example: 0115c85d-ef3e-4de9-9732-d0c5c4f2c482
    subtopicstringrequired

    Subtopic from which to retrieve data for export

    Example: events.data
    fromnumber

    Unix timestamp: number of seconds since 1970 UTC

    tonumber

    Unix timestamp: number of seconds since 1970 UTC

    periodstring

    ISO8601 Duration: https://en.wikipedia.org/wiki/ISO_8601#Durations

    Possible values: Value must match regular expression durationRegExp

    Example: P1Y6M4DT12H30M5S
    decimation object
    dsobjectrequired

    Decimation granularity. Only supports positive integer.

    Example: 15m
    dsfstringrequired

    Aggregation algotithm

    Possible values: [avg, max, min, sum, stddev, variance]

    transformstring

    Possible values: [delta]

    outputFormatstringrequired

    Determines how exported data will be formatted in the output file. Check the following link for more info: https://en.wikipedia.org/wiki/Wide_and_narrow_data

    In the long format exported variables are spread across multiple rows. In the wide format exported variables are spread across multiple columns, and each row represents a different timestamp.

    If wide format is selected, request.colums must be provided.

    Possible values: [long, wide]

    Default value: long
    filenamestring

    Name of the output file (without extension)

  • ]
  • periodicitystring

    ISO8601 Duration: https://en.wikipedia.org/wiki/ISO_8601#Durations

    Possible values: Value must match regular expression durationRegExp

    Example: P1Y6M4DT12H30M5S
    periodStartnumber

    Period start expressed in Unix timestamp. If not specified, the creation date of the request will be used.

    notification objectrequired
    messages object[]required

    Notification messages. For each notification, there must be exactly two notification messages with the two different policies (onSuccess, onFailure)

  • Array [
  • targetstring

    Notification target: can be an email address, a phone number or a telegram account. If not specified, the notification target is set to the user that created the rule.

    policystringrequired

    The notification policy: whether it is associated with a success event (export delivered), or a failure event (export failed)

    Possible values: [onSuccess, onFailure]

    mediumstringrequired

    Possible values: [email, telegram, slack, discord]

    titlestringrequired
    textstringrequired
  • ]
  • idstringrequired
    createdAtstring<date-time>required
    updatedAtstring<date-time>required
    deletedAtstring<date-time>required
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://connhex.com/exports");
request.Headers.Add("Accept", "application/json");
var content = new StringContent("{\n \"format\": {\n \"filename\": \"string\",\n \"extension\": \"csv\",\n \"columns\": [\n {\n \"id\": \"string\",\n \"label\": \"string\"\n }\n ],\n \"timezone\": \"utc\",\n \"template\": \"tabular\",\n \"csvDelimiter\": \"string\"\n },\n \"type\": \"recurring\",\n \"items\": [\n {\n \"params\": {\n \"target\": {\n \"value\": \"string\",\n \"label\": \"string\"\n },\n \"channelId\": \"0115c85d-ef3e-4de9-9732-d0c5c4f2c482\",\n \"subtopic\": \"events.data\",\n \"from\": 0,\n \"to\": 0,\n \"period\": \"P1Y6M4DT12H30M5S\",\n \"decimation\": {\n \"ds\": \"15m\",\n \"dsf\": \"avg\"\n },\n \"transform\": \"delta\",\n \"outputFormat\": \"long\"\n },\n \"filename\": \"string\"\n }\n ],\n \"periodicity\": \"P1Y6M4DT12H30M5S\",\n \"periodStart\": 0,\n \"notification\": {\n \"messages\": [\n {\n \"target\": \"string\",\n \"policy\": \"onSuccess\",\n \"medium\": \"email\",\n \"title\": \"string\",\n \"text\": \"string\"\n }\n ]\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Body required
{
  "format": {
    "filename": "string",
    "extension": "csv",
    "columns": [
      {
        "id": "string",
        "label": "string"
      }
    ],
    "timezone": "utc",
    "template": "tabular",
    "csvDelimiter": "string"
  },
  "type": "recurring",
  "items": [
    {
      "params": {
        "target": {
          "value": "string",
          "label": "string"
        },
        "channelId": "0115c85d-ef3e-4de9-9732-d0c5c4f2c482",
        "subtopic": "events.data",
        "from": 0,
        "to": 0,
        "period": "P1Y6M4DT12H30M5S",
        "decimation": {
          "ds": "15m",
          "dsf": "avg"
        },
        "transform": "delta",
        "outputFormat": "long"
      },
      "filename": "string"
    }
  ],
  "periodicity": "P1Y6M4DT12H30M5S",
  "periodStart": 0,
  "notification": {
    "messages": [
      {
        "target": "string",
        "policy": "onSuccess",
        "medium": "email",
        "title": "string",
        "text": "string"
      }
    ]
  }
}