Devices

This section provides details on the device model used to represent various types of devices associated with service lines. Below are the properties that define a device.

The device model

The device model represents various attributes associated with a device, including identification details, location information, and operational status.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the device

  • Name
    serial_number
    Type
    string
    Description

    The device serial number

  • Name
    service_line_number
    Type
    string
    Description

    The device service line number which it belongs to

  • Name
    device_id
    Type
    string
    Description

    The device unique identifier issued by vendor

  • Name
    location
    Type
    Location
    Description

    The location geometry type, latitude and longitude, see Location

  • Name
    device_type
    Type
    string
    Description

    The device type (Terminal, Access Point, Router, Gateway or Switch)

  • Name
    device_attributes
    Type
    DeviceAttribute
    Description

    Device additional attributes, see Device Attributes

  • Name
    uptime
    Type
    int
    Description

    The uptime of the device in integer

  • Name
    last_connected_at
    Type
    timestamp | null
    Description

    The device last connected timestamp

  • Name
    last_disconnected_at
    Type
    timestamp | null
    Description

    The device last disconnected timestamp, this can be null

  • Name
    disabled_at
    Type
    timestamp | null
    Description

    The device disabled timestamp, this can be null

  • Name
    alerts
    Type
    int[]
    Description

    The alerts returned by the device

  • Name
    h3_cell_id
    Type
    string
    Description

    Current H3 Cell index of the device

  • Name
    is_online
    Type
    boolean
    Description

    If the device is currently online


GET/v1/devices

List all devices

This endpoint allows you to retrieve a paginated list of all your devices. By default, a maximum of 50 devices are shown per page.

Optional attributes

  • Name
    per_page
    Type
    integer
    Description

    Limit the number of service lines returned.

  • Name
    page
    Type
    integer
    Description

    The current page number of service lines

  • Name
    filter[device_type]
    Type
    string
    Description

    Filter the devices by device type

  • Name
    filter[service_line_number]
    Type
    string
    Description

    Filter the devices by service line number

  • Name
    filter[account_id]
    Type
    string
    Description

    Filter the devices by account_id

  • Name
    filter[is_offline]
    Type
    string
    Description

    Filter the offline devices

  • Name
    filter[search]
    Type
    string
    Description

    Filter the devices by search query.

Request

GET
/v1/devices
curl -G https://api.polaris.revlv.com/v1/devices \
-H "Authorization: Bearer {token}" \
-H "Polaris-Account: {account_id}" \
-d per_page=50

Response

{
  "data": [
    {
		"id": "6cd2bc0a-a42c-3409-b4b5-a11546562c37",
		"serial_number": "58188439",
		"service_line_number": "30575295",
		"device_id": "25778533",
		"location": {
			"type": "Point",
			"coordinates": [
				-76.56296,
				175.199846
			]
		},
		"device_type": "Terminal",
		"device_attributes": {
			"dish_serial_number": "6048178971733"
		},
		"uptime": null,
		"last_connected_at": "2024-06-07T15:36:17.000000Z",
		"last_disconnected_at": "2017-10-07 09:26:08+08",
		"disabled_at": null,
		"alerts": null,
		"h3_cell_id": "0",
		"is_online": false,
		"created_at": "2024-06-07T23:36:17+08:00",
		"updated_at": "2024-06-07T23:36:17+08:00"
    },
    {
      "id": "97c50f61-3754-3a9c-a16d-c580677d5fed"
      // ...
    }
  ]
}

GET/v1/devices/:id

Retrieve a single device

This endpoint allows you to retrieve a device by providing the id. Refer to the list at the top of this page to see which properties are included with Device object.

Request

GET
/v1/devices/6cd2bc0a-a42c-3409-b4b5-a11546562c372
curl https://api.polaris.revlv.com/v1/devices/6cd2bc0a-a42c-3409-b4b5-a11546562c37 \
    -H "Authorization: Bearer {token}" \
    -H "Polaris-Account: {account_id}" \

Response

{
    "data": {
        "id": "6cd2bc0a-a42c-3409-b4b5-a11546562c37",
        "serial_number": "58188439",
        "service_line_number": "30575295",
        "service_line": {
            "id": "ca1407dd-4212-386e-96f9-d79cdedd4bd7",
            "service_line_number": "30575295",
            "nickname": "99561 Roosevelt Island\nFerryport, KS 89113",
            "alias": null,
            "formatted_address": "6993 Bahringer Point Suite 320\nNew Elishaberg, WV 00433-7713",
        },
        "account": {
            "account_id": "acct_TbaK4vpY18",
            "name": "Darick"
        },
        "device_id": "25778533",
        "location": {
            "type": "Point",
            "coordinates": [
                -76.56296,
                175.199846
            ]
        },
        "device_type": "Terminal",
        "device_attributes": {
            "dish_serial_number": "6048178971733"
        },
        "uptime": null,
        "last_connected_at": "2024-06-07T15:36:17.000000Z",
        "last_disconnected_at": "2017-10-07 09:26:08+08",
        "disabled_at": null,
        "alerts": null,
        "h3_cell_id": "0",
        "is_online": false,
        "sub_devices": [
            {
                "id": "34e052d0-3174-32be-adf6-5126d63b3444",
                "serial_number": "16169883",
                "service_line_number": "30575295",
                "device_id": "33657868",
                "location": {
                    "type": "Point",
                    "coordinates": [
                        57.835631,
                        93.597639
                    ]
                },
                "device_type": "Router",
                "device_attributes": {
                    "dish_serial_number": "6675842098146"
                },
                "uptime": 615971830,
                "last_connected_at": "2024-06-07T15:36:17.000000Z",
                "last_disconnected_at": "2020-08-29 10:36:43+08",
                "disabled_at": null,
                "alerts": null,
                "h3_cell_id": "0",
                "is_online": false
            }
        ]
    }
}

Was this page helpful?