Skip to main content
GET
/
lessons
/
{lessonId}
/
activities
Activities in a lesson
curl --request GET \
  --url https://api.learningcommons.org/knowledge-graph/v0/lessons/{lessonId}/activities \
  --header 'x-api-key: <api-key>'
import requests

url = "https://api.learningcommons.org/knowledge-graph/v0/lessons/{lessonId}/activities"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://api.learningcommons.org/knowledge-graph/v0/lessons/{lessonId}/activities', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.learningcommons.org/knowledge-graph/v0/lessons/{lessonId}/activities",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-api-key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.learningcommons.org/knowledge-graph/v0/lessons/{lessonId}/activities"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.learningcommons.org/knowledge-graph/v0/lessons/{lessonId}/activities")
  .header("x-api-key", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.learningcommons.org/knowledge-graph/v0/lessons/{lessonId}/activities")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "identifier": "im:98928b4e-0183-5e0e-955d-230653db7332",
      "name": "Devices",
      "ordinalName": "Activity 1",
      "position": 0,
      "academicSubject": "Mathematics",
      "gradeLevel": [
        "high_school",
        "9",
        "10",
        "11",
        "12"
      ],
      "author": "Illustrative Mathematics",
      "provider": "Learning Commons",
      "inLanguage": "English",
      "educationalUse": "instruction",
      "audience": [
        "Teacher",
        "Student",
        "Family"
      ],
      "license": "https://creativecommons.org/licenses/by-nc/4.0/",
      "curriculumLabel": "Warm-up",
      "lmsLoadingGuidance": "unspecified",
      "isOptional": false,
      "courseCode": "im360:Alg1",
      "timeRequired": "PT5M",
      "studentGroupingType": "pair",
      "dateCreated": "2020-06-25"
    }
  ],
  "pagination": {
    "limit": 100,
    "nextCursor": null,
    "hasMore": false
  }
}
{
  "error": "ValidationError",
  "message": "Invalid query parameter value provided",
  "requestId": "req_12345"
}
{
  "error": "NotFoundError",
  "message": "Lesson with identifier 'im:invalid-id' not found",
  "requestId": "req_12345"
}
{
  "error": "InternalServerError",
  "message": "An unexpected error occurred while retrieving activities",
  "requestId": "req_12345"
}

Authorizations

x-api-key
string
header
required

API key for authentication. Include your API key in the x-api-key header for all requests.

Path Parameters

lessonId
string
required

The unique identifier of the lesson

Query Parameters

limit
integer
default:100

Maximum number of results to return. Default is 100. Maximum allowed is 1000.

Required range: 1 <= x <= 1000
cursor
string

Cursor for pagination. Obtain this value from the 'nextCursor' field in the previous response. Omit for the first page.

Response

Successfully retrieved list of activities

Generic cursor-based paginated response wrapper

data
object[]
required

Array of result items

pagination
object
required

Cursor-based pagination metadata