Data File Upload Process

This page describes the basic process a device should follow to successfully upload data files to Spoke Zone. The header of any data file API upload request should always include an x-access-token field with the device access token.

v2 API

For detailed information about the API endpoints, check out the API Docs.

For detailed information on types of data files, check out this page.

The v2 API uses a two step process to upload a data file.

  1. POST /api/v2/data-files to setup the data file.
    • The body of the request should be in JSON format and include a type variable to determine the type of data file to be uploaded.
      • Example body: { "type": "log" }
    • If the request was successful, the API will send a 200 response with a JSON object containing the id of the newly created data file.
      • Use the id from this response in the next request to specify which data file ID to upload content to.
  2. POST /api/v2/data-files/:id/file to upload the contents of the data file.
    • The body of the request should be in form-data format and requires a files field with the file to be uploaded.
    • If the request was successful, the API will send a 200 response with a JSON object containing the file upload path.
Notesv1 API

This API is deprecated and should be avoided. It has several subtle bugs and oddities. It is maintained for backwards-compatibility with devices in the field.

The v1 API uses a single endpoint to upload data files to Spoke Zone.

Notes