NNarya Developers
API referenceDevice set-up

Issue an activation code

POST
/integration/v1/devices/{id}/activation-codes

Issues a one-time code that activates the device.

An activated device can be issued a code too, to pair it again after a reinstall, a factory reset or a hardware swap. It keeps working until the new code is used, so issuing one does not interrupt it, and a code that is never used changes nothing.

A new code replaces any earlier unused one. Narya does not keep the code, so a retry issues a new code that replaces the first, even with the same Idempotency-Key.

A suspended or decommissioned device is refused with 409, and the problem's detail says which. A suspended device must be resumed in the Narya portal first.

Authorization

integrationKey
headerAuthorizationBearer <token>

Your integration key, sent as Authorization: Bearer nik_<prefix>_<secret>. Narya issues it.

Path Parameters

id*string
Formatuuid

Response Body

The code was issued

application/json
  1. response
activation_code*string

The 8-digit code. Keep it a string; it can begin with zero.

issued_at*string
Formatdate-time
expires_at?|
Formatdate-time
superseded_previous*boolean

True when an earlier unused code was replaced.

Example Request
curl -X POST 'https://api-narya-staging.pmadvisors.my/integration/v1/devices/497f6eca-6276-4993-bfeb-53cbbbba6f08/activation-codes'
Example Response
{  "activation_code": "string",  "issued_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "superseded_previous": true}