Skip to main content

Create export request

POST 

/exports

Create export request.

Authorization Action:

exporter:exports:create

Request

Bodyrequired

    format objectrequired
    extensionstringrequired

    Possible values: [csv, xls]

    columns object[]required
  • Array [
  • idstringrequired

    Column id

    Example: unit
    labelstringrequired

    Column label

    Example: unit of measure
  • ]
  • timezoneobjectrequired
    Default value: utc
    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

    Example: urn:cpt:smartdevice:nid:D0CF5EFFFE26FDAB1:onoff
    labelstring

    Label that will replace the target

    Example: onoff
    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

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

    filenamestring
  • ]
  • periodicitystring

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

    Possible values: Value must match regular expression durationRegExp

    Example: P1Y6M4DT12H30M5S
    notification objectrequired
    messages object[]required
  • Array [
  • policystringrequired

    Possible values: [onSuccess, onFailure]

    mediumstringrequired

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

    titlestringrequired
    textstringrequired
  • ]

Responses

Schema
    format objectrequired
    extensionstringrequired

    Possible values: [csv, xls]

    columns object[]required
  • Array [
  • idstringrequired

    Column id

    Example: unit
    labelstringrequired

    Column label

    Example: unit of measure
  • ]
  • timezoneobjectrequired
    Default value: utc
    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

    Example: urn:cpt:smartdevice:nid:D0CF5EFFFE26FDAB1:onoff
    labelstring

    Label that will replace the target

    Example: onoff
    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

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

    filenamestring
  • ]
  • periodicitystring

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

    Possible values: Value must match regular expression durationRegExp

    Example: P1Y6M4DT12H30M5S
    notification objectrequired
    messages object[]required
  • Array [
  • policystringrequired

    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 \"extension\": \"csv\",\n \"columns\": [\n {\n \"id\": \"unit\",\n \"label\": \"unit of measure\"\n }\n ],\n \"timezone\": {}\n },\n \"type\": \"recurring\",\n \"items\": [\n {\n \"params\": {\n \"target\": {\n \"value\": \"urn:cpt:smartdevice:nid:D0CF5EFFFE26FDAB1:onoff\",\n \"label\": \"onoff\"\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 },\n \"filename\": \"string\"\n }\n ],\n \"periodicity\": \"P1Y6M4DT12H30M5S\",\n \"notification\": {\n \"messages\": [\n {\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": {
    "extension": "csv",
    "columns": [
      {
        "id": "unit",
        "label": "unit of measure"
      }
    ],
    "timezone": {}
  },
  "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"
        }
      },
      "filename": "string"
    }
  ],
  "periodicity": "P1Y6M4DT12H30M5S",
  "notification": {
    "messages": [
      {
        "policy": "onSuccess",
        "medium": "email",
        "title": "string",
        "text": "string"
      }
    ]
  }
}