% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/GetAnswers.R
\name{GetAnswers}
\alias{GetAnswers}
\title{Get all the answers of a form.}
\usage{
GetAnswers(
  token,
  idForm,
  nameForm = NULL,
  source = NULL,
  createdAfter = NULL,
  createdBefore = NULL,
  updatedAfter = NULL,
  updatedBefore = NULL,
  createdBy = NULL,
  updatedBy = NULL,
  page = 1,
  page_size = 100,
  all_pages = TRUE
)
}
\arguments{
\item{token}{String access token.}

\item{idForm}{Numeric Id of the required form.}

\item{nameForm}{String name of the required form. Used only when idForm is
not supplied. When this parameter is used, one extra access quota is spent.}

\item{source}{Optional filter. Origin of the answer: \code{"web_public"},
\code{"web_private"} or \code{"mobile"}.}

\item{createdAfter}{Optional filter. Returns answers created after this date
(exclusive). Accepts ISO 8601 format (\code{"YYYY-MM-DD"} or
\code{"YYYY-MM-DDThh:mm:ssTZD"}).}

\item{createdBefore}{Optional filter. Returns answers created before this
date (exclusive). Accepts ISO 8601 format.}

\item{updatedAfter}{Optional filter. Returns answers updated after this date
(exclusive). Accepts ISO 8601 format.}

\item{updatedBefore}{Optional filter. Returns answers updated before this
date (exclusive). Accepts ISO 8601 format.}

\item{createdBy}{Optional filter. Returns answers created by the user with
this numeric ID.}

\item{updatedBy}{Optional filter. Returns answers whose last update was made
by the user with this numeric ID.}

\item{page}{Integer. Starting page when \code{all_pages = FALSE}. Default: 1.}

\item{page_size}{Integer. Number of records per API request (max 500).
Default: 100.}

\item{all_pages}{Logical. If \code{TRUE} (default), fetches all pages
automatically and returns a combined result. If \code{FALSE}, returns
only the page specified by \code{page}.}
}
\value{
A list with two elements when the form has groups or multivalued
  fields: the first element is the main data frame (scalar fields and
  metadata), the second is a named list of nested data frames linked by
  \code{main_df_id}. For simple forms with no groups or multivalued fields, a
  single \code{data.frame} is returned directly. Use \code{\link{FlattenAnswers}}
  to join everything into one flat table.

  Metadata columns in the main data frame:
  \code{main_df_id}, \code{created_by_user_name}, \code{created_by_user_id},
  \code{created_at_source}, \code{created_at},
  \code{created_at_coordinates.latitude},
  \code{created_at_coordinates.longitude}, \code{updated_at},
  \code{updated_at_coordinates.latitude},
  \code{updated_at_coordinates.longitude}.
}
\description{
Get all the current answers of a specific form. This function calls
\code{\link{GetForm}} internally to understand the form structure.
}
\details{
To get more details about the fields provided by the result, please visit the
\href{https://coletum.com/en_US/webservice/v2/docs}{API documentation}.
}
\examples{
\donttest{
GetAnswers("cizio7xeohwgc8k4g4koo008kkoocwg", 5705)
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             nameForm = "RColetum Test - Iris")
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             idForm = 5705,
             createdAfter = "2012-12-20",
             createdBefore = "2018-12-20")
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             idForm = 5705,
             source = "web_public",
             createdAfter = "2012-12-20T19:20:30+01:00",
             createdBefore = "2018-12-20T19:20:30+01:00")
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             idForm = 5705,
             all_pages = FALSE,
             page = 1,
             page_size = 3)
}

}
