make_requests: Create multiple API request to retrieve data from Nightscout

View source: R/create_requests.R

make_requestsR Documentation

Create multiple API request to retrieve data from Nightscout

Usage

make_requests(
  url = NULL,
  api_secret = NULL,
  schemas = c("entries", "treatments", "profile"),
  spec = "sgv",
  date_first = NULL,
  date_last = NULL,
  count = NULL
)

Arguments

url

Base URL for accessing Nightscout of type 'https://YOUR-SITE.com'. See https://nightscout-test.readthedocs.io/en/latest/Nightscout/EN/Technical

\item

api_secretAPI secret or token as entered when accessing the base URL via a web browser. This API secret is hashed using Secure Hash Algorithm 1 prior to appending to header of API request.

\item

schemasVector of schema to be requested. For CGM data use 'entries', for Care Portal Treatments use 'treatments', for Treatment Profiles use 'profiles'. and for server status and settings use 'status'. Relevant for schema ‘entries' only. entry id, such as 55cf81bc436037528ec75fa5 or a type filter such as sgv, mbg, etc. Default is ’sgv' which returns sensor glucose values (SGV).

\item

date_firstFirst date for 'entries' and 'treatments' schemas.

\item

countBy default the 'entries' and 'treatments' schemas limit results to the the most recent 10 values from the last 2 days. You can get many more results by setting this to a higher number. Can set to 'Inf' to get all results between two dates defined in 'find'. Not valid and ignored for 'profile' and 'status' schemas.

\item

date_listLast date for 'entries' and 'treatments' schemas.

A list of HTTP responses: a list of S3 lists with class httr2_request. Create multiple API request to retrieve data from Nightscout ## Not run: make_requests( url = "https://YOUR-SITE.com", api_secret = "password", date_first = "2024-01-01", date_last = Sys.Date()) ## End(Not run)


jwilliman/nightscout-insulin documentation built on Dec. 4, 2024, 3:16 a.m.