Skip to contents

Retrieves device information from the Pelagic Analytics API for a specified customer. Supports server-side filtering to reduce data transfer and processing time.

Usage

get_pelagic_devices(
  token,
  customers = NULL,
  boats = NULL,
  imeis = NULL,
  columns = NULL,
  customer_id = NULL,
  base_url = "https://analytics.pelagicdata.com"
)

Arguments

token

Character. Access token obtained from pelagic_auth()

customers

Character vector. Customer IDs to filter by. If NULL, uses default customer.

boats

Character/Numeric vector. Boat IDs to filter by. If NULL, returns all boats.

imeis

Character/Numeric vector. IMEI numbers to filter by. If NULL, returns all devices.

columns

Character vector. Specific columns to extract. If NULL, returns all columns.

customer_id

Character. Default customer ID if customers parameter is NULL

base_url

Character. Base URL for the API. Default is "https://analytics.pelagicdata.com"

Value

Data frame containing device information

Examples

if (FALSE) { # \dontrun{
# Get all devices
devices_all <- get_pelagic_devices(auth_response$token)

# Get device with specific IMEI (server-side filtering - much faster!)
device_specific <- get_pelagic_devices(
  token = auth_response$token,
  imeis = "86435204XXXXX"
)

# Get multiple devices by IMEI
devices_multiple <- get_pelagic_devices(
  token = auth_response$token,
  imeis = c("864352046XXXXX", "123456789XXXXX")
)

# Combine with column selection
devices_minimal <- get_pelagic_devices(
  token = auth_response$token,
  imeis = "86435204XXXXX",
  columns = c("id", "name", "imei", "boat.name", "lat", "lng")
)
} # }