KKonsol Developers
API referenceArtifact downloads

Get a download URL for an application release

POST
/device/v1/artifact-downloads

Returns a short-lived URL for downloading an assigned application release. Call it when an application's outcome is assigned and the terminal does not have that build yet, then download the file directly from the URL.

Request a new URL for every download; a URL works only until its expires_at. Verify the file against artifact.sha256 before installing it.

A terminal that is not assigned the artifact receives 404, exactly as for an artifact that does not exist. If the service is temporarily unavailable the response is 503 with Retry-After: keep running the installed release and try again later. Transactions and heartbeats are not affected.

Authorization

DeviceAuth
headerAuthorizationBearer <dvc_<prefix>_<secret>>

The terminal's device token, returned once by POST /device/v1/activations. Send it as Authorization: Bearer <token> on every request except activation.

Request Body

application/json
  1. body
artifact_id*string

The artifact.artifact_id of an application release assigned to this terminal.

Formatuuid

Response Body

The download URL.

application/json
  1. response

How to download the file. Make the request exactly as described before expires_at: the URL works only until then, and only with these headers. Request a new URL for each download, and never store one.

url*string

The download URL.

method*string

The HTTP method to use.

headers*

Headers to send with the request, exactly as given.

expires_at*string

When the URL stops working.

Formatdate-time
Example Request
curl -X POST 'https://device.konsol.my/device/v1/artifact-downloads' \  -H 'Content-Type: application/json' \  -d '{  "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12"}'
Example Response
{  "url": "string",  "method": "string",  "headers": {    "property1": "string",    "property2": "string"  },  "expires_at": "2019-08-24T14:15:22Z"}