Docs API reference
Learner API
What a signed-in learner does, for building your own front end.
These endpoints are for the learner's own session (a login token). They are how you build a learning experience in your own site. Everything is scoped to enrollments the learner owns. See Learner experience.
13 endpoints · base path /api/v1
My certificates
AccessA signed-in user (the learner's own login token).
Lists the signed-in learner's certificates, including expired or revoked ones, with status.
Responses
Example response
[
{
"courseId": "ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561",
"courseTitle": "Workplace Safety Essentials",
"enrollmentId": "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8",
"expiresAt": "2026-11-25T14:03:11Z",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"issuedAt": "2026-11-25T14:03:11Z",
"learnerName": "Maya Chen",
"revokedAt": "2026-11-25T14:03:11Z",
"revokedReason": "string",
"serial": "NBL-K7PQ-2X9M",
"status": "ACTIVE",
"userId": "11f967df-4272-482f-ac0b-7bea76dd8093",
"verificationCode": "q8sV2k…",
"verificationUrl": "https://learn.example.com/verify/q8sV2k…"
}
]Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
Errors use RFC 9457 problem details.
curl -X GET "$LMS_URL/api/v1/me/certificates" \
-H "Authorization: Bearer $LMS_TOKEN"const LMS_URL = process.env.LMS_URL
const LMS_TOKEN = process.env.LMS_TOKEN
const res = await fetch(`${LMS_URL}/api/v1/me/certificates`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_TOKEN = process.env.LMS_TOKEN!
const res = await fetch(`${LMS_URL}/api/v1/me/certificates`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"Authorization": "Bearer " + os.environ["LMS_TOKEN"]}
res = requests.get(f"{LMS_URL}/api/v1/me/certificates", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsToken = System.getenv("LMS_TOKEN");
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/me/certificates"))
.header("Authorization", "Bearer " + lmsToken)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
uri = URI("#{lms_url}/api/v1/me/certificates")
request = Net::HTTP::Get.new(uri, "Authorization" => "Bearer " + ENV.fetch("LMS_TOKEN"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$ch = curl_init("$lmsUrl/api/v1/me/certificates");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('LMS_TOKEN')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/me/certificates", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("LMS_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Download my certificate PDF
AccessA signed-in user (the learner's own login token).
Downloads one of the learner's own certificates. A revoked certificate returns 410.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| idrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
"string"Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
| 410 | The certificate has been revoked. |
Errors use RFC 9457 problem details.
CERTIFICATE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X GET "$LMS_URL/api/v1/me/certificates/$CERTIFICATE_ID/pdf" \
-H "Authorization: Bearer $LMS_TOKEN"const LMS_URL = process.env.LMS_URL
const LMS_TOKEN = process.env.LMS_TOKEN
const certificateId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/me/certificates/${certificateId}/pdf`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_TOKEN = process.env.LMS_TOKEN!
const certificateId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/me/certificates/${certificateId}/pdf`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"Authorization": "Bearer " + os.environ["LMS_TOKEN"]}
certificate_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
res = requests.get(f"{LMS_URL}/api/v1/me/certificates/{certificate_id}/pdf", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsToken = System.getenv("LMS_TOKEN");
String certificateId = "37386ae0-0ea5-44e0-a02e-161f807af560";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/me/certificates/" + certificateId + "/pdf"))
.header("Authorization", "Bearer " + lmsToken)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
certificate_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
uri = URI("#{lms_url}/api/v1/me/certificates/#{certificate_id}/pdf")
request = Net::HTTP::Get.new(uri, "Authorization" => "Bearer " + ENV.fetch("LMS_TOKEN"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$certificateId = "37386ae0-0ea5-44e0-a02e-161f807af560";
$ch = curl_init("$lmsUrl/api/v1/me/certificates/{$certificateId}/pdf");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('LMS_TOKEN')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
certificateId := "37386ae0-0ea5-44e0-a02e-161f807af560"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/me/certificates/" + certificateId + "/pdf", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("LMS_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}My enrollments
AccessA signed-in user (the learner's own login token).
Lists the signed-in learner's active and completed enrollments with progress.
Responses
Example response
[
{
"completedAt": "2026-11-25T14:03:11Z",
"courseId": "ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561",
"courseSlug": "string",
"courseTitle": "Workplace Safety Essentials",
"dueAt": "2026-11-25T14:03:11Z",
"expiresAt": "2026-11-25T14:03:11Z",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"organizationId": "44b78147-d73b-4117-ab62-4292d9ca20db",
"progressPercent": 40,
"status": "ACTIVE"
}
]Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | The credential is an API key. Only a signed-in user has enrollments. |
Errors use RFC 9457 problem details.
curl -X GET "$LMS_URL/api/v1/me/enrollments" \
-H "Authorization: Bearer $LMS_TOKEN"const LMS_URL = process.env.LMS_URL
const LMS_TOKEN = process.env.LMS_TOKEN
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_TOKEN = process.env.LMS_TOKEN!
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"Authorization": "Bearer " + os.environ["LMS_TOKEN"]}
res = requests.get(f"{LMS_URL}/api/v1/me/enrollments", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsToken = System.getenv("LMS_TOKEN");
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/me/enrollments"))
.header("Authorization", "Bearer " + lmsToken)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
uri = URI("#{lms_url}/api/v1/me/enrollments")
request = Net::HTTP::Get.new(uri, "Authorization" => "Bearer " + ENV.fetch("LMS_TOKEN"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$ch = curl_init("$lmsUrl/api/v1/me/enrollments");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('LMS_TOKEN')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/me/enrollments", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("LMS_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}My attempts at a quiz
AccessA signed-in user (the learner's own login token).
Lists the learner's attempts with status, score and pass/fail. Attempts whose time ran out are closed first.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| enrollmentIdrequired | path | string (uuid) | The id from a previous response. |
| assessmentIdrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
[
{
"attemptNumber": 1,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"passed": true,
"scorePercent": 86.5,
"startedAt": "2026-11-25T14:03:11Z",
"status": "ACTIVE",
"submittedAt": "2026-11-25T14:03:11Z"
}
]Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
Errors use RFC 9457 problem details.
ENROLLMENT_ID=8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8
ASSESSMENT_ID=9c587f42-0084-4ea2-ac29-69ed309641da
curl -X GET "$LMS_URL/api/v1/me/enrollments/$ENROLLMENT_ID/assessments/$ASSESSMENT_ID/attempts" \
-H "Authorization: Bearer $LMS_TOKEN"const LMS_URL = process.env.LMS_URL
const LMS_TOKEN = process.env.LMS_TOKEN
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const assessmentId = "9c587f42-0084-4ea2-ac29-69ed309641da"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/assessments/${assessmentId}/attempts`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_TOKEN = process.env.LMS_TOKEN!
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const assessmentId = "9c587f42-0084-4ea2-ac29-69ed309641da"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/assessments/${assessmentId}/attempts`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"Authorization": "Bearer " + os.environ["LMS_TOKEN"]}
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
assessment_id = "9c587f42-0084-4ea2-ac29-69ed309641da"
res = requests.get(f"{LMS_URL}/api/v1/me/enrollments/{enrollment_id}/assessments/{assessment_id}/attempts", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsToken = System.getenv("LMS_TOKEN");
String enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
String assessmentId = "9c587f42-0084-4ea2-ac29-69ed309641da";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/me/enrollments/" + enrollmentId + "/assessments/" + assessmentId + "/attempts"))
.header("Authorization", "Bearer " + lmsToken)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
assessment_id = "9c587f42-0084-4ea2-ac29-69ed309641da"
uri = URI("#{lms_url}/api/v1/me/enrollments/#{enrollment_id}/assessments/#{assessment_id}/attempts")
request = Net::HTTP::Get.new(uri, "Authorization" => "Bearer " + ENV.fetch("LMS_TOKEN"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
$assessmentId = "9c587f42-0084-4ea2-ac29-69ed309641da";
$ch = curl_init("$lmsUrl/api/v1/me/enrollments/{$enrollmentId}/assessments/{$assessmentId}/attempts");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('LMS_TOKEN')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
enrollmentId := "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
assessmentId := "9c587f42-0084-4ea2-ac29-69ed309641da"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/me/enrollments/" + enrollmentId + "/assessments/" + assessmentId + "/attempts", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("LMS_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Start (or resume) a quiz attempt
AccessA signed-in user (the learner's own login token).
Freezes the learner's paper: which question versions, in what order, how options are shuffled, and any random draws from pools. Learners receive each question's public form only. The answer key is never sent.
If an attempt is already open it is returned (resuming) instead of starting another. Starting is refused once the learner has passed or has no attempts left.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| enrollmentIdrequired | path | string (uuid) | The id from a previous response. |
| assessmentIdrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
{
"assessmentId": "9c587f42-0084-4ea2-ac29-69ed309641da",
"assessmentTitle": "Safety knowledge check",
"attemptNumber": 1,
"dueAt": "2026-11-25T14:03:11Z",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"maxPoints": 1.5,
"passed": true,
"questions": [
{
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"options": {},
"points": 1,
"position": 0,
"prompt": "Where do you go when the fire alarm sounds?",
"response": {},
"result": {
"answerKey": {},
"correct": false,
"explanation": "Always use the nearest safe exit.",
"graderFeedback": "string",
"pointsAwarded": 1
},
"type": "SINGLE_CHOICE"
}
],
"scorePercent": 86.5,
"scorePoints": 1.5,
"startedAt": "2026-11-25T14:03:11Z",
"status": "ACTIVE",
"submittedAt": "2026-11-25T14:03:11Z"
}Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | The quiz's lesson is locked. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
| 409 | Already passed, no attempts left, or the quiz has no questions. |
Errors use RFC 9457 problem details.
ENROLLMENT_ID=8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8
ASSESSMENT_ID=9c587f42-0084-4ea2-ac29-69ed309641da
curl -X POST "$LMS_URL/api/v1/me/enrollments/$ENROLLMENT_ID/assessments/$ASSESSMENT_ID/attempts" \
-H "Authorization: Bearer $LMS_TOKEN"const LMS_URL = process.env.LMS_URL
const LMS_TOKEN = process.env.LMS_TOKEN
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const assessmentId = "9c587f42-0084-4ea2-ac29-69ed309641da"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/assessments/${assessmentId}/attempts`, {
method: 'POST',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_TOKEN = process.env.LMS_TOKEN!
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const assessmentId = "9c587f42-0084-4ea2-ac29-69ed309641da"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/assessments/${assessmentId}/attempts`, {
method: 'POST',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"Authorization": "Bearer " + os.environ["LMS_TOKEN"]}
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
assessment_id = "9c587f42-0084-4ea2-ac29-69ed309641da"
res = requests.post(f"{LMS_URL}/api/v1/me/enrollments/{enrollment_id}/assessments/{assessment_id}/attempts", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsToken = System.getenv("LMS_TOKEN");
String enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
String assessmentId = "9c587f42-0084-4ea2-ac29-69ed309641da";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/me/enrollments/" + enrollmentId + "/assessments/" + assessmentId + "/attempts"))
.header("Authorization", "Bearer " + lmsToken)
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
assessment_id = "9c587f42-0084-4ea2-ac29-69ed309641da"
uri = URI("#{lms_url}/api/v1/me/enrollments/#{enrollment_id}/assessments/#{assessment_id}/attempts")
request = Net::HTTP::Post.new(uri, "Authorization" => "Bearer " + ENV.fetch("LMS_TOKEN"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
$assessmentId = "9c587f42-0084-4ea2-ac29-69ed309641da";
$ch = curl_init("$lmsUrl/api/v1/me/enrollments/{$enrollmentId}/assessments/{$assessmentId}/attempts");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('LMS_TOKEN')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
enrollmentId := "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
assessmentId := "9c587f42-0084-4ea2-ac29-69ed309641da"
req, _ := http.NewRequest("POST", os.Getenv("LMS_URL") + "/api/v1/me/enrollments/" + enrollmentId + "/assessments/" + assessmentId + "/attempts", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("LMS_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Download a course file
AccessA signed-in user (the learner's own login token).
Downloads a file, but only if the learner's course version actually uses it. Any other file id returns 404, even if it exists in the tenant.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| enrollmentIdrequired | path | string (uuid) | The id from a previous response. |
| assetIdrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
"string"Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
Errors use RFC 9457 problem details.
ENROLLMENT_ID=8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8
ASSET_ID=dda59af6-a498-4a16-acd9-97f9817194fe
curl -X GET "$LMS_URL/api/v1/me/enrollments/$ENROLLMENT_ID/assets/$ASSET_ID/content" \
-H "Authorization: Bearer $LMS_TOKEN"const LMS_URL = process.env.LMS_URL
const LMS_TOKEN = process.env.LMS_TOKEN
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const assetId = "dda59af6-a498-4a16-acd9-97f9817194fe"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/assets/${assetId}/content`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_TOKEN = process.env.LMS_TOKEN!
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const assetId = "dda59af6-a498-4a16-acd9-97f9817194fe"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/assets/${assetId}/content`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"Authorization": "Bearer " + os.environ["LMS_TOKEN"]}
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
asset_id = "dda59af6-a498-4a16-acd9-97f9817194fe"
res = requests.get(f"{LMS_URL}/api/v1/me/enrollments/{enrollment_id}/assets/{asset_id}/content", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsToken = System.getenv("LMS_TOKEN");
String enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
String assetId = "dda59af6-a498-4a16-acd9-97f9817194fe";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/me/enrollments/" + enrollmentId + "/assets/" + assetId + "/content"))
.header("Authorization", "Bearer " + lmsToken)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
asset_id = "dda59af6-a498-4a16-acd9-97f9817194fe"
uri = URI("#{lms_url}/api/v1/me/enrollments/#{enrollment_id}/assets/#{asset_id}/content")
request = Net::HTTP::Get.new(uri, "Authorization" => "Bearer " + ENV.fetch("LMS_TOKEN"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
$assetId = "dda59af6-a498-4a16-acd9-97f9817194fe";
$ch = curl_init("$lmsUrl/api/v1/me/enrollments/{$enrollmentId}/assets/{$assetId}/content");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('LMS_TOKEN')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
enrollmentId := "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
assetId := "dda59af6-a498-4a16-acd9-97f9817194fe"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/me/enrollments/" + enrollmentId + "/assets/" + assetId + "/content", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("LMS_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Get an attempt
AccessA signed-in user (the learner's own login token).
The attempt as the learner may see it. Per-question results and the correct answers appear only when the quiz's feedbackMode allows (AFTER_ATTEMPT, or AFTER_PASS once passed). A score is shown once the attempt is fully graded.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| enrollmentIdrequired | path | string (uuid) | The id from a previous response. |
| attemptIdrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
{
"assessmentId": "9c587f42-0084-4ea2-ac29-69ed309641da",
"assessmentTitle": "Safety knowledge check",
"attemptNumber": 1,
"dueAt": "2026-11-25T14:03:11Z",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"maxPoints": 1.5,
"passed": true,
"questions": [
{
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"options": {},
"points": 1,
"position": 0,
"prompt": "Where do you go when the fire alarm sounds?",
"response": {},
"result": {
"answerKey": {},
"correct": false,
"explanation": "Always use the nearest safe exit.",
"graderFeedback": "string",
"pointsAwarded": 1
},
"type": "SINGLE_CHOICE"
}
],
"scorePercent": 86.5,
"scorePoints": 1.5,
"startedAt": "2026-11-25T14:03:11Z",
"status": "ACTIVE",
"submittedAt": "2026-11-25T14:03:11Z"
}Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
Errors use RFC 9457 problem details.
ENROLLMENT_ID=8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8
ATTEMPT_ID=ca174553-d8b0-4963-a885-8246487aba77
curl -X GET "$LMS_URL/api/v1/me/enrollments/$ENROLLMENT_ID/attempts/$ATTEMPT_ID" \
-H "Authorization: Bearer $LMS_TOKEN"const LMS_URL = process.env.LMS_URL
const LMS_TOKEN = process.env.LMS_TOKEN
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const attemptId = "ca174553-d8b0-4963-a885-8246487aba77"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/attempts/${attemptId}`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_TOKEN = process.env.LMS_TOKEN!
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const attemptId = "ca174553-d8b0-4963-a885-8246487aba77"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/attempts/${attemptId}`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"Authorization": "Bearer " + os.environ["LMS_TOKEN"]}
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
attempt_id = "ca174553-d8b0-4963-a885-8246487aba77"
res = requests.get(f"{LMS_URL}/api/v1/me/enrollments/{enrollment_id}/attempts/{attempt_id}", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsToken = System.getenv("LMS_TOKEN");
String enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
String attemptId = "ca174553-d8b0-4963-a885-8246487aba77";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/me/enrollments/" + enrollmentId + "/attempts/" + attemptId))
.header("Authorization", "Bearer " + lmsToken)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
attempt_id = "ca174553-d8b0-4963-a885-8246487aba77"
uri = URI("#{lms_url}/api/v1/me/enrollments/#{enrollment_id}/attempts/#{attempt_id}")
request = Net::HTTP::Get.new(uri, "Authorization" => "Bearer " + ENV.fetch("LMS_TOKEN"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
$attemptId = "ca174553-d8b0-4963-a885-8246487aba77";
$ch = curl_init("$lmsUrl/api/v1/me/enrollments/{$enrollmentId}/attempts/{$attemptId}");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('LMS_TOKEN')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
enrollmentId := "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
attemptId := "ca174553-d8b0-4963-a885-8246487aba77"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/me/enrollments/" + enrollmentId + "/attempts/" + attemptId, nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("LMS_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Save answers
AccessA signed-in user (the learner's own login token).
Autosaves answers for the questions you list; a null response clears an answer. Each response is validated against its question's shape (see Quizzes & questions).
For a timed quiz, answers can't be saved after the deadline (plus 30 seconds of grace).
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| enrollmentIdrequired | path | string (uuid) | The id from a previous response. |
| attemptIdrequired | path | string (uuid) | The id from a previous response. |
Request body application/json · Answers
| Field | Type | Notes |
|---|---|---|
| answersrequired | Answer[] | — |
Example request body
{
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a"
}
},
{
"questionId": "1f8a4c70-b2d9-4e35-9c61-d3a7e0b5f428",
"response": {
"value": true
}
}
]
}Responses
Example response
{
"assessmentId": "9c587f42-0084-4ea2-ac29-69ed309641da",
"assessmentTitle": "Safety knowledge check",
"attemptNumber": 1,
"dueAt": "2026-11-25T14:03:11Z",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"maxPoints": 1.5,
"passed": true,
"questions": [
{
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"options": {},
"points": 1,
"position": 0,
"prompt": "Where do you go when the fire alarm sounds?",
"response": {},
"result": {
"answerKey": {},
"correct": false,
"explanation": "Always use the nearest safe exit.",
"graderFeedback": "string",
"pointsAwarded": 1
},
"type": "SINGLE_CHOICE"
}
],
"scorePercent": 86.5,
"scorePoints": 1.5,
"startedAt": "2026-11-25T14:03:11Z",
"status": "ACTIVE",
"submittedAt": "2026-11-25T14:03:11Z"
}Errors
| Status | When |
|---|---|
| 400 | A response doesn't fit its question (for example an unknown option id). |
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
| 409 | The attempt was already submitted, or time is up. |
Errors use RFC 9457 problem details.
ENROLLMENT_ID=8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8
ATTEMPT_ID=ca174553-d8b0-4963-a885-8246487aba77
curl -X PUT "$LMS_URL/api/v1/me/enrollments/$ENROLLMENT_ID/attempts/$ATTEMPT_ID/answers" \
-H "Authorization: Bearer $LMS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a"
}
},
{
"questionId": "1f8a4c70-b2d9-4e35-9c61-d3a7e0b5f428",
"response": {
"value": true
}
}
]
}'const LMS_URL = process.env.LMS_URL
const LMS_TOKEN = process.env.LMS_TOKEN
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const attemptId = "ca174553-d8b0-4963-a885-8246487aba77"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/attempts/${attemptId}/answers`, {
method: 'PUT',
headers: { "Authorization": `Bearer ${LMS_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a"
}
},
{
"questionId": "1f8a4c70-b2d9-4e35-9c61-d3a7e0b5f428",
"response": {
"value": true
}
}
]
}),
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_TOKEN = process.env.LMS_TOKEN!
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const attemptId = "ca174553-d8b0-4963-a885-8246487aba77"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/attempts/${attemptId}/answers`, {
method: 'PUT',
headers: { "Authorization": `Bearer ${LMS_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a"
}
},
{
"questionId": "1f8a4c70-b2d9-4e35-9c61-d3a7e0b5f428",
"response": {
"value": true
}
}
]
}),
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"Authorization": "Bearer " + os.environ["LMS_TOKEN"]}
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
attempt_id = "ca174553-d8b0-4963-a885-8246487aba77"
res = requests.put(f"{LMS_URL}/api/v1/me/enrollments/{enrollment_id}/attempts/{attempt_id}/answers", headers=HEADERS, json={
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a",
},
},
{
"questionId": "1f8a4c70-b2d9-4e35-9c61-d3a7e0b5f428",
"response": {
"value": True,
},
},
],
}, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsToken = System.getenv("LMS_TOKEN");
String enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
String attemptId = "ca174553-d8b0-4963-a885-8246487aba77";
String body = """
{
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a"
}
},
{
"questionId": "1f8a4c70-b2d9-4e35-9c61-d3a7e0b5f428",
"response": {
"value": true
}
}
]
}
""";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/me/enrollments/" + enrollmentId + "/attempts/" + attemptId + "/answers"))
.header("Authorization", "Bearer " + lmsToken)
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
attempt_id = "ca174553-d8b0-4963-a885-8246487aba77"
uri = URI("#{lms_url}/api/v1/me/enrollments/#{enrollment_id}/attempts/#{attempt_id}/answers")
request = Net::HTTP::Put.new(uri, "Authorization" => "Bearer " + ENV.fetch("LMS_TOKEN"), "Content-Type" => "application/json")
request.body = {
"answers" => [
{
"questionId" => "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response" => {
"optionId" => "a",
},
},
{
"questionId" => "1f8a4c70-b2d9-4e35-9c61-d3a7e0b5f428",
"response" => {
"value" => true,
},
},
],
}.to_json
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
$attemptId = "ca174553-d8b0-4963-a885-8246487aba77";
$ch = curl_init("$lmsUrl/api/v1/me/enrollments/{$enrollmentId}/attempts/{$attemptId}/answers");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('LMS_TOKEN'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
"answers" => [
[
"questionId" => "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response" => [
"optionId" => "a",
],
],
[
"questionId" => "1f8a4c70-b2d9-4e35-9c61-d3a7e0b5f428",
"response" => [
"value" => true,
],
],
],
]),
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
enrollmentId := "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
attemptId := "ca174553-d8b0-4963-a885-8246487aba77"
body := strings.NewReader(`{
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a"
}
},
{
"questionId": "1f8a4c70-b2d9-4e35-9c61-d3a7e0b5f428",
"response": {
"value": true
}
}
]
}`)
req, _ := http.NewRequest("PUT", os.Getenv("LMS_URL") + "/api/v1/me/enrollments/" + enrollmentId + "/attempts/" + attemptId + "/answers", body)
req.Header.Set("Authorization", "Bearer " + os.Getenv("LMS_TOKEN"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Submit an attempt
AccessA signed-in user (the learner's own login token).
Optionally saves final answers, then grades. Auto-graded questions are scored immediately. If the quiz has essay questions the attempt becomes NEEDS_GRADING and no score is shown yet. Otherwise it is GRADED, pass or fail is set, and passing completes the lessons that require it. Emits attempt.submitted and attempt.graded.
Submitting an attempt whose time has run out grades what was saved before the deadline.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| enrollmentIdrequired | path | string (uuid) | The id from a previous response. |
| attemptIdrequired | path | string (uuid) | The id from a previous response. |
Request body application/json · Answers
| Field | Type | Notes |
|---|---|---|
| answersrequired | Answer[] | — |
Example request body
{
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a"
}
}
]
}Responses
Example response
{
"assessmentId": "9c587f42-0084-4ea2-ac29-69ed309641da",
"assessmentTitle": "Safety knowledge check",
"attemptNumber": 1,
"dueAt": "2026-11-25T14:03:11Z",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"maxPoints": 1.5,
"passed": true,
"questions": [
{
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"options": {},
"points": 1,
"position": 0,
"prompt": "Where do you go when the fire alarm sounds?",
"response": {},
"result": {
"answerKey": {},
"correct": false,
"explanation": "Always use the nearest safe exit.",
"graderFeedback": "string",
"pointsAwarded": 1
},
"type": "SINGLE_CHOICE"
}
],
"scorePercent": 86.5,
"scorePoints": 1.5,
"startedAt": "2026-11-25T14:03:11Z",
"status": "ACTIVE",
"submittedAt": "2026-11-25T14:03:11Z"
}Errors
| Status | When |
|---|---|
| 400 | The request was malformed or failed validation. errors lists each field. |
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
Errors use RFC 9457 problem details.
ENROLLMENT_ID=8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8
ATTEMPT_ID=ca174553-d8b0-4963-a885-8246487aba77
curl -X POST "$LMS_URL/api/v1/me/enrollments/$ENROLLMENT_ID/attempts/$ATTEMPT_ID/submit" \
-H "Authorization: Bearer $LMS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a"
}
}
]
}'const LMS_URL = process.env.LMS_URL
const LMS_TOKEN = process.env.LMS_TOKEN
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const attemptId = "ca174553-d8b0-4963-a885-8246487aba77"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/attempts/${attemptId}/submit`, {
method: 'POST',
headers: { "Authorization": `Bearer ${LMS_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a"
}
}
]
}),
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_TOKEN = process.env.LMS_TOKEN!
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const attemptId = "ca174553-d8b0-4963-a885-8246487aba77"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/attempts/${attemptId}/submit`, {
method: 'POST',
headers: { "Authorization": `Bearer ${LMS_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a"
}
}
]
}),
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"Authorization": "Bearer " + os.environ["LMS_TOKEN"]}
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
attempt_id = "ca174553-d8b0-4963-a885-8246487aba77"
res = requests.post(f"{LMS_URL}/api/v1/me/enrollments/{enrollment_id}/attempts/{attempt_id}/submit", headers=HEADERS, json={
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a",
},
},
],
}, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsToken = System.getenv("LMS_TOKEN");
String enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
String attemptId = "ca174553-d8b0-4963-a885-8246487aba77";
String body = """
{
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a"
}
}
]
}
""";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/me/enrollments/" + enrollmentId + "/attempts/" + attemptId + "/submit"))
.header("Authorization", "Bearer " + lmsToken)
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
attempt_id = "ca174553-d8b0-4963-a885-8246487aba77"
uri = URI("#{lms_url}/api/v1/me/enrollments/#{enrollment_id}/attempts/#{attempt_id}/submit")
request = Net::HTTP::Post.new(uri, "Authorization" => "Bearer " + ENV.fetch("LMS_TOKEN"), "Content-Type" => "application/json")
request.body = {
"answers" => [
{
"questionId" => "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response" => {
"optionId" => "a",
},
},
],
}.to_json
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
$attemptId = "ca174553-d8b0-4963-a885-8246487aba77";
$ch = curl_init("$lmsUrl/api/v1/me/enrollments/{$enrollmentId}/attempts/{$attemptId}/submit");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('LMS_TOKEN'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
"answers" => [
[
"questionId" => "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response" => [
"optionId" => "a",
],
],
],
]),
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
enrollmentId := "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
attemptId := "ca174553-d8b0-4963-a885-8246487aba77"
body := strings.NewReader(`{
"answers": [
{
"questionId": "9d3b6e21-4a85-4f17-b0c2-7e5a1d8f3b64",
"response": {
"optionId": "a"
}
}
]
}`)
req, _ := http.NewRequest("POST", os.Getenv("LMS_URL") + "/api/v1/me/enrollments/" + enrollmentId + "/attempts/" + attemptId + "/submit", body)
req.Header.Set("Authorization", "Bearer " + os.Getenv("LMS_TOKEN"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Open a course
AccessA signed-in user (the learner's own login token).
The outline of the learner's course: sections and lessons with each lesson's status, whether it is locked, and time spent, plus overall progress and any certificate. Lesson content is fetched lesson by lesson.
An enrollment that isn't the caller's returns 404, exactly as if it didn't exist.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| enrollmentIdrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
{
"certificateId": "b335ac0d-4339-49fd-ab81-01ace7c46f69",
"completedAt": "2026-11-25T14:03:11Z",
"courseId": "ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561",
"description": "A short description.",
"dueAt": "2026-11-25T14:03:11Z",
"enrollmentId": "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8",
"expiresAt": "2026-11-25T14:03:11Z",
"modules": [
{
"description": "A short description.",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"lessons": [
{
"completionMode": "MANUAL",
"estimatedMinutes": 30,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"isRequired": true,
"locked": false,
"secondsSpent": 120,
"status": "ACTIVE",
"title": "Workplace Safety Essentials"
}
],
"title": "Workplace Safety Essentials"
}
],
"progressPercent": 40,
"status": "ACTIVE",
"summary": "Fire safety and everyday hazards.",
"title": "Workplace Safety Essentials"
}Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | The enrollment is withdrawn or expired. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
Errors use RFC 9457 problem details.
ENROLLMENT_ID=8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8
curl -X GET "$LMS_URL/api/v1/me/enrollments/$ENROLLMENT_ID/course" \
-H "Authorization: Bearer $LMS_TOKEN"const LMS_URL = process.env.LMS_URL
const LMS_TOKEN = process.env.LMS_TOKEN
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/course`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_TOKEN = process.env.LMS_TOKEN!
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/course`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"Authorization": "Bearer " + os.environ["LMS_TOKEN"]}
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
res = requests.get(f"{LMS_URL}/api/v1/me/enrollments/{enrollment_id}/course", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsToken = System.getenv("LMS_TOKEN");
String enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/me/enrollments/" + enrollmentId + "/course"))
.header("Authorization", "Bearer " + lmsToken)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
uri = URI("#{lms_url}/api/v1/me/enrollments/#{enrollment_id}/course")
request = Net::HTTP::Get.new(uri, "Authorization" => "Bearer " + ENV.fetch("LMS_TOKEN"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
$ch = curl_init("$lmsUrl/api/v1/me/enrollments/{$enrollmentId}/course");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('LMS_TOKEN')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
enrollmentId := "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/me/enrollments/" + enrollmentId + "/course", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("LMS_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Open a lesson
AccessA signed-in user (the learner's own login token).
Returns the lesson's blocks. Opening a lesson starts it, and a VIEWED lesson completes right here. Quiz blocks include the learner's attempts so far and whether they can start another.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| enrollmentIdrequired | path | string (uuid) | The id from a previous response. |
| lessonIdrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
{
"blocks": [
{
"assessment": {
"attemptsUsed": 1,
"bestPercent": 1.5,
"canStart": true,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"instructions": "string",
"maxAttempts": 3,
"openAttemptId": "60c9388f-6f94-41df-a4df-569af1908d83",
"passPercent": 70,
"passed": true,
"timeLimitSeconds": 1,
"title": "Workplace Safety Essentials"
},
"assetUrl": "string",
"content": {},
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"position": 0,
"type": "SINGLE_CHOICE"
}
],
"completionMode": "MANUAL",
"estimatedMinutes": 30,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"isRequired": true,
"resumeState": {},
"status": "ACTIVE",
"title": "Workplace Safety Essentials"
}Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | The lesson is locked until the previous required lesson is complete. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
Errors use RFC 9457 problem details.
ENROLLMENT_ID=8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8
LESSON_ID=3d477cf4-98e8-48b4-a056-a98b308b7364
curl -X GET "$LMS_URL/api/v1/me/enrollments/$ENROLLMENT_ID/lessons/$LESSON_ID" \
-H "Authorization: Bearer $LMS_TOKEN"const LMS_URL = process.env.LMS_URL
const LMS_TOKEN = process.env.LMS_TOKEN
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const lessonId = "3d477cf4-98e8-48b4-a056-a98b308b7364"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/lessons/${lessonId}`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_TOKEN = process.env.LMS_TOKEN!
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const lessonId = "3d477cf4-98e8-48b4-a056-a98b308b7364"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/lessons/${lessonId}`, {
method: 'GET',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"Authorization": "Bearer " + os.environ["LMS_TOKEN"]}
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
lesson_id = "3d477cf4-98e8-48b4-a056-a98b308b7364"
res = requests.get(f"{LMS_URL}/api/v1/me/enrollments/{enrollment_id}/lessons/{lesson_id}", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsToken = System.getenv("LMS_TOKEN");
String enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
String lessonId = "3d477cf4-98e8-48b4-a056-a98b308b7364";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/me/enrollments/" + enrollmentId + "/lessons/" + lessonId))
.header("Authorization", "Bearer " + lmsToken)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
lesson_id = "3d477cf4-98e8-48b4-a056-a98b308b7364"
uri = URI("#{lms_url}/api/v1/me/enrollments/#{enrollment_id}/lessons/#{lesson_id}")
request = Net::HTTP::Get.new(uri, "Authorization" => "Bearer " + ENV.fetch("LMS_TOKEN"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
$lessonId = "3d477cf4-98e8-48b4-a056-a98b308b7364";
$ch = curl_init("$lmsUrl/api/v1/me/enrollments/{$enrollmentId}/lessons/{$lessonId}");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('LMS_TOKEN')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
enrollmentId := "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
lessonId := "3d477cf4-98e8-48b4-a056-a98b308b7364"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/me/enrollments/" + enrollmentId + "/lessons/" + lessonId, nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("LMS_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Mark a lesson complete
AccessA signed-in user (the learner's own login token).
For MANUAL lessons. Completing the last required lesson completes the course, issues the certificate and releases the seat. A lesson that completes by passing a quiz returns 409.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| enrollmentIdrequired | path | string (uuid) | The id from a previous response. |
| lessonIdrequired | path | string (uuid) | The id from a previous response. |
Responses
Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | The lesson is locked. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
| 409 | The lesson completes by passing its quiz, or the course is already completed. |
Errors use RFC 9457 problem details.
ENROLLMENT_ID=8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8
LESSON_ID=3d477cf4-98e8-48b4-a056-a98b308b7364
curl -X POST "$LMS_URL/api/v1/me/enrollments/$ENROLLMENT_ID/lessons/$LESSON_ID/complete" \
-H "Authorization: Bearer $LMS_TOKEN"const LMS_URL = process.env.LMS_URL
const LMS_TOKEN = process.env.LMS_TOKEN
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const lessonId = "3d477cf4-98e8-48b4-a056-a98b308b7364"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/lessons/${lessonId}/complete`, {
method: 'POST',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)const LMS_URL = process.env.LMS_URL!
const LMS_TOKEN = process.env.LMS_TOKEN!
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const lessonId = "3d477cf4-98e8-48b4-a056-a98b308b7364"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/lessons/${lessonId}/complete`, {
method: 'POST',
headers: { "Authorization": `Bearer ${LMS_TOKEN}` },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"Authorization": "Bearer " + os.environ["LMS_TOKEN"]}
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
lesson_id = "3d477cf4-98e8-48b4-a056-a98b308b7364"
res = requests.post(f"{LMS_URL}/api/v1/me/enrollments/{enrollment_id}/lessons/{lesson_id}/complete", headers=HEADERS, timeout=10)
res.raise_for_status()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsToken = System.getenv("LMS_TOKEN");
String enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
String lessonId = "3d477cf4-98e8-48b4-a056-a98b308b7364";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/me/enrollments/" + enrollmentId + "/lessons/" + lessonId + "/complete"))
.header("Authorization", "Bearer " + lmsToken)
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
lesson_id = "3d477cf4-98e8-48b4-a056-a98b308b7364"
uri = URI("#{lms_url}/api/v1/me/enrollments/#{enrollment_id}/lessons/#{lesson_id}/complete")
request = Net::HTTP::Post.new(uri, "Authorization" => "Bearer " + ENV.fetch("LMS_TOKEN"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)<?php
$lmsUrl = getenv('LMS_URL');
$enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
$lessonId = "3d477cf4-98e8-48b4-a056-a98b308b7364";
$ch = curl_init("$lmsUrl/api/v1/me/enrollments/{$enrollmentId}/lessons/{$lessonId}/complete");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('LMS_TOKEN')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
enrollmentId := "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
lessonId := "3d477cf4-98e8-48b4-a056-a98b308b7364"
req, _ := http.NewRequest("POST", os.Getenv("LMS_URL") + "/api/v1/me/enrollments/" + enrollmentId + "/lessons/" + lessonId + "/complete", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("LMS_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
_ = data
}Report time and position
AccessA signed-in user (the learner's own login token).
A heartbeat. secondsSpent (0 to 300 per call) adds to the lesson's time, and resumeState stores where the learner is (for example a video position) so they can resume.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| enrollmentIdrequired | path | string (uuid) | The id from a previous response. |
| lessonIdrequired | path | string (uuid) | The id from a previous response. |
Request body application/json · Heartbeat
| Field | Type | Notes |
|---|---|---|
| resumeState | JsonNode | — |
| secondsSpent | integer (int32) | 0 to 300 |
Example request body
{
"resumeState": {},
"secondsSpent": 120
}Responses
Errors
| Status | When |
|---|---|
| 400 | The request was malformed or failed validation. errors lists each field. |
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
Errors use RFC 9457 problem details.
ENROLLMENT_ID=8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8
LESSON_ID=3d477cf4-98e8-48b4-a056-a98b308b7364
curl -X PUT "$LMS_URL/api/v1/me/enrollments/$ENROLLMENT_ID/lessons/$LESSON_ID/progress" \
-H "Authorization: Bearer $LMS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"resumeState": {},
"secondsSpent": 120
}'const LMS_URL = process.env.LMS_URL
const LMS_TOKEN = process.env.LMS_TOKEN
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const lessonId = "3d477cf4-98e8-48b4-a056-a98b308b7364"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/lessons/${lessonId}/progress`, {
method: 'PUT',
headers: { "Authorization": `Bearer ${LMS_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"resumeState": {},
"secondsSpent": 120
}),
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)const LMS_URL = process.env.LMS_URL!
const LMS_TOKEN = process.env.LMS_TOKEN!
const enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
const lessonId = "3d477cf4-98e8-48b4-a056-a98b308b7364"
const res = await fetch(`${LMS_URL}/api/v1/me/enrollments/${enrollmentId}/lessons/${lessonId}/progress`, {
method: 'PUT',
headers: { "Authorization": `Bearer ${LMS_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"resumeState": {},
"secondsSpent": 120
}),
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"Authorization": "Bearer " + os.environ["LMS_TOKEN"]}
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
lesson_id = "3d477cf4-98e8-48b4-a056-a98b308b7364"
res = requests.put(f"{LMS_URL}/api/v1/me/enrollments/{enrollment_id}/lessons/{lesson_id}/progress", headers=HEADERS, json={
"resumeState": {},
"secondsSpent": 120,
}, timeout=10)
res.raise_for_status()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsToken = System.getenv("LMS_TOKEN");
String enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
String lessonId = "3d477cf4-98e8-48b4-a056-a98b308b7364";
String body = """
{
"resumeState": {},
"secondsSpent": 120
}
""";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/me/enrollments/" + enrollmentId + "/lessons/" + lessonId + "/progress"))
.header("Authorization", "Bearer " + lmsToken)
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
enrollment_id = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
lesson_id = "3d477cf4-98e8-48b4-a056-a98b308b7364"
uri = URI("#{lms_url}/api/v1/me/enrollments/#{enrollment_id}/lessons/#{lesson_id}/progress")
request = Net::HTTP::Put.new(uri, "Authorization" => "Bearer " + ENV.fetch("LMS_TOKEN"), "Content-Type" => "application/json")
request.body = {
"resumeState" => {},
"secondsSpent" => 120,
}.to_json
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)<?php
$lmsUrl = getenv('LMS_URL');
$enrollmentId = "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8";
$lessonId = "3d477cf4-98e8-48b4-a056-a98b308b7364";
$ch = curl_init("$lmsUrl/api/v1/me/enrollments/{$enrollmentId}/lessons/{$lessonId}/progress");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('LMS_TOKEN'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
"resumeState" => [],
"secondsSpent" => 120,
]),
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
enrollmentId := "8b76f3d8-59e7-4058-a47c-98d7ac7b3bf8"
lessonId := "3d477cf4-98e8-48b4-a056-a98b308b7364"
body := strings.NewReader(`{
"resumeState": {},
"secondsSpent": 120
}`)
req, _ := http.NewRequest("PUT", os.Getenv("LMS_URL") + "/api/v1/me/enrollments/" + enrollmentId + "/lessons/" + lessonId + "/progress", body)
req.Header.Set("Authorization", "Bearer " + os.Getenv("LMS_TOKEN"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
_ = data
}