Class CanvasService
java.lang.Object
edu.ucsb.cs156.frontiers.services.CanvasService
Service for interacting with the Canvas API.
Note that the Canvas API uses a GraphQL endpoint, which allows for more flexible queries compared to traditional REST APIs.
For more information on the Canvas API, visit the official documentation at ....
You can typically interact with Canvas API GraphQL endpoints interactively by appending /graphiql to the URL of the Canvas instance.
For example, for UCSB Canvas, use: ...
-
Constructor Summary
ConstructorsConstructorDescriptionCanvasService(com.fasterxml.jackson.databind.ObjectMapper mapper, org.springframework.web.client.RestClient.Builder builder, TokenEncryptionService tokenEncryptionService) -
Method Summary
Modifier and TypeMethodDescriptiongetCanvasGroups(Course course, String groupSetId) getCanvasGroupSets(Course course) getCanvasRoster(Course course) Fetches the roster of students from Canvas for the given course.
-
Constructor Details
-
CanvasService
public CanvasService(com.fasterxml.jackson.databind.ObjectMapper mapper, org.springframework.web.client.RestClient.Builder builder, TokenEncryptionService tokenEncryptionService)
-
-
Method Details
-
getCanvasGroupSets
-
getCanvasRoster
Fetches the roster of students from Canvas for the given course.- Parameters:
course- the Course entity containing canvasApiToken and canvasCourseId- Returns:
- list of RosterStudent objects from Canvas
-
getCanvasGroups
-