Export time series data

POST/homes/{homeId}/smartModules/{moduleId}/export

Base URL: https://api.tinkermode.com

Export the data in one or more time series or time series collections. The request body must be a valid Time Series Export Request object. Use the seriesIds field in the request object to export time series, or the collectionIds field to export collections.

Authentication

Send an Authorization header of the form ModeCloud <AUTH_CODE>.

Must contain a user, service account, or project API key.

Path parameters

NameTypeRequiredConstraintsDescription
homeIdintegerYesThe unique id for a home.
moduleIdstringYesThe unique id for a smart module.

Request body

Content type: application/json

PropertyTypeRequiredConstraintsDescription
beginstringYesread-only (server-generated); format: date-timeThe beginning timestamp of the export time range (in RFC3339).
collectionIdsarrayNoread-only (server-generated)Array of collection IDs whose data are to be exported.
endstringYesread-only (server-generated); format: data-timeThe ending timestamp of the export time range (in RFC3339).
fileNamesarrayNoread-only (server-generated)Optional field to specify export file names. It should correspond to seriesIds/collectionIds in number and order. If omitted, series or collection IDs will be used in the file names.
includeHeaderbooleanNoread-only (server-generated)If true, each exported CSV file will start with a header. Used only when exporting collections.
seriesIdsarrayNoread-only (server-generated)Array of series IDs whose data are to be exported.
timeFormatstringNoread-only (server-generated)Optional parameter to specify the timestamp format in the exported CSV. Use "rfc3339Milli" for RFC3339 format with millisecond precision. If omitted, the default format (YYYY/MM/DD HH:MM:SS) is used.

Request example

{
  "begin": "2019-05-10T10:00:00Z",
  "end": "2019-05-11T13:00:00Z",
  "seriesIds": [
    "rm1_humidity",
    "rm1_temperature"
  ]
}

Responses

200 The URLs for downloading the exported data are returned.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataUrlstringYesread-only (server-generated)URL of file containing the exported data. This URL is usable only if the export is completed successfully.
statusUrlstringYesread-only (server-generated)URL to a JSON file that reports the status of the export. Clients should poll this URL until a file is returned.

401 Authorization is required to access this resource.

403 Request failed because of invalid request parameters.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.