R/get_user_studies.R

Defines functions get_user_studies

Documented in get_user_studies

#' Get Studies for User
#'
#' Retrieve a list of studies for a user
#'
#' @return a `list` of user owned studies
#' @export
#' @examples
#' get_user_studies

get_user_studies <- function() {

    studies <- httr::GET(
      paste0(getOption('BASE_URL'),
             '/studies/user'),
      httr::add_headers(user_token = getOption('MTBLS_API_KEY'))
    ) %>% httr::content('parsed')

  return(studies)
}
wilsontom/metabolighteR documentation built on Feb. 27, 2024, 7:58 p.m.