Initiate Upload Session

POST/deviceLogger/{token}

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

Initiate the file upload for a log request. To upload a log file, the device must first initiate an upload and obtain pre-signed secure URL(s) for the actual file upload. After the upload is complete, the client must make another request to commit the upload. A device may call this endpoint again if it wishes to reset a previously initiated upload session.

Authentication

This endpoint does not require authentication.

Path parameters

NameTypeRequiredConstraintsDescription
tokenstringYesAuthentication token that is passed to device by DDP

Request body

Content type: application/json

PropertyTypeRequiredConstraintsDescription
contentTypestringYesMIME type of file to upload.
filenamestringNoFilename of file to upload.
sizeintegerYesSize of the whole file to upload.

Responses

201 Upload session initiated. The response contains the information needed for the file upload, and the session ID needed to commit the session after the upload is done.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
numOfPartsintegerNoNumber of parts the log file should be split into.
partSizeintegerNoSize of a single part except for the last part. The last part must contain the remaining bytes of the log file.
uploadIdstringNoA unique ID for the upload session. Needed for the API endpoint to commit the session when the upload in finished.
urlsarray<string>NoURLs for uploading the parts, one for each part of the log file.

403 Request failed because of invalid data or denied permission.

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.