Reports

Query report data and export to file

Request a file export of data from any report json that is not created

Query report data from a report that is not created

Based on the report type sent in the request, the data structure returned may have multiple formats.

Mode:

  • Export: 100000 Records

Types

List

{
    ...
    "columns": ...
    "settings": {
        ...
        "totals": false,
        "transpose": false,
    }
}

List (Totals)

{
    ...
    "columns": ...
    "settings": {
        ...
        "totals": true,
        "transpose": false,

    }
}

PeriodList

{
    ...
    "columns": ...
    "periods": ...
    "settings": {
        ...
        "totals": false,
        "transpose": true|false,
    }
}

Summary

{
    ...
    "columns": ...
    "group_rows": ...
    "settings": {
        ...
        "totals": false,
        "transpose": true|false,

    }
}

Summary (Totals)

{
    ...
    "columns": ...
    "group_rows": ...
    "settings": {
        ...
        "totals": true
        "transpose: true|false,
    }
}

PeriodSummary

{
    ...
    "columns": ...
    "group_rows": ...
    "periods": ...
    "settings": {
        ...
        "totals": false,
        "transpose": true|false,
    }
}

Pivot

{
    ...
    "columns": ...
    "group_rows": ...
    "group_columns": ...
    "settings": {
        ...
        "totals": false,
        "transpose": true|false
    }
}

Pivot (Totals)

{
    ...
    "columns": ...
    "group_rows": ...
    "group_columns": ...
    "settings": {
        ...
        "totals": true,
        "transpose": true|false,
    }
}

Data

TypeHeadersIndexRecordsGroup RowsGroup ColumnsTotalsPeriodsTranspose
ListYesNoYesNoNoNoNoNo
List (Totals)YesNoYesNoNoYesNoNo
PeriodListYesYesYesNoNoNoYesYes
SummaryYesYesYesYesNoNoNoYes
Summary (Details)YesYesYesYesNoYesNoNo
Summary (Totals)YesYesYesYesNoYesNoYes
PeriodSummaryYesYesYesYesNoNoYesYes
PivotYesYesYesYesYesNoNoYes
Pivot (Totals)YesYesYesYesYesYesNoYes
post/datainsights/v1.1/reports/query/export

Request

  • The document declares no server URL.
  • Auth
    HTTP bearer

Query parameters

view'details' | 'formatted' required
Example:details

View: should be either 'formatted' or 'details'

format'xlsx' | 'csv' | 'json' required
Example:xlsx

Format: should be either 'xlsx', 'csv' or 'json'

include_chartsboolean
Example:true

Flag to include charts in the export, defaults to True

Headers

X-PROPERTY-IDinteger required

Property id of the client

Request body

titlestring required

Report title

property_idsinteger[] required

Report property ids

dataset_id1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 required

Dataset id

Example request

{
  "title": "Report title",
  "dataset_id": 1,
  "columns": [
    {
      "cdf": {
        "type": "default",
        "column": "credit_amount"
      },
      "metrics": [
        "sum"
      ]
    }
  ],
  "group_rows": [
    {
      "cdf": {
        "type": "default",
        "column": "credit_amount"
      }
    }
  ],
  "group_columns": [
    {
      "cdf": {
        "type": "default",
        "column": "credit_amount"
      }
    }
  ],
  "custom_cdfs": [
    {
      "column": "full_address",
      "name": "Full address",
      "description": "CDF with the full address information",
      "kind": "String",
      "format": "currency"
    }
  ],
  "filters": {
    "and": [
      {
        "cdf": {
          "type": "default",
          "column": "credit_amount"
        }
      }
    ],
    "or": [
      {
        "cdf": {
          "type": "default",
          "column": "credit_amount"
        }
      }
    ]
  },
  "sort": [
    {
      "cdf": {
        "type": "default",
        "column": "credit_amount"
      },
      "direction": "asc"
    }
  ],
  "periods": [
    {
      "cdf": {
        "type": "default",
        "column": "credit_amount"
      },
      "name": "Month-To-Date",
      "id": "start_of_last_year_to_today",
      "start": "'2014-12-22T03:12:58'|'start_current_year'",
      "end": "'2014-12-22T03:12:58'|'today'"
    }
  ],
  "formats": {
    "date": "YYYY-MM-DD"
  },
  "comparisons": [
    {
      "name": "Range 1",
      "id": "range_1",
      "filters": {
        "and": [
          {
            "cdf": {
              "type": "default",
              "column": "credit_amount"
            }
          }
        ]
      }
    }
  ]
}

Response

OK

urlstring url

Url to get the exported report

format'xlsx' | 'csv' | 'json'

Format: should be either 'xlsx', 'csv' or 'json'

view'details' | 'formatted'

View: should be either 'formatted' or 'details'

filenamestring

Name of the file exported

generated_atstring

File generated at

Example response

{
  "url": "https://...",
  "format": "xlsx",
  "view": "details"
}

Changes

No recorded changes to this operation across all 1 revision of this API.