Schedules a new data-import

Prev Next
Post
/data/dataImports

Imports historical metrics data for a specific thing through a CVS file.
Note that, depending on the size of the provided CSV, a data-import may require several minutes to complete.
Checkout periodically the data-import status, by calling the get data-import by id method issuing the data-import identifier.

Here is an example of the CSV file:
TIMESTAMP,<metric-name>,<metric-name>,<metric-name>
1751882400000,25,true,"foo bar"
1751882430000,26.5,false,"abc"


- The TIMESTAMP column must contain UTC values (long) in ascending order.
- The column header for a metric should be the name of the metric itself.

Limitations:
- It is possible to import historical data for any raw and computed (derived and counter) metric.
- The file provided cannot exceed the size of 10 MiB and 50.000 rows.
- Only one import per thing can be performed at a time.
- Completed imports are automatically remoded after 30 days.

Required permissions: IMPORT_DATA.

Security
HTTP
Type bearer
Header parameters
X-Servitly-Tenant
stringRequired

The name of the target tenant (e.g. acme).

Query parameters
thingId
stringRequired

The identifier of the thing whose data-imports must be retrieve.

Minimum1.0
Exampleabcd1234
csvHeaderRow
integer

The index (1-based) of the row containing the CSV header.

Minimum1.0
Body parameters

The details of the scheduled data-import.

object
file
string (binary)

The CSV file to import. In the alternative, a ZIP containing the CSV file can be provided.

Responses
201

Successful created.

object

The bean providing data-import details.

id
string

The data-import unique identifier.

dateTime
integer (int64)

The timestamp UTC the data-import has been scheduled.

Example1578438000000
state
string

The data-import status.

Valid values[ "PENDING", "COMPLETED", "ERROR" ]
400

Request data not valid.

object
message
string

The error response.

ExampleBad request
401

User not authenticated.

object
message
string

The error response.

ExampleUser not authenticated
403

User not authorized.

object
message
string

The error response.

ExampleUser not authorized
429

API call rate limit exeeded.

object
message
string

The error response.

ExampleAPI call rate limit exeeded
500

Internal server error.

object
message
string

The error response.

ExampleInternal Server Error