Activate a terminal
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; Narya 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.
application/json- body
activation_code*stringThe 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.
1 <= length <= 64device_identifier*stringThe 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 Narya 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.
1 <= length <= 128The terminal is activated.
application/json- response
The terminal's new credential. token appears only in this response: store
it before doing anything else.
device_id*stringThe Narya device the terminal activated as. Show it during installation so the installer can confirm the code was entered on the right terminal.
uuidcredential_id*stringIdentifies this credential. Not a secret.
uuidtoken*stringThe device token, in the form dvc_<prefix>_<secret>. Send it as
Authorization: Bearer <token> on every other request. Narya cannot show it
again: if it is lost, activate the terminal again with a new code.
issued_at*stringWhen the token was issued.
date-timecurl -X POST 'https://device-narya-staging.pmadvisors.my/device/v1/activations' \ -H 'Content-Type: application/json' \ -d '{ "activation_code": "48392105", "device_identifier": "SN-0001"}'{ "device_id": "3bafab7b-4400-4bcf-8e6e-09f954699940", "credential_id": "13c40afa-2996-4a0c-b2e9-68fba9462242", "token": "string", "issued_at": "2019-08-24T14:15:22Z"}