Skip to content

How to get endpoint data from Insight API

After a successful authentication, you can use Insight API to request data from ProGlove resources such as:

Each of these resources has its own endpoint reachable using your Base URL.

Endpoint HTTP method Description
/{customer_id}/devices GET List of scanner devices.
/{customer_id}/gateways GET List of Connectivity devices.
/{customer_id}/events GET List of scan events.
By default, returns scan events for the last 24 hours.

To acquire data for a specific endpoint:

  1. Make a POST authentication request to get the Access Token.
  2. Make a GET request for the desired endpoint. (e.g. {BaseURL}/{customer_id}/devices)
  3. Replace the {BaseURL} in the request with your Base URL.
  4. Add an HTTP Header Authorization and populate the Value field with the "IdToken" from the AuthenticationResult JSON object.
  5. Send request.


Devices endpoint

Besides scanners, a device can be any wearable device. For every customer, the system maintains a dedicated resource to store all devices used at least once.

GET request

{BaseURL}/{customer_id}/devices

JSON response

{
  "items": [
    {
      "id": "M2MR101000000",
      "class": "device",
      "created": 1557220259,
      "last_activity_time": 1557220259,
      "last_updated": 1557220259,
      "battery": 93,
      "firmware": "0.0.1",
      "model": "Mark",
      "manufacturer": "Workaround GmbH",
      "status": "ACTIVE",
      "version": 1
    }
  ],
  "links": {
    "next": "/devices?next_token=11234"
  },
  "metadata": {
    "description": "string",
    "size": 23,
    "filters": [
      {
        "name": "start_time_millis",
        "value": 1557220259
      }
    ]
  }
}

Error codes

HTTP error code reason
200 OK
400 Malformed request
401 No authentication header found
403 Access denied
500 Internal Server Error

Connectivity devices endpoint

A Connectivity device (gateway) is a ProGlove authenticated device which connects to the Insight Webportal platform and other devices (scanners and wearables) and sends the events coming from devices to the cloud. Connectivity devices are configured to have a name and a use case in order to filter events coming from multiple devices.

GET request

{BaseURL}/{customer_id}/gateways

JSON response

{
  "items": [
    {
      "id": "919ebc9d-9788-4f08-93db-e238c5eaa69a",
      "class": "gateway",
      "model": "Samsung Galaxy S8",
      "manufacturer": "Proglove",
      "type": "stationary",
      "firmware": "0.0.1",
      "created": 1557220259,
      "last_updated": 1557220259,
      "usecase": "Picking",
      "station": "Station 3",
      "name": "Joe's android"
    }
  ],
  "links": {
    "next": "/gateways?next_token=11234"
  },
  "metadata": {
    "description": "string",
    "size": 23,
    "filters": [
      {
        "name": "start_time_millis",
        "value": 1557220259
      }
    ]
  }
}

Error codes

HTTP error code reason
200 OK
400 Malformed request
401 No authentication header found
403 Access denied
500 Internal Server Error

Events endpoint

This endpoint provides access to all of your stored events. An event is not only a scan event - the type of event is specified in the response's type field.
Currently available event types: [scan, telemetry].
Scan events are process-critical events and typically have some telemetry attached to them.

To learn more about Events endpoint (e.g. how to pass start/end date), see Events Calls under API Specification.

Pagination

Because the number of events stored at once for a specific time window is unknown and can exceed the payload limits of an HTTP response, the events endpoint returns paginated data.
If the number of events in the specified time window is too high, the HTTP response will not contain all the requested events, but will provide a link so you can call again to receive the rest of the data.

GET request

{BaseURL}/{customer_id}/events

JSON response

{
  "items": [
    {
      "id": "919ebc9d-9788-4f08-93db-e238c5eaa69a",
      "type": "scan",
      "created": 1557220259,
      "scan_code": "1234567890",
      "scan_decode_symbology": "EAN-13",
      "device_id": "M2MR101000000",
      "device_battery": 93,
      "device_firmware": "v2.0.1",
      "gateway_id": "919ebc9d-9788-4f08-93db-e238c5eaa69a",
      "metrics_worker_steps": 7,
      "scan_duration": 0.27
    }
  ],
  "links": {
    "next": "${NEXT_TOKEN}"
  },
  "metadata": {
    "description": "string",
    "size": 23,
    "filters": [
      {
        "name": "start_time_millis",
        "value": 1557220259
      }
    ]
  }
}

Error codes

HTTP error code reason
200 OK
400 Malformed request
401 No authentication header found
403 Access denied
500 Internal Server Error