Skip to main content
POST
/
organizations
/
{orgId}
/
dataexplorer
/
usagedata
/
download
/
csv
Download aggregated usage data as a CSV.
curl --request POST \
  --url https://api.m3ter.com/organizations/{orgId}/dataexplorer/usagedata/download/csv \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "meterCodes": [
    "<string>"
  ],
  "startDate": "2023-11-07T05:31:56Z",
  "endDate": "2023-11-07T05:31:56Z",
  "aggregationFrequency": "DAY",
  "measures": [
    {
      "name": "<string>",
      "aggregations": [
        "SUM"
      ]
    }
  ],
  "version": 123,
  "dimensions": [
    {
      "name": "<string>",
      "filter": [
        "<string>"
      ],
      "attributes": [
        "<string>"
      ]
    }
  ],
  "limit": 2500
}
'
{
  "downloadUrl": "<string>"
}

Authorizations

Authorization
string
header
required

m3ter supports machine to machine authentication using the clientCredentials OAuth2 flow.

The authorizationCode flow controls access for human users via the m3ter Console application.

Path Parameters

orgId
string
required

UUID of the organization

Body

application/json

Data Explorer query request

meterCodes
string[]
required

Codes representing Meters, or an empty list for a wildcard (i.e. all Meters).

Maximum array length: 100
startDate
string<date-time>
required

ISO 8601 formatted start date for the aggregation.

endDate
string<date-time>
required

ISO 8601 formatted end date for the aggregation.

aggregationFrequency
enum<string>
required
Available options:
DAY,
WEEK,
MONTH,
QUARTER,
YEAR,
WHOLE_PERIOD
measures
object[]
required

Measures to retrieve usage data entries for

Required array length: 1 - 30 elements
version
integer<int64>

The version number of the entity:

  • Create entity: Not valid for initial insertion of new entity - do not use for Create. On initial Create, version is set at 1 and listed in the response.
  • Update Entity: On Update, version is required and must match the existing version because a check is performed to ensure sequential versioning is preserved. Version is incremented by 1 and listed in the response.
dimensions
object[]

Dimensions to filter by

Maximum array length: 100
limit
integer<int32>

Limit the number of data points returned

Required range: 1 <= x <= 5000

Response

Contains a link to download the file.

Download link for Data Explorer data

downloadUrl
string<url>