Create Device
Allows to create a new device.
Authorizations
Path parameters
PROJECT_IDstringRequired
Body
objectOptionalExample:
{ "name":"string", "description":"string", "source":"string", //only "http" or "mqtt" "tags":["string"], // not required empty array is welcome "brand":"string", //not required will be "Custom" if omitted "model":"string", //not required will be "Custom" if omitted "metadata": { "key":"value" } // custom object for any key value pair storage }
Responses
201
Created
application/json
Responseobject
400
Bad Request
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
post
POST /v2/projects/{PROJECT_ID}/devices HTTP/1.1
Host: api.qubitro.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 415
"{\n \"name\":\"string\",\n \"description\":\"string\",\n \"source\":\"string\", //only \"http\" or \"mqtt\"\n \"tags\":[\"string\"], // not required empty array is welcome\n \"brand\":\"string\", //not required will be \"Custom\" if omitted\n \"model\":\"string\", //not required will be \"Custom\" if omitted\n \"metadata\": {\n \"key\":\"value\"\n } // custom object for any key value pair storage\n}"
{
"success": true,
"action": "create device",
"status": 201,
"message": "Device created successfully.",
"data": {
"id": "string",
"name": "string",
"description": "string",
"brand": "string",
"model": "string",
"avatar": "https://static.qubitro.com/portal/device/avatar/default.png",
"last_seen": "0001-01-01T00:00:00Z",
"tags": [
"string"
],
"device_credentials": {
"device_id": "string",
"device_token": "string"
},
"metadata": {
"key": "value"
}
}
}
Last updated