Register devices in bulk
Registers up to 1100 devices of one vendor and model in one request.
Each serial becomes a device as POST /integration/v1/devices would
make it.
Some serials can fail while others succeed, and the response is still
200:
added: the devices created.already_exists: serials a device already has; skipped.rejected: serials not added, with areason.failedmeans Konsol could not write that part of the batch.
Sending the same body again is safe. Serials added the first time
come back in already_exists, so resend to retry the failed ones.
integrationKeyAuthorizationBearer <token>Your integration key, sent as Authorization: Bearer nik_<prefix>_<secret>.
Konsol issues it.
Idempotency-Key?stringA unique value per logical request, such as a UUID. Within 24 hours a repeat
with the same key, path and body returns the first response; the same key
with a different path or body is a 409.
1 <= length <= 255application/json- body
vendor_id*stringThe vendor that supplied every device in the batch.
uuidmodel_id*stringThe model of every device in the batch. It must belong to vendor_id.
uuidserials*array<>Each becomes a device's device_identifier. Identifiers are unique in your
organisation, ignoring letter case. A serial must match
^[A-Za-z0-9][A-Za-z0-9._-]{3,31}$ or it is rejected as invalid_serial; a
repeat of an earlier serial in this list is rejected as
duplicate_in_batch.
1 <= items <= 1100What was added, what already existed, and what was not added
application/json- response
requested*integerHow many serials the body carried, repeats included.
added*array<>already_exists*array<string>Serials a device already has; skipped.
rejected*array<>curl -X POST 'https://api.konsol.my/integration/v1/devices/batch' \ -H 'Content-Type: application/json' \ -d '{ "vendor_id": "98232994-9d54-43ee-a280-d7c895362d0c", "model_id": "f8ff2fb8-4acc-4e48-bd83-cbdac23e1224", "serials": [ "string" ]}'{ "requested": 5, "added": [ { "serial": "PAX0012346", "device_id": "01a15ef6-b96f-7838-bdf7-8c94db441bf6" }, { "serial": "PAX0012347", "device_id": "01a15ef6-b96f-783a-a5d2-f82ea39f655b" } ], "already_exists": [ "PAX0012345" ], "rejected": [ { "serial": "PAX0012346", "reason": "duplicate_in_batch" }, { "serial": "x", "reason": "invalid_serial" } ]}