KKonsol Developers

Activate a terminal

POST
/device/v1/activations

Exchanges a one-time activation code for the terminal's device token. Call it once, at installation, with the code the installer entered.

The response contains the token, once. Store it in secure storage before doing anything else; Konsol cannot show it again. Activating revokes any token the terminal held before, and a code works only once.

This is the only operation that needs no credential.

Request Body

application/json
  1. body
activation_code*string

The 8-digit code as the installer entered it. Spaces and dashes are ignored; any other character that is not a digit makes the code invalid. Keep it a string, because a code can begin with zero.

Length1 <= length <= 64
device_identifier*string

The terminal's identifier, usually its serial number, as your software reads it from the device. It must match the identifier the terminal was registered with in Konsol exactly, with no trimming or change of case. A mismatch is answered 401, the same as an invalid code. A replacement terminal needs its registration updated before it can activate.

Length1 <= length <= 128

Response Body

The terminal is activated.

application/json
  1. response

The terminal's new credential. token appears only in this response: store it before doing anything else.

device_id*string

The Konsol device the terminal activated as. Show it during installation so the installer can confirm the code was entered on the right terminal.

Formatuuid
credential_id*string

Identifies this credential. Not a secret.

Formatuuid
token*string

The device token, in the form dvc_<prefix>_<secret>. Send it as Authorization: Bearer <token> on every other request. Konsol cannot show it again: if it is lost, activate the terminal again with a new code.

issued_at*string

When the token was issued.

Formatdate-time
Example Request
curl -X POST 'https://device.konsol.my/device/v1/activations' \  -H 'Content-Type: application/json' \  -d '{  "activation_code": "48392105",  "device_identifier": "SN-0001"}'
Example Response
{  "device_id": "3bafab7b-4400-4bcf-8e6e-09f954699940",  "credential_id": "13c40afa-2996-4a0c-b2e9-68fba9462242",  "token": "string",  "issued_at": "2019-08-24T14:15:22Z"}