This is a .Net 5.0 wrapper library for the Canvas LMS API. The goal of this project is create a complete API wrapper for all the Canvas Modules and API calls.
**This project has just started and is not completed. The priority of the project is based on the need for internal projects. Please feel free to contribute any modules or API calls that you need. **
The Canvas LMS API wrapper utilized the HttpClient and can be intiated in mutliple ways. The first and most common is to setup a service.
this.Services.AddHttpClient<ICanvasApiClient, CanvasApiClient>(client =>
client.ConfigureCanvasApi(CanvasDomain, ApiKey)
);
Using the GetRequiredService get the service. When using this method it is recommended that object is not directly disposed.
var serviceProvider = this.Services.BuildServiceProvider();
var client = serviceProvider.GetRequiredService<ICanvasApiClient>();
The API Client can be directly initiated. Using this method, the source should properly dispose of the client object when no longer in use.
using var client = new CanvasApiClient(CanvasDomain, ApiKey, serviceProvider);
GetSubAccounts, List
Create, Destroy, Edit, Get, List
CourseEnrollments, SectionEnrollments, UserEnrollments
GetSingleCourse, GetSingleSection, ListCourse, ListCourseGroupedByStudent, ListSection, ListSectionGroupedByStudent, SubmitCourse, SubmitSection
GetProfile