A quick attempt to create a API client for the Skilljar LMS API. For more information and how to get started with the Skilljar API, see this help article.
Note: this library is incomplete. See table below for status of each object defined in the Skilljar API.
To get started, the Skilljar API client requires an HttpClient object that has been created with the API Base Address and Authentication Header:
var authString = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey));
HttpClient httpClient = new()
{
BaseAddress = new Uri("https://api.skilljar.com/v1/"),
Timeout = new TimeSpan(0,0,30)
};
httpClient.DefaultRequestHeaders.Clear();
httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authString);
After creating your HttpClient instance, you can pass it to your SkilljarApiClient and begin working with the supported API calls:
Get a list of domains for your skilljar instance
var client = new SkilljarApiClient(httpClient);
var domainList = await client.Domains.ListAllAsync();
List all Published Courses for a particular domain
var client = new SkilljarApiClient(httpClient);
var publishedCourses = await client.Domains.PublishedCourses.ListAllAsync("your-domain-name");
Read details of a specific course
var client = new SkilljarApiClient(httpClient);
var publishedCourses = await client.Courses.ReadAsync("your-course-id");