% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api.R
\name{af_api}
\alias{af_api}
\title{Describe an API endpoint}
\usage{
af_api(
  endpoint,
  service = "apifetch",
  auth = af_auth_bearer(),
  pagination = af_paginate_offset(),
  drop_cols = character(0),
  connect_hint = NULL
)
}
\arguments{
\item{endpoint}{The base API URL.}

\item{service}{Namespace used to look up the token (see \code{\link[=af_get_token]{af_get_token()}}).}

\item{auth}{An \code{apifetch_auth} strategy (see \link{af_auth}). Default
\code{\link[=af_auth_bearer]{af_auth_bearer()}}.}

\item{pagination}{An \code{apifetch_pagination} strategy (see \link{af_paginate}).
Default \code{\link[=af_paginate_offset]{af_paginate_offset()}}.}

\item{drop_cols}{Character vector of response columns to drop after parsing
(e.g. a status column). Default none.}

\item{connect_hint}{Optional extra line shown when a connection error occurs
(e.g. a VPN requirement).}
}
\value{
An \code{apifetch_api} object.
}
\description{
Bundles an endpoint URL with its authentication and pagination strategies and
a namespace \code{service} (used to look up tokens). The resulting object is passed
to \code{\link[=af_fetch]{af_fetch()}} and \code{\link[=af_fetch_all]{af_fetch_all()}}.
}
\examples{
af_api(
  endpoint = "https://www.bigdata.pe.gov.br/api/buscar",
  service = "BigDataPE",
  auth = af_auth_raw(),
  pagination = af_paginate_offset("header"),
  drop_cols = "Mensagem",
  connect_hint = "Ensure you are on the PE Conectado network or VPN."
)
}
