Generate Device Key
Description
set key for a device if it does not exists.
Request
POST /v1/domains/:domain/keys/devices/:deviceId
Response
Successful response contains the following JSON formated body:
{
deviceId: string,
preSharedKey: string
}
Response Status codes:
-
200 on success
-
409 if device exists
Request headers
This request must have the following headers:
Authorization: bearer <ApiKey>
X-Nabto-Organization: <organizationId>
Example
Request
curl -XPOST "https://api.cloud.nabto.com/v1/domains/:domain/keys/devices/:deviceId" \
-H "Authorization: Bearer <ApiKey>" \
-H "X-Nabto-Organization: <OrganizationId>"
Response
{
deviceId: "a.mydomain.example.net",
preSharedKey: "01010101010101010101010101010101"
}