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
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
homeId | integer | Yes | The unique id for a home. | |
moduleId | string | Yes | The unique id for a smart module. |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
begin | string | Yes | read-only (server-generated); format: date-time | The beginning timestamp of the export time range (in RFC3339). |
collectionIds | array | No | read-only (server-generated) | Array of collection IDs whose data are to be exported. |
end | string | Yes | read-only (server-generated); format: data-time | The ending timestamp of the export time range (in RFC3339). |
fileNames | array | No | read-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. |
includeHeader | boolean | No | read-only (server-generated) | If true, each exported CSV file will start with a header. Used only when exporting collections. |
seriesIds | array | No | read-only (server-generated) | Array of series IDs whose data are to be exported. |
timeFormat | string | No | read-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
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
dataUrl | string | Yes | read-only (server-generated) | URL of file containing the exported data. This URL is usable only if the export is completed successfully. |
statusUrl | string | Yes | read-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
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |