LearnPoint Bulk API is an HTTP based, REST-like API. Its primary purpose is to make LearnPoint data accessible to other applications. These applications can use the data to populate other systems for e.g. scheduling, resource planning or intranet access.
Learnpoint Bulk API version 2 is deprecated.
Information about changes: Migration from Learnpoint Bulk API to Learnpoint API v3
Documentation for Learnpoint API v3: https://api.learnpoint.se/swagger
API authentication is based on OAuth2 access tokens. Tokens are obtained by calling a token endpoint on https://login.learnpoint.se. The protocol of the token endpoint is based on OAuth2/Open ID Connect. The client credentials used for authentication at the token endpoint are provided by ViaEcole.
- The client submits its client credentials to https://login.learnpoint.se.
- The client receives an OAuth2 access token which will grant the client access to the API.
- The client calls the desired API endpoint, passing the access token in an http authorization header.
- The client receives JSON data.
The endpoints returns corresponding JSON data defined by the models StudentsApiResponse, GroupsApiResponse and StaffMembersApiResponse.
Where JSON data may be omitted it is noted in the model descriptions. Possible null values are marked by a question mark, e.g. string?.
- StudentsApiResponse
- StudentsData
- StudentsReferenceData
- Student
- StudentHomeAddress
- FullStudent
- StudentGroup
- StudentEducationPlan
- StudentEducationPlanState
- EducationPlan
- EducationPlanType
- StudentReference
- GroupsApiResponse
- GroupsData
- GroupsReferenceData
- Group
- GroupCategory
- ParentGroupReference
- ExtendedProperty
- FullGroup
- GroupStaffMember
- GroupStudent
- GroupReference
- GroupRole
- GroupRoleReference
- StaffMembersApiResponse
- StaffMembersData
- StaffMembersReferenceData
- StaffMember
- FullStaffMember
- StaffMemberGroup
- StaffMemberReference
- learnpointbulkapi.read
- Access to Learnpoint Bulk API
- learnpointbulkapi.mobilephone.read
- Access to mobile phone numbers for students and staff
- learnpointbulkapi.phone2.read
- Access to Phone2 number for staff
- learnpointbulkapi.homeaddress.read
- Access to home address for students
This .NET Core C# code sample fetches a access token and calls the three endpoints.
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Text.Json;
namespace SimpleSample
{
class Program
{
static void Main(string[] args)
{
string clientId = "yhskolan.apiclient";
string clientSecret = "xxxxxxxxxxxxxxxxxx";
string requestedScopes = "learnpointbulkapi.read learnpointbulkapi.mobilephone.read learnpointbulkapi.phone2.read learnpointbulkapi.homeaddress.read";
string tenantIdentifier = "yhskolan";
//Get Access token
var tokenHttpClient = new HttpClient();
var credentials = $"{clientId}:{clientSecret}";
var base64Credentials = Convert.ToBase64String(Encoding.UTF8.GetBytes(credentials));
tokenHttpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", base64Credentials);
var tokenResponse = tokenHttpClient.PostAsync("https://login.learnpoint.se/connect/token",
new FormUrlEncodedContent(new Dictionary<string, string>{
{ "grant_type", "client_credentials" },
{ "scope", requestedScopes }
})).Result;
var tokenResponseContent = tokenResponse.Content.ReadAsStringAsync().Result;
//Construct a JSON document from the response and extract the AccessToken
var tokenResponseJSON = JsonDocument.Parse(tokenResponseContent);
string accessToken = null;
if (tokenResponseJSON.RootElement.TryGetProperty("access_token", out JsonElement accessTokenJSONValue))
{
accessToken = accessTokenJSONValue.ToString();
}
//Fetch from API
var client = new HttpClient
{
BaseAddress = new Uri("https://api.learnpoint.se")
};
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", accessToken);
string jsonStudents = client.GetStringAsync($"/bulkapi/v2/{tenantIdentifier}/students").Result;
Console.WriteLine(jsonStudents);
string jsonGroups = client.GetStringAsync($"/bulkapi/v2/{tenantIdentifier}/groups").Result;
Console.WriteLine(jsonGroups);
string jsonStaffMembers = client.GetStringAsync($"/bulkapi/v2/{tenantIdentifier}/staffmembers").Result;
Console.WriteLine(jsonStaffMembers);
}
}
}
- Added UserId to models Student, FullStudent, StaffMember and FullStaffMember.
- Preparation for migration to Learnpoint API v3.
- Added ProgramEnrollmentId to StudentEducationPlan
- Preparation for migration to Learnpoint API v3.
- Added Phone2 (string?) to models StaffMember and FullStaffMember.
- New scope for Phone2: learnpointbulkapi.phone2.read
- Added StaffFunctions to FullStaffMember
- Added ExtendedProperties to Group and FullGroup
- Added Points to CourseDefinition
- Added Email2 (string?) to models Student, FullStudent, StaffMember and FullStaffMember.
- Added Id (int) to model StudentEducationPlan.
- Added parameter includecurrentandfuturegroupsonly (bool optional) to endpoint Groups.
- Added parameter studentsfilter.hasactiveeducation (bool optional) to endpoint Students.
- Added FromDate (date?) to model StudentEducationPlanState.
- Added parameter datascoperootgroupid (int optional) to endpoint Students, Groups and StaffMembers.
- Adding GroupRoles and StudentEducationPlans.
- Adding version info to JSON result.