% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/reportingService.R
\name{reportingService}
\alias{reportingService}
\title{Query the EPPO API Taxons endpoints.}
\usage{
reportingService(
  services = c("list", "reporting", "article"),
  params = list(list = list(), reporting = list(), article = list()),
  apiKey = Sys.getenv("EPPO_API_KEY")
)
}
\arguments{
\item{services}{\code{character} (vector). One or more Taxons services to query.
Common service names include: \code{list}, \code{reporting} and \code{article}. A
validation step ensures that all provided services match the supported
service names.

By default: all services.}

\item{params}{\code{list}. A named list of query parameters to include in the
request. The list of available parameters can be accessed via the
\href{https://data.eppo.int/ui/#/docs/GDAPI}{EPPO API Documentation}
platform.

By default: no parameters, you need to specify the required ones.}

\item{apiKey}{\code{character} (string). The API key used for authentication. It
can be specified manually or through the .Renviron file.

By default: Sys.getenv("EPPO_API_KEY").}
}
\value{
A named list of results, in which each level corresponds to the data
retrieved for each specified service. Each service element contains a
flattened dataframe with the queried content.
}
\description{
This function queries the Taxons endpoints of the EPPO Global Database via
REST API. The function sequentially queries all specified \code{services} and
returns the extracted data through a list of dataframes.
}
\examples{
\dontrun{
# Get the list of reporting service issues.
reportingServiceData_ <- reportingService(
  services = c("list"),
  params = list(
    "list" = list()))

# Get a specific reporting service issue by ID.
reportingServiceData_ <- reportingService(
  services = c("reporting"),
  params = list(
    reporting = list(
      reporting_id = 10)))

# Get a specific article by ID.
reportingServiceData_ <- reportingService(
  services = c("article"),
  params = list(
    article = list(
      article_id = 234)))

# Get a specific reporting service issue and a specific article by ID.
reportingServiceData_ <- reportingService(
  services = c("reporting", "article"),
  params = list(
    reporting = list(reporting_id = 10),
    article = list(article_id = 234)
  ))
}

}
