Skip to main content

Products

List public products

List all the public products, whether they belong to your organization or not.

GET /products

Parameters

Name Type Default Description
limit number 10 The number of items to be returned by page
page number 1 The page number
q string   The search regex in name, slug and version fields
sort string   The sort order
curl \
  --request GET \
  --url 'https://api.hl2.com/panorama/v1/products'

Response

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

[
  {
    "slug": "public-product",
    "name": "Public product",
    "version": "1.0.1",
    "organizationId": "5847f1b05bba9a8da5191082",
    "public": true,
    "id": "5891e276eb7ea3000e7aadb5"
  },
  {
    "slug": "evk",
    "name": "EVK",
    "version": "1.0.0",
    "organizationId": "5847f1685bba9a8da519107f",
    "public": true,
    "id": "589d82b29e2511000ee0c2db"
  },
]

List organization products

List the products for your organization. Public products not owned by your organization are not listed.

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

GET /organizations/:id/products

Parameters

Name Type Default Description
limit number 10 The number of items to be returned by page
page number 1 The page number
q string   The search regex in name, slug and version fields
sort string   The sort order
curl \
  --request GET \
  --url 'https://api.hl2.com/panorama/v1/organizations/5a21805903e0870010c8f618/products'

Response

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

[
  {
    "deviceCount": 1,
    "slug": "my-product",
    "name": "My product",
    "version": "1.0.0",
    "organizationId": "5a21805903e0870010c8f618",
    "public": false,
    "id": "58d520e4d85691000e7fe7db"
  }
]

Create a product

Create a product for your organization.

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

POST /organizations/:id/products

Input

Name Type Description
name string The product name (required)
version string The product version (required)
variables array The product variables (required)
variables.*.name string The variable name (required)
variables.*.unit string The variable unit
variables.*.type string The variable type. Can be BOOL, TXT, INT16, INT64, FLOAT32, UINT8, UINT16 or UINT32 (required)
variables.*.mappings array The variable mappings
variables.*.mappings.*.streamId number The mapping stream id (required)
variables.*.mappings.*.streamType number The mapping stream type. Can be BIN, RAW or TXT (required)
variables.*.mappings.*.varNumber number The variable number in the mapping stream (required)
curl \
  --request POST \
  --url 'https://api.hl2.com/panorama/v1/organizations/5a21805903e0870010c8f618/products' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "product",
    "version": "0.1.0",
    "variables": [{
      "name": "vbat",
      "type": "FLOAT32",
      "unit": "V",
      "mappings": [{
        "streamType": "BIN",
        "streamId": 1,
        "varNumber": 1
      }]
    }]
  }'

Response

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

{
  "deviceCount": 0,
  "updatedAt": "2017-12-11T14:38:29.198Z",
  "createdAt": "2017-12-11T14:38:29.198Z",
  "slug": "product",
  "organizationId": "5a21805903e0870010c8f618",
  "name": "product",
  "version": "0.1.0",
  "variables": [
    {
      "name": "vbat",
      "type": "FLOAT32",
      "unit": "V",
      "mappings": [
        {
          "streamType": "BIN",
          "streamId": 1,
          "varNumber": 1
        }
      ]
    }
  ],
  "public": false,
  "id": "5a2e98656043be0010de901b"
}

Get a product

Get the details of one of your organization’s products, or of a public product not owned by your organization.

In the URL below, you will need to substitute :organizationId with either the id value you retreived with the account endpoint, or the ID of the organization owning the public product:

GET /products/:organizationId/:productId

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

Response

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

{
  "deviceCount": 0,
  "updatedAt": "2017-12-11T14:38:29.198Z",
  "createdAt": "2017-12-11T14:38:29.198Z",
  "slug": "product",
  "organizationId": "5a21805903e0870010c8f618",
  "name": "product",
  "version": "0.1.0",
  "variables": [
    {
      "name": "vbat",
      "type": "FLOAT32",
      "unit": "V",
      "mappings": [
        {
          "streamType": "BIN",
          "streamId": 1,
          "varNumber": 1
        }
      ]
    }
  ],
  "public": false,
  "id": "5a2e98656043be0010de901b"
}

Update a product

Update one of your organization’s products.

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

PUT /products/:organizationId/:productId

Input

Name Type Description
name string The product name (required)
version string The product version (required)
variables array The product variables (required)
variables.*.name string The variable name (required)
variables.*.unit string The variable unit
variables.*.type string The variable type. Can be BOOL, TXT, INT16, INT64, FLOAT32, UINT8, UINT16 or UINT32 (required)
variables.*.mappings array The variable mappings
variables.*.mappings.*.streamId number The mapping stream id (required)
variables.*.mappings.*.streamType number The mapping stream type. Can be BIN, RAW or TXT (required)
variables.*.mappings.*.varNumber number The variable number in the mapping stream (required)
curl \
  --request PUT \
  --url 'https://api.hl2.com/panorama/v1/products/5a21805903e0870010c8f618/5a2e98656043be0010de901b' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "product",
    "version": "0.2.0",
    "variables": [{
      "name": "bat",
      "type": "FLOAT32",
      "unit": "V",
      "mappings": [{
        "streamType": "BIN",
        "streamId": 1,
        "varNumber": 1
      }]
    }]
  }'

Response

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

{
  "deviceCount": 0,
  "updatedAt": "2017-12-11T15:00:09.797Z",
  "createdAt": "2017-12-11T14:38:29.198Z",
  "slug": "product",
  "organizationId": "5a21805903e0870010c8f618",
  "name": "product",
  "version": "0.2.0",
  "variables": [
    {
      "name": "bat",
      "type": "FLOAT32",
      "unit": "V",
      "mappings": [
        {
          "streamType": "BIN",
          "streamId": 1,
          "varNumber": 1
        }
      ]
    }
  ],
  "public": false,
  "id": "5a2e98656043be0010de901b"
}

Delete a product

Delete one of your organization’s products. This will only be possible if the product is not public, and not used by any device.

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

DELETE /products/:organizationId/:productId

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