% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api.R
\name{read_glint_survey_api}
\alias{read_glint_survey_api}
\title{Read Viva Glint Survey Data via API}
\usage{
read_glint_survey_api(
  survey_uuid,
  cycle_id,
  emp_id_col = NULL,
  first_name_col = "First Name",
  last_name_col = "Last Name",
  email_col = "Email",
  status_col = "Status",
  completion_date_col = "Survey Cycle Completion Date",
  sent_date_col = "Survey Cycle Sent Date",
  start_date = NULL,
  end_date = NULL,
  encoding = "UTF-8",
  poll_interval = 10,
  max_attempts = 60,
  experience_name = NULL
)
}
\arguments{
\item{survey_uuid}{Survey UUID from Viva Glint}

\item{cycle_id}{Survey cycle ID}

\item{emp_id_col}{Character string specifying the employee ID column name}

\item{first_name_col}{Column name for first name (default: "First Name")}

\item{last_name_col}{Column name for last name (default: "Last Name")}

\item{email_col}{Column name for email (default: "Email")}

\item{status_col}{Column name for status (default: "Status")}

\item{completion_date_col}{Column name for survey completion date
(default: "Survey Cycle Completion Date")}

\item{sent_date_col}{Column name for survey sent date
(default: "Survey Cycle Sent Date")}

\item{start_date}{Optional start date/time for the export window. Can be a
character string in ISO 8601 format, or a Date/POSIXct value.}

\item{end_date}{Optional end date/time for the export window. Can be a
character string in ISO 8601 format, or a Date/POSIXct value.}

\item{encoding}{Character string specifying file encoding (default: "UTF-8")}

\item{poll_interval}{Seconds to wait between status checks (default: 10)}

\item{max_attempts}{Maximum number of polling attempts (default: 60)}

\item{experience_name}{Optional Viva Glint experience name to override the
GLINT_EXPERIENCE_NAME environment variable}
}
\value{
A \code{glint_survey} object (same structure as \code{read_glint_survey}).
The \code{metadata$file_path} field is set to \code{NA}.
}
\description{
Exports a survey cycle through the Microsoft Graph beta API, downloads the
resulting ZIP archive, and returns a \code{glint_survey} object. This is an
alternative to \code{read_glint_survey()} when you want to pull data directly
from Viva Glint instead of importing a local CSV export.
}
\examples{
\dontrun{
glint_setup(
  tenant_id = "your-tenant-id",
  client_id = "your-client-id",
  client_secret = "your-client-secret",
  experience_name = "your-experience-name"
)

survey <- read_glint_survey_api(
  survey_uuid = "your-survey-uuid",
  cycle_id = "your-cycle-id",
  emp_id_col = "EMP ID"
)
}
}
