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
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
token | string | Yes | Authentication token that is passed to device by DDP |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
contentType | string | Yes | MIME type of file to upload. | |
filename | string | No | Filename of file to upload. | |
size | integer | Yes | Size 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
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
numOfParts | integer | No | Number of parts the log file should be split into. | |
partSize | integer | No | Size of a single part except for the last part. The last part must contain the remaining bytes of the log file. | |
uploadId | string | No | A unique ID for the upload session. Needed for the API endpoint to commit the session when the upload in finished. | |
urls | array<string> | No | URLs 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
| 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. |