Skip to main content

Devices

List devices

List all the devices registered with your organization.

In the URL below, you will need to substitute :id with the id value you retreived with the account endpoint:

GET /organizations/:id/devices

Parameters

Name Type Default Description
limit number 10 The number of items to be returned by page
page number 1 The page number
productId string   The device product ID to search for
hasProduct boolean   Either true to filter devices with a product, or false to disable this filter
q string   The search regex in serial, name, slug and serial fields
sort string   The sort order
curl \
  --request GET \
  --url 'https://api.hl2.com/panorama/v1/organizations/5a21805903e0870010c8f618/devices'

Response

The response array looks like the following (the order of the fields may vary):

[
  {
    "name": "name",
    "product": {
        "organizationId": "58a6e83030aacc000e29a454",
        "id": "5989b116279b6000105a21d4"
    },
    "slug": "name",
    "organizationId": "5a21805903e0870010c8f618",
    "tags": [
      "temp"
    ],
    "serial": "92d0eac3-5cec-49fa-af8b-257e74580719",
    "applicationCount": 1,
    "id": "5989b177279b6000105a21d8"
  }
]

Register a device

Register a device with your organization.

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, and :deviceSerial with the device’s serial number (dash-separated hex string):

POST /organizations/:organizationId/devices/:deviceSerial

Input

Name Type Description
name string The device name
tags array The device tags as an array of strings
product object The device’s product details
product.id string The device’s product identifier
product.organizationId string The product’s organization identifier
location object The device’s location details
location.lat number The device’s latitude
location.lon number The device’s longitude
curl \
  --request POST \
  --url 'https://api.hl2.com/panorama/v1/organizations/5a21805903e0870010c8f618/devices/f63f4fed-4c40-470e-9ef0-f8e9fc4ab627' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "device",
    "location": {
      "lat": 46.2801587,
      "lon": -0.1648062
    },
    "product": {
      "organizationId": "5847f1685bba9a8da519107f",
      "id": "589d82b29e2511000ee0c2db"
    },
    "tags": [
      "temp"
    ]
  }'

Response

The response object looks like the following (the order of the fields may vary):

{
  "slug": "device",
  "location": {
    "lat": 46.2801587,
    "lon": -0.1648062
  },
  "name": "device",
  "organizationId": "5a21805903e0870010c8f618",
  "updatedAt": "2017-12-11T12:24:02.694Z",
  "createdAt": "2017-12-11T12:19:31.327Z",
  "serial": "f63f4fed-4c40-470e-9ef0-f8e9fc4ab627",
  "applicationCount": 0,
  "id": "5a2e77d3ffcd0900103e61b1",
  "product": {
    "organizationId": "5847f1685bba9a8da519107f",
    "id": "589d82b29e2511000ee0c2db"
  },
  "tags": [
    "temp"
  ]
}

Get a device

Get the details for a device registered with your organization.

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, and :deviceId with one of the values returned by the “List devices” endpoint above:

GET /devices/:organizationId/:deviceId

curl \
  --request GET \
  --url 'https://api.hl2.com/panorama/v1/devices/5a21805903e0870010c8f618/5a2e77d3ffcd0900103e61b1'

Response

The response object looks like the following (the order of the fields may vary):

{
  "updatedAt": "2017-12-11T12:24:02.694Z",
  "createdAt": "2017-12-11T12:19:31.327Z",
  "location": {
    "lat": 46.2801587,
    "lon": -0.1648062
  },
  "name": "device",
  "organizationId": "5a21805903e0870010c8f618",
  "slug": "device",
  "product": {
    "organizationId": "5847f1685bba9a8da519107f",
    "id": "589d82b29e2511000ee0c2db"
  },
  "tags": [
    "temp"
  ],
  "serial": "f63f4fed-4c40-470e-9ef0-f8e9fc4ab627",
  "applicationCount": 0,
  "id": "5a2e77d3ffcd0900103e61b1"
}

Update a device

Update the details for a device registered with your organization.

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, and :deviceId with one of the values returned by the “List devices” endpoint above:

PUT /devices/:organizationId/:deviceId

Input

Name Type Description
name string The device name
tags array The device tags as an array of strings
product object The device’s product details
product.id string The device’s product identifier
product.organizationId string The product’s organization identifier
location object The device’s location details
location.lat number The device’s latitude
location.lon number The device’s longitude
curl \
  --request PUT \
  --url 'https://api.hl2.com/panorama/v1/devices/5a21805903e0870010c8f618/58d0e0645eadd86e459149fa' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "foo",
    "location": {
      "lat": 46.2801587,
      "lon": -0.1648062
    },
    "product": {
      "organizationId": "5847f1685bba9a8da519107f",
      "id": "589d82b29e2511000ee0c2db"
    }
  }'

Response

The response object looks like the following (the order of the fields may vary):

{
  "location": {
    "lat": 46.2801587,
    "lon": -0.1648062
  },
  "updatedAt": "2017-12-11T13:03:03.383Z",
  "createdAt": "2017-12-11T12:19:31.327Z",
  "name": "foo",
  "organizationId": "5a21805903e0870010c8f618",
  "slug": "foo",
  "serial": "f63f4fed-4c40-470e-9ef0-f8e9fc4ab627",
  "applicationCount": 0,
  "id": "5a2e77d3ffcd0900103e61b1",
  "product": {
    "organizationId": "5847f1685bba9a8da519107f",
    "id": "589d82b29e2511000ee0c2db"
  }
}

Unregister a device

Remove the device from your organization. This will not be possible if the device is linked to any application.

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, and :deviceId with one of the values returned by the “List devices” endpoint above:

DELETE /devices/:organizationId/:deviceId

curl \
  --request DELETE \
  --url 'https://api.hl2.com/panorama/v1/devices/5a21805903e0870010c8f618/5a2e77d3ffcd0900103e61b1'