Skip to main content

Create export request

POST 

/exports

Create export request.

Authorization Action:

exporter:exports:create

Request

Body

required
    format objectrequired
    extension stringrequired

    Possible values: [csv, xlsx, pdf]

    columns object[]

    Define how exported data fields are mapped to the output file

  • Array [
  • id stringrequired

    Column id.

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

    label stringrequired

    Column label

  • ]
  • timezone string

    Default value: utc

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

    template string

    Possible values: [tabular, expanded]

    Default value: tabular

    type stringrequired

    Possible values: [recurring, oneTime]

    items object[]required
  • Array [
  • params objectrequired
    oneOf
    target objectrequired
    value stringrequired

    Identifier of the resource the be exported: typically a URN

    label string

    Label that will replace the target value

    channelId stringrequired
    subtopic stringrequired

    Subtopic from which to retrieve data for export

    from number

    Unix timestamp: number of seconds since 1970 UTC

    to number

    Unix timestamp: number of seconds since 1970 UTC

    period string

    Possible values: Value must match regular expression durationRegExp

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

    decimation object
    ds objectrequired

    Decimation granularity. Only supports positive integer.

    dsf stringrequired

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

    Aggregation algotithm

    transform string

    Possible values: [delta]

    filename string

    Name of the output file (without extension)

  • ]
  • periodicity string

    Possible values: Value must match regular expression durationRegExp

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

    periodStart number

    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 [
  • policy stringrequired

    Possible values: [onSuccess, onFailure]

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

    medium stringrequired

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

    title stringrequired
    text stringrequired
  • ]

Responses

Schema
    format objectrequired
    extension stringrequired

    Possible values: [csv, xlsx, pdf]

    columns object[]

    Define how exported data fields are mapped to the output file

  • Array [
  • id stringrequired

    Column id.

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

    label stringrequired

    Column label

  • ]
  • timezone string

    Default value: utc

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

    template string

    Possible values: [tabular, expanded]

    Default value: tabular

    type stringrequired

    Possible values: [recurring, oneTime]

    items object[]required
  • Array [
  • params objectrequired
    oneOf
    target objectrequired
    value stringrequired

    Identifier of the resource the be exported: typically a URN

    label string

    Label that will replace the target value

    channelId stringrequired
    subtopic stringrequired

    Subtopic from which to retrieve data for export

    from number

    Unix timestamp: number of seconds since 1970 UTC

    to number

    Unix timestamp: number of seconds since 1970 UTC

    period string

    Possible values: Value must match regular expression durationRegExp

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

    decimation object
    ds objectrequired

    Decimation granularity. Only supports positive integer.

    dsf stringrequired

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

    Aggregation algotithm

    transform string

    Possible values: [delta]

    filename string

    Name of the output file (without extension)

  • ]
  • periodicity string

    Possible values: Value must match regular expression durationRegExp

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

    periodStart number

    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 [
  • policy stringrequired

    Possible values: [onSuccess, onFailure]

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

    medium stringrequired

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

    title stringrequired
    text stringrequired
  • ]
  • id stringrequired
    createdAt date-timerequired
    updatedAt date-timerequired
    deletedAt date-timerequired
curl -L -X POST 'https://connhex.com/exports' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"format": {
"extension": "csv",
"columns": [
{
"id": "string",
"label": "string"
}
],
"timezone": "utc",
"template": "tabular"
},
"type": "recurring",
"items": [
{
"params": {
"target": {
"value": "urn:cpt:smartdevice:nid:D0CF5EFFFE26FDAB1:onoff",
"label": "onoff"
},
"channelId": "0115c85d-ef3e-4de9-9732-d0c5c4f2c482",
"subtopic": "events.data",
"from": 0,
"to": 0,
"period": "P1Y6M4DT12H30M5S",
"decimation": {
"ds": "15m",
"dsf": "avg"
},
"transform": "delta"
},
"filename": "string"
}
],
"periodicity": "P1Y6M4DT12H30M5S",
"periodStart": 0,
"notification": {
"messages": [
{
"policy": "onSuccess",
"medium": "email",
"title": "string",
"text": "string"
}
]
}
}'
Request Collapse all
Body required
{
"format": {
"extension": "csv",
"columns": [
{
"id": "string",
"label": "string"
}
],
"timezone": "utc",
"template": "tabular"
},
"type": "recurring",
"items": [
{
"params": {
"target": {
"value": "urn:cpt:smartdevice:nid:D0CF5EFFFE26FDAB1:onoff",
"label": "onoff"
},
"channelId": "0115c85d-ef3e-4de9-9732-d0c5c4f2c482",
"subtopic": "events.data",
"from": 0,
"to": 0,
"period": "P1Y6M4DT12H30M5S",
"decimation": {
"ds": "15m",
"dsf": "avg"
},
"transform": "delta"
},
"filename": "string"
}
],
"periodicity": "P1Y6M4DT12H30M5S",
"periodStart": 0,
"notification": {
"messages": [
{
"policy": "onSuccess",
"medium": "email",
"title": "string",
"text": "string"
}
]
}
}