Skip to main content

Applications

List applications

List the applications for 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/applications

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 description fields
sort string   The sort order
ids array   The list of application identifiers
curl \
  --request GET \
  --url 'https://api.hl2.com/panorama/v1/organizations/5a21805903e0870010c8f618/applications'

Response

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

[
  {
    "slug": "application",
    "name": "Application",
    "description": "Description",
    "organizationId": "5a21805903e0870010c8f618",
    "permission": "write",
    "id": "59f0a0c0279b6000105aa377"
  }
]

Create an application

Create a new application 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/applications

Input

Name Type Default Description
name string   The application name (required)
description string   The application’s description
hasDashboard boolean false Either true to enable the dashboard for this application, or false to disable it (required)
curl \
  --request POST \
  --url 'https://api.hl2.com/panorama/v1/organizations/5a21805903e0870010c8f618/applications' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "foo",
    "hasDashboard": true
  }'

Response

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

{
  "slug": "foo",
  "updatedAt": "2017-12-11T15:40:49.376Z",
  "createdAt": "2017-12-11T15:40:49.376Z",
  "hasDashboard": true,
  "name": "foo",
  "organizationId": "5a21805903e0870010c8f618",
  "permission": "write",
  "id": "5a2ea70105c188001094f9e2"
}

Get an application

Get the details for one of your organization’s applications.

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, and :applicationId with one of the IDs from the “List applications” endpoint above:

GET /applications/:organizationId/:applicationId

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

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

{
  "slug": "foo",
  "updatedAt": "2017-12-11T15:40:49.376Z",
  "createdAt": "2017-12-11T15:40:49.376Z",
  "hasDashboard": true,
  "name": "foo",
  "organizationId": "5a21805903e0870010c8f618",
  "permission": "write",
  "id": "5a2ea70105c188001094f9e2"
}

Update an application

Update one of your organization’s applications.

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, and :applicationId with one of the IDs from the “List applications” endpoint above:

PUT /applications/:organizationId/:applicationId

Input

Name Type Description
name string The application name (required)
description string The application’s description
hasDashboard boolean Either true to enable the dashboard for this application, or false to disable it (required)
curl \
  --request PUT \
  --url 'https://api.hl2.com/panorama/v1/applications/5a21805903e0870010c8f618/5a2ea70105c188001094f9e2' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "bar",
    "description": "bar",
    "hasDashboard": true
  }'

Response

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

{
  "description": "bar",
  "slug": "bar",
  "updatedAt": "2017-12-11T16:10:30.506Z",
  "createdAt": "2017-12-11T15:40:49.376Z",
  "hasDashboard": true,
  "name": "bar",
  "organizationId": "5a21805903e0870010c8f618",
  "permission": "write",
  "id": "5a2ea70105c188001094f9e2"
}

Delete an application

Delete one of your organization’s applications.

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, and :applicationId with one of the IDs from the “List applications” endpoint above:

DELETE /applications/:organizationId/:applicationId

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

Search application records

Search records for the specified application. A record is a dataset sent by a device linked to the specified application (see the devices section for further details).

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, and :applicationId with one of the IDs from the “List applications” endpoint above:

GET /applications/:organizationId/:applicationId/search

Input

Name Type Default Description
ts object   The Unix timestamp range (required)
ts.gte number   The included lower bound (required)
ts.lte number   The included upper bound (required)
queries array   The concurrent search queries (required)
queries.*.products array   Array of strings - the requested device products (required)
queries.*.includes array   Array of strings - see Elasticsearch source filtering
queries.*.search_after array   Array of string or numbers - see Elasticsearch search after
queries.*.size number 10 The maximum number of records to return, up to 10000
queries.*.sort array   Array of strings or objects - the sorting order. See Elasticsearch sorting
queries.*.aggs object   See Elasticsearch aggregations
queries.*.query object   See Elasticsearch query dsl

Devices

List application devices

List the devices linked to one of your organization’s applications.

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, and :applicationId with one of the IDs from the “List applications” endpoint above:

GET /applications/:organizationId/:applicationId/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
sort string   The sort order
curl \
  --request GET \
  --url 'https://api.hl2.com/panorama/v1/applications/5a21805903e0870010c8f618/5a2eb54105c188001094f9e4/devices'

Response

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

[
  {
    "name": "019f99ca-681e-43a6-b062-5a105e2b",
    "product": {
      "organizationId": "58a6e83030aacc000e29a454",
      "id": "59aea95a279b6000105a70e4"
    },
    "slug": "019f99ca-681e-43a6-b062-5a105e2b",
    "organizationId": "5a21805903e0870010c8f618",
    "tags": [],
    "serial": "019f99ca-681e-43a6-b062-5a105e2b8d3b",
    "applicationCount": 3,
    "id": "58935bf59141b1000ea013a3"
  },
]

Add application device

Add a device to one of your organization’s applications. If the device was already linked to the application, behaves as though it has just been added (no error, 204 response code).

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, :applicationId with one of the IDs from the “List applications” endpoint above, and :deviceId with one of the IDs from the “List devices” endpoint:

PUT /applications/:organizationId/:applicationId/devices/:deviceId

curl \
  --request PUT \
  --url 'https://api.hl2.com/panorama/v1/applications/5a21805903e0870010c8f618/5a2eb54105c188001094f9e4/devices/58935bf59141b1000ea013a3'

Remove application device

Remove a device from the specified application.

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, :applicationId with one of the IDs from the “List applications” endpoint above, and :deviceId with one of the IDs from the “List application devices” endpoint above:

DELETE /applications/:organizationId/:applicationId/devices/:deviceId

curl \
  --request DELETE \
  --url 'https://api.hl2.com/panorama/v1/applications/5a21805903e0870010c8f618/5a2eb54105c188001094f9e4/devices/58935bf59141b1000ea013a3'

Hooks

List application hooks

List all the application hooks for one of your organization’s applications.

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, and :applicationId with one of the IDs from the “List applications” endpoint:

GET /applications/:organizationId/:applicationId/hooks

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 url field
sort string   The sort order
curl \
  --request GET \
  --url 'https://api.hl2.com/panorama/v1/applications/5a21805903e0870010c8f618/59aea982279b6000105a70e6/hooks'

Response

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

[
  {
    "url": "https://your-url.com",
    "id": "5a2ea4330c31fd0010b8cb3f"
  }
]

Create an application hook

Create an application hook for one of your organization’s applications.

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, and :applicationId with one of the IDs from the “List applications” endpoint:

POST /applications/:organizationId/:applicationId/hooks

Input

Name Type Default Description
allowUnverifiedSSLCert boolean false Allow unverified SSL certificates
authentication object   The authentication config object
authentication.basic object   The basic authentication config object
authentication.basic.user string   Username for basic authentication (required)
authentication.basic.pass string   password for basic authentication (required)
authentication.header object   The header authentication config object
authentication.header.name string Authorization The authentication header name
authentication.header.value string   The authentication header value (required)
disabled boolean false Either true to disable the application hook, or false to enable it
url string   The application hook URL (required)
curl \
  --request POST \
  --url 'https://api.hl2.com/panorama/v1/applications/5a21805903e0870010c8f618/59aea982279b6000105a70e6/hooks' \
  --header 'Content-Type: application/json' \
  --data '{
    "url": "https://httpbin.org/post",
    "authentication": {
      "basic": {
        "user": "user",
        "pass": "pass"
      }
    }
  }'

Response

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

{
  "updatedAt": "2017-12-12T10:55:50.746Z",
  "createdAt": "2017-12-12T10:55:50.746Z",
  "authentication": {
    "basic": {
      "user": "user"
    }
  },
  "url": "https://httpbin.org/post",
  "application": {
    "id": "59aea982279b6000105a70e6",
    "organizationId": "5a21805903e0870010c8f618"
  },
  "id": "5a2fb5b60c31fd0010b8cb97"
}

Get an application hook

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, :applicationId with one of the IDs from the “List applications” endpoint, and :applicationHookId with one of the IDs from the “List application hooks” endpoint above:

GET /applications/:organizationId/:applicationId/hooks/:applicationHookId

curl \
  --request GET \
  --url 'https://api.hl2.com/panorama/v1/applications/5a21805903e0870010c8f618/59aea982279b6000105a70e6/hooks/5a2fb5b60c31fd0010b8cb97'

Response

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

{
  "updatedAt": "2017-12-12T10:55:50.746Z",
  "createdAt": "2017-12-12T10:55:50.746Z",
  "authentication": {
    "basic": {
      "user": "user"
    }
  },
  "url": "https://httpbin.org/post",
  "application": {
    "id": "59aea982279b6000105a70e6",
    "organizationId": "5a21805903e0870010c8f618"
  },
  "id": "5a2fb5b60c31fd0010b8cb97"
}

The basic authentication password is omitted from the response

Update an application hook

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, :applicationId with one of the IDs from the “List applications” endpoint, and :applicationHookId with one of the IDs from the “List application hooks” endpoint above:

PUT /applications/:organizationId/:applicationId/hooks/:applicationHookId

Input

Name Type Default Description
allowUnverifiedSSLCert boolean false Allow unverified SSL certificates
authentication object   The authentication config object
authentication.basic object   The basic authentication config object
authentication.basic.user string   Username for basic authentication (required)
authentication.basic.pass string   password for basic authentication (required)
authentication.header object   The header authentication config object
authentication.header.name string Authorization The authentication header name
authentication.header.value string   The authentication header value (required)
disabled boolean false Either true to disable the application hook, or false to enable it
url string   The application hook URL (required)
curl \
  --request PUT \
  --url 'https://api.hl2.com/panorama/v1/applications/5a21805903e0870010c8f618/59aea982279b6000105a70e6/hooks/5a2fb5b60c31fd0010b8cb97' \
  --header 'Content-Type: application/json' \
  --data '{
    "url": "https://httpbin.org/post",
    "authentication": {
      "bearer": {
        "value": "bearerToken"
      }
    }
  }'

Response

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

{
  "updatedAt": "2017-12-12T12:05:02.542Z",
  "createdAt": "2017-12-12T10:55:50.746Z",
  "authentication": {
    "header": {
      "name": "Authorization",
      "value": "Bearer my_token"
    }
  },
  "url": "https://httpbin.org/post",
  "application": {
    "organizationId": "5a21805903e0870010c8f618",
    "id": "59aea982279b6000105a70e6"
  },
  "id": "5a2fb5b60c31fd0010b8cb97"
}

Delete an application hook

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, :applicationId with one of the IDs from the “List applications” endpoint, and :applicationHookId with one of the IDs from the “List application hooks” endpoint above:

DELETE /applications/:organizationId/:applicationId/hooks/:applicationHookId

curl \
  --request DELETE \
  --url 'https://api.hl2.com/panorama/v1/applications/5a21805903e0870010c8f618/59aea982279b6000105a70e6/hooks/5a2fb5b60c31fd0010b8cb97'

Ping an application hook

Call an application hook for testing purposes.

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, :applicationId with one of the IDs from the “List applications” endpoint, and :applicationHookId with one of the IDs from the “List application hooks” endpoint above:

POST /applications/:organizationId/:applicationId/hooks/:applicationHookId/ping

curl \
  --request POST \
  --url 'https://api.hl2.com/panorama/v1/applications/5a21805903e0870010c8f618/59aea982279b6000105a70e6/hooks/5a2fb5b60c31fd0010b8cb97/ping'

List application hook deliveries

Get the list of “deliveries” for an application hook, that is the history of all the times the hook was called, with the payload sent to and the response received from the hook URL.

In the URL below, you will need to substitute :organizationId with the id value you retreived with the account endpoint, :applicationId with one of the IDs from the “List applications” endpoint, and :applicationHookId with one of the IDs from the “List application hooks” endpoint above:

GET /applications/:organizationId/:applicationId/hooks/:applicationHookId/deliveries

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 url field
sort string   The sort order
curl \
  --request GET \
  --url 'https://api.hl2.com/panorama/v1/applications/5a21805903e0870010c8f618/59aea982279b6000105a70e6/hooks/5a2fb5b60c31fd0010b8cb97/deliveries'

Response

The response array looks like the following (the order of the fields, and the structure of the reponse.body field, will vary):

[
    {
        "updatedAt": "2018-01-02T15:51:28.383Z",
        "createdAt": "2018-01-02T15:51:28.009Z",
        "applicationHookId": "5a2fb5b60c31fd0010b8cb97",
        "deviceId": "592fc94a257b990010e19c07",
        "maxNumberAttempts": 3,
        "ts": 1514908585,
        "attemptsMade": 1,
        "request": {
            "payload": {
                "record": {
                    "ts": 1514908585,
                    "metadata": {
                        "rssi": 10,
                        "snr": 10,
                        "provider": "sigfox"
                    },
                    "data": {
                        "batLevel": "37.2",
                        "pushButtonNbr": "73"
                    }
                },
                "device": {
                    "serial": "188652d0-b28b-41e7-b624-6095593f595d",
                    "product": {
                        "organizationId": "5847f1685bba9a8da519107f",
                        "id": "589d82b29e2511000ee0c2db"
                    },
                    "organizationId": "5a21805903e0870010c8f618",
                    "location": {
                        "lon": -1.604439,
                        "lat": 47.397382
                    },
                    "id": "592fc94a257b990010e19c07"
                },
                "application": {
                    "organizationId": "5a21805903e0870010c8f618",
                    "id": "59aea982279b6000105a70e6"
                }
            },
            "headers": {
                "content-length": 488,
                "accept": "application/json",
                "accept-encoding": "gzip, deflate",
                "authorization": "Basic aGwyOkxVUZltNlpSOUhTbjc0dndid3NCS0dXbg==",
                "host": "myhost.com",
                "x-hl2-panorama-delivery-id": "5a4baa807111170c139e276e",
                "x-hl2-panorama-event": "record",
                "content-type": "application/json"
            },
            "method": "POST",
            "uri": {
                "href": "http://myhost.com/myapphook",
                "path": "/myapphook",
                "pathname": "/myapphook",
                "query": null,
                "search": null,
                "hash": null,
                "hostname": "myhost.com",
                "port": 80,
                "host": "myhost.com",
                "auth": null,
                "slashes": true,
                "protocol": "http:"
            }
        },
        "response": {
            "headers": {
                "server": "Apache",
                "date": "Tue, 02 Jan 2018 15:51:28 GMT",
                "connection": "close",
                "transfer-encoding": "chunked",
                "content-type": "application/json; charset=ISO-8859-1"
            },
            "body": {
                "url": "http://myhost.com/myapphook",
                "time": "02/01/2018 16:51:28.354079",
                "log": "http://myhost.com/20180102165128354079_26654.log",
                "caller": "81.50.209.197"
            },
            "statusCode": 200
        },
        "successful": true,
        "application": {
            "organizationId": "5a21805903e0870010c8f618",
            "id": "59aea982279b6000105a70e6"
        },
        "id": "5a4baa807111170c139e276e"
    },
]