fetch_data_core: Core Data Fetching Function

View source: R/utils.R

fetch_data_coreR Documentation

Core Data Fetching Function

Description

A reusable function to handle the common pattern of fetching data from the API. Handles URL building, request execution, error handling, and response processing.

Usage

fetch_data_core(
  endpoint,
  params,
  auth_token,
  verbose = FALSE,
  enrich_response = TRUE,
  processor = process_response
)

Arguments

endpoint

Character. API endpoint path (e.g. "ios/sales_report_estimates").

params

List. Query parameters.

auth_token

Character. API token.

verbose

Logical. Whether to print debug messages.

enrich_response

Logical. Whether to enrich the response with metadata.

processor

Function. Function to process the response. Defaults to process_response.

Value

A tibble with the results.


sensortowerR documentation built on March 18, 2026, 5:07 p.m.