The vvcanvas
package is an R library that provides a
convenient interface to interact with the Canvas Learning Management
System (LMS) API. It allows users to authenticate, retrieve course
information, fetch specific details, and perform various operations
within the Canvas LMS.
You can install the vvcanvas
package from GitHub using
the following command:
devtools::install_github("vusaverse/vvcanvas")
It is also possible to install from CRAN:
install.packages("vvcanvas")
To begin using the vvcanvas
package, you need to
authenticate with the Canvas LMS API by obtaining an API key and base
URL. Follow these steps to get started:
Acquire an API key from your Canvas LMS instance. You may need to consult your Canvas administrator or refer to the Canvas API documentation for instructions on obtaining an API key.
Once you have the API key, load the vvcanvas
library
and use the canvas_authenticate
function to authenticate
with the Canvas LMS API. Provide the API key and the base URL of your
Canvas instance as parameters. Here’s an example:
library(vvcanvas)
# Replace the placeholders with your API key and base URL
<- "YOUR_API_KEY"
api_key <- "https://your_canvas_domain.com"
base_url
# Authenticate with the Canvas LMS API
<- canvas_authenticate(api_key, base_url) canvas
With the authentication step completed, you can now utilize the
various functions provided by the vvcanvas
package to
interact with the Canvas LMS.
In order to retrieve a dataframe with all courses you can use the following function:
# Pass the canvas object to the get_courses function
<- get_courses(canvas) courses