Get Homework Assignments
curl --request GET \
--url https://api.example.com/v1/homeworks \
--header 'x-tenant-api-secret: <x-tenant-api-secret>'import requests
url = "https://api.example.com/v1/homeworks"
headers = {"x-tenant-api-secret": "<x-tenant-api-secret>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-tenant-api-secret': '<x-tenant-api-secret>'}};
fetch('https://api.example.com/v1/homeworks', 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.example.com/v1/homeworks",
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-tenant-api-secret: <x-tenant-api-secret>"
],
]);
$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.example.com/v1/homeworks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-tenant-api-secret", "<x-tenant-api-secret>")
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.example.com/v1/homeworks")
.header("x-tenant-api-secret", "<x-tenant-api-secret>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/homeworks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-tenant-api-secret"] = '<x-tenant-api-secret>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3fe84441-06c8-4e3a-95dc-fb009e4aaac6",
"tenantId": "fe3a8563-435f-4535-95b5-7dc723536d46",
"teacherId": "f9809200-e31f-4225-b9f3-73e7fb406d9a",
"assignmentId": "3",
"courseId": "fa8c410e-65ce-4f89-90da-e752747a8609",
"createdAt": "2025-05-07T18:33:16.098Z",
"updatedAt": "2025-05-07T18:33:16.098Z",
"files": [
{
"id": "bc84333d-2c5d-48aa-9391-48dca92c436d",
"homeworkId": "3fe84441-06c8-4e3a-95dc-fb009e4aaac6",
"fileType": "restriction",
"fileName": "restrictions_01(1).md",
"filePath": "fe3a8563-435f-4535-95b5-7dc723536d46/3fe84441-06c8-4e3a-95dc-fb009e4aaac6/restrictions_01(1).md",
"content": "1. Задание должно быть решено при помощи итератора.",
"createdAt": "2025-05-07T18:33:16.106Z",
"updatedAt": "2025-05-07T18:33:16.106Z"
},
{
"id": "ea06e25e-7a75-4ef2-8caf-4a5733ccdba5",
"homeworkId": "3fe84441-06c8-4e3a-95dc-fb009e4aaac6",
"fileType": "solution",
"fileName": "Task1.java",
"filePath": "fe3a8563-435f-4535-95b5-7dc723536d46/3fe84441-06c8-4e3a-95dc-fb009e4aaac6/Task1.java",
"content": "import java.util.ArrayList;\r\nimport java.util.Iterator;\r\nimport java.util.List;\r\n\r\npublic class Task1 {\r\n\r\n public static void main(String[] args) {\r\n\r\n List<Integer> numbers = new ArrayList<>(List.of(4, 8, 7, 10, 2, 9, 11, 5, 8, 0, 5));\r\n\r\n System.out.println(\"Исходный список:\");\r\n System.out.println(numbers);\r\n\r\n Iterator<Integer> iterator = numbers.iterator();\r\n while (iterator.hasNext()) {\r\n if (iterator.next() % 5 == 0) {\r\n iterator.remove();\r\n }\r\n }\r\n\r\n System.out.println(\"Список после удаления:\");\r\n System.out.println(numbers);\r\n }\r\n}\r\n",
"createdAt": "2025-05-07T18:33:16.106Z",
"updatedAt": "2025-05-07T18:33:16.106Z"
},
{
"id": "d046aef0-5811-4b17-852c-8d32a40a0d4e",
"homeworkId": "3fe84441-06c8-4e3a-95dc-fb009e4aaac6",
"fileType": "task",
"fileName": "homework.md",
"filePath": "fe3a8563-435f-4535-95b5-7dc723536d46/3fe84441-06c8-4e3a-95dc-fb009e4aaac6/homework.md",
"content": "1. Задача 1:\r\n - Создайте список чисел - 4, 8, 7, 10, 2, 9, 11, 5, 8, 0, 5. Выведите его в консоль.\r\n - Удалите из списка все числа, которые делятся нацело на 5. Снова выведите список в консоль.\r\n2. Задача 2:\r\n - Создайте список чисел - 4, 8, 7, 10, 2, 9, 11, 5, 8, 0, 5. Выведите его в консоль.\r\n - Двигаясь по списку, найдите число, которое больше 10.\r\n - Удалите из списка все чётные числа перед этим числом. Снова выведите список в консоль.",
"createdAt": "2025-05-07T18:33:16.106Z",
"updatedAt": "2025-05-07T18:33:16.106Z"
}
],
"course": {
"id": "fa8c410e-65ce-4f89-90da-e752747a8609",
"tenantId": "fe3a8563-435f-4535-95b5-7dc723536d46",
"teacherId": "f9809200-e31f-4225-b9f3-73e7fb406d9a",
"name": "Java",
"createdAt": "2025-05-07T18:33:12.682Z",
"updatedAt": "2025-05-07T18:33:12.682Z"
}
}
],
"nextPage": false,
"prevPage": false,
"total": 4
}
Homeworks
Get Homework Assignments
GET
/
v1
/
homeworks
Get Homework Assignments
curl --request GET \
--url https://api.example.com/v1/homeworks \
--header 'x-tenant-api-secret: <x-tenant-api-secret>'import requests
url = "https://api.example.com/v1/homeworks"
headers = {"x-tenant-api-secret": "<x-tenant-api-secret>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-tenant-api-secret': '<x-tenant-api-secret>'}};
fetch('https://api.example.com/v1/homeworks', 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.example.com/v1/homeworks",
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-tenant-api-secret: <x-tenant-api-secret>"
],
]);
$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.example.com/v1/homeworks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-tenant-api-secret", "<x-tenant-api-secret>")
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.example.com/v1/homeworks")
.header("x-tenant-api-secret", "<x-tenant-api-secret>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/homeworks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-tenant-api-secret"] = '<x-tenant-api-secret>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3fe84441-06c8-4e3a-95dc-fb009e4aaac6",
"tenantId": "fe3a8563-435f-4535-95b5-7dc723536d46",
"teacherId": "f9809200-e31f-4225-b9f3-73e7fb406d9a",
"assignmentId": "3",
"courseId": "fa8c410e-65ce-4f89-90da-e752747a8609",
"createdAt": "2025-05-07T18:33:16.098Z",
"updatedAt": "2025-05-07T18:33:16.098Z",
"files": [
{
"id": "bc84333d-2c5d-48aa-9391-48dca92c436d",
"homeworkId": "3fe84441-06c8-4e3a-95dc-fb009e4aaac6",
"fileType": "restriction",
"fileName": "restrictions_01(1).md",
"filePath": "fe3a8563-435f-4535-95b5-7dc723536d46/3fe84441-06c8-4e3a-95dc-fb009e4aaac6/restrictions_01(1).md",
"content": "1. Задание должно быть решено при помощи итератора.",
"createdAt": "2025-05-07T18:33:16.106Z",
"updatedAt": "2025-05-07T18:33:16.106Z"
},
{
"id": "ea06e25e-7a75-4ef2-8caf-4a5733ccdba5",
"homeworkId": "3fe84441-06c8-4e3a-95dc-fb009e4aaac6",
"fileType": "solution",
"fileName": "Task1.java",
"filePath": "fe3a8563-435f-4535-95b5-7dc723536d46/3fe84441-06c8-4e3a-95dc-fb009e4aaac6/Task1.java",
"content": "import java.util.ArrayList;\r\nimport java.util.Iterator;\r\nimport java.util.List;\r\n\r\npublic class Task1 {\r\n\r\n public static void main(String[] args) {\r\n\r\n List<Integer> numbers = new ArrayList<>(List.of(4, 8, 7, 10, 2, 9, 11, 5, 8, 0, 5));\r\n\r\n System.out.println(\"Исходный список:\");\r\n System.out.println(numbers);\r\n\r\n Iterator<Integer> iterator = numbers.iterator();\r\n while (iterator.hasNext()) {\r\n if (iterator.next() % 5 == 0) {\r\n iterator.remove();\r\n }\r\n }\r\n\r\n System.out.println(\"Список после удаления:\");\r\n System.out.println(numbers);\r\n }\r\n}\r\n",
"createdAt": "2025-05-07T18:33:16.106Z",
"updatedAt": "2025-05-07T18:33:16.106Z"
},
{
"id": "d046aef0-5811-4b17-852c-8d32a40a0d4e",
"homeworkId": "3fe84441-06c8-4e3a-95dc-fb009e4aaac6",
"fileType": "task",
"fileName": "homework.md",
"filePath": "fe3a8563-435f-4535-95b5-7dc723536d46/3fe84441-06c8-4e3a-95dc-fb009e4aaac6/homework.md",
"content": "1. Задача 1:\r\n - Создайте список чисел - 4, 8, 7, 10, 2, 9, 11, 5, 8, 0, 5. Выведите его в консоль.\r\n - Удалите из списка все числа, которые делятся нацело на 5. Снова выведите список в консоль.\r\n2. Задача 2:\r\n - Создайте список чисел - 4, 8, 7, 10, 2, 9, 11, 5, 8, 0, 5. Выведите его в консоль.\r\n - Двигаясь по списку, найдите число, которое больше 10.\r\n - Удалите из списка все чётные числа перед этим числом. Снова выведите список в консоль.",
"createdAt": "2025-05-07T18:33:16.106Z",
"updatedAt": "2025-05-07T18:33:16.106Z"
}
],
"course": {
"id": "fa8c410e-65ce-4f89-90da-e752747a8609",
"tenantId": "fe3a8563-435f-4535-95b5-7dc723536d46",
"teacherId": "f9809200-e31f-4225-b9f3-73e7fb406d9a",
"name": "Java",
"createdAt": "2025-05-07T18:33:12.682Z",
"updatedAt": "2025-05-07T18:33:12.682Z"
}
}
],
"nextPage": false,
"prevPage": false,
"total": 4
}
Overview
This endpoint retrieves a paginated list of homework assignments. It supports filtering by teacher, course, and search terms.Authentication
string
required
Authentication header with your tenant’s API key
Query Parameters
integer
default:"10"
The maximum number of assignments to return per page
integer
default:"0"
The number of items to skip before starting to collect results
string
Filter assignments by teacher UUID
string | string[]
Filter assignments by course ID(s)
string
Search term to filter assignments
Response
boolean
Indicates if there’s a previous page of results
boolean
Indicates if there’s a next page of results
array
Array of homework assignment objects
integer
Total number of assignments matching the query
Homework Assignment Object
string
Unique identifier for the homework assignment
string
Tenant identifier
string
ID of the teacher who created the assignment
string
Unique assignment identifier
string
The subject of the homework assignment (if available)
string
ID of the course this homework belongs to
string
Timestamp when the assignment was created
string
Timestamp when the assignment was last updated
array
Array of files associated with the homework assignment
object
Course information related to this homework
File Object
string
Unique identifier for the file
string
ID of the homework this file belongs to
string
Type of the file (e.g., “task”, “solution”, “restriction”)
string
Name of the file
string
Path to the file in storage
string
Content of the file
string
Timestamp when the file was created
string
Timestamp when the file was last updated
Course Object
string
Unique identifier for the course
string
Tenant identifier
string
ID of the teacher who created the course
string
Name of the course
string
Timestamp when the course was created
string
Timestamp when the course was last updated
{
"data": [
{
"id": "3fe84441-06c8-4e3a-95dc-fb009e4aaac6",
"tenantId": "fe3a8563-435f-4535-95b5-7dc723536d46",
"teacherId": "f9809200-e31f-4225-b9f3-73e7fb406d9a",
"assignmentId": "3",
"courseId": "fa8c410e-65ce-4f89-90da-e752747a8609",
"createdAt": "2025-05-07T18:33:16.098Z",
"updatedAt": "2025-05-07T18:33:16.098Z",
"files": [
{
"id": "bc84333d-2c5d-48aa-9391-48dca92c436d",
"homeworkId": "3fe84441-06c8-4e3a-95dc-fb009e4aaac6",
"fileType": "restriction",
"fileName": "restrictions_01(1).md",
"filePath": "fe3a8563-435f-4535-95b5-7dc723536d46/3fe84441-06c8-4e3a-95dc-fb009e4aaac6/restrictions_01(1).md",
"content": "1. Задание должно быть решено при помощи итератора.",
"createdAt": "2025-05-07T18:33:16.106Z",
"updatedAt": "2025-05-07T18:33:16.106Z"
},
{
"id": "ea06e25e-7a75-4ef2-8caf-4a5733ccdba5",
"homeworkId": "3fe84441-06c8-4e3a-95dc-fb009e4aaac6",
"fileType": "solution",
"fileName": "Task1.java",
"filePath": "fe3a8563-435f-4535-95b5-7dc723536d46/3fe84441-06c8-4e3a-95dc-fb009e4aaac6/Task1.java",
"content": "import java.util.ArrayList;\r\nimport java.util.Iterator;\r\nimport java.util.List;\r\n\r\npublic class Task1 {\r\n\r\n public static void main(String[] args) {\r\n\r\n List<Integer> numbers = new ArrayList<>(List.of(4, 8, 7, 10, 2, 9, 11, 5, 8, 0, 5));\r\n\r\n System.out.println(\"Исходный список:\");\r\n System.out.println(numbers);\r\n\r\n Iterator<Integer> iterator = numbers.iterator();\r\n while (iterator.hasNext()) {\r\n if (iterator.next() % 5 == 0) {\r\n iterator.remove();\r\n }\r\n }\r\n\r\n System.out.println(\"Список после удаления:\");\r\n System.out.println(numbers);\r\n }\r\n}\r\n",
"createdAt": "2025-05-07T18:33:16.106Z",
"updatedAt": "2025-05-07T18:33:16.106Z"
},
{
"id": "d046aef0-5811-4b17-852c-8d32a40a0d4e",
"homeworkId": "3fe84441-06c8-4e3a-95dc-fb009e4aaac6",
"fileType": "task",
"fileName": "homework.md",
"filePath": "fe3a8563-435f-4535-95b5-7dc723536d46/3fe84441-06c8-4e3a-95dc-fb009e4aaac6/homework.md",
"content": "1. Задача 1:\r\n - Создайте список чисел - 4, 8, 7, 10, 2, 9, 11, 5, 8, 0, 5. Выведите его в консоль.\r\n - Удалите из списка все числа, которые делятся нацело на 5. Снова выведите список в консоль.\r\n2. Задача 2:\r\n - Создайте список чисел - 4, 8, 7, 10, 2, 9, 11, 5, 8, 0, 5. Выведите его в консоль.\r\n - Двигаясь по списку, найдите число, которое больше 10.\r\n - Удалите из списка все чётные числа перед этим числом. Снова выведите список в консоль.",
"createdAt": "2025-05-07T18:33:16.106Z",
"updatedAt": "2025-05-07T18:33:16.106Z"
}
],
"course": {
"id": "fa8c410e-65ce-4f89-90da-e752747a8609",
"tenantId": "fe3a8563-435f-4535-95b5-7dc723536d46",
"teacherId": "f9809200-e31f-4225-b9f3-73e7fb406d9a",
"name": "Java",
"createdAt": "2025-05-07T18:33:12.682Z",
"updatedAt": "2025-05-07T18:33:12.682Z"
}
}
],
"nextPage": false,
"prevPage": false,
"total": 4
}
Error Responses
400: Bad Request
400: Bad Request
Invalid query parameters
401: Unauthorized
401: Unauthorized
Invalid or missing API key
500: Internal Server Error
500: Internal Server Error
Server error processing the request
Example Usage
cURL
curl -X GET "https://api.lexiconlabs.ai/v1/homeworks?limit=10&offset=0&courseId=course-101" \
-H "x-tenant-api-secret: YOUR_API_KEY"
JavaScript
fetch('https://api.lexiconlabs.ai/v1/homeworks?limit=10&offset=0&courseId=course-101', {
method: 'GET',
headers: {
'x-tenant-api-secret': 'YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => console.error('Error:', error));
⌘I