plan
Add blocks
Takes an array, always — one block or a whole week is the same call, and the batch lands whole or not at all.
A block needs a date and a subject. Everything else says how much of the slot is
decided:
startTime+endTime— a placed block, 09:00 to 10:30.startTime+durationMin— the same thing, said the other way.durationMinalone — 45 minutes on that day, time undecided.- neither — on that day, sometime, however long it takes.
Overlaps come back in conflicts and are never refused. Show the overlap; the student
may mean it.
POST
/
api
/
plan
Add blocks
curl --request POST \
--url https://client-api.lala.ist/api/plan \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"blocks": [
{
"date": "<string>",
"subject": "<string>",
"startTime": "<string>",
"endTime": "<string>",
"durationMin": 362,
"topic": "<string>",
"activity": "<string>",
"targetQuestions": 1000,
"notes": "<string>",
"position": 500
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
blocks: [
{
date: '<string>',
subject: '<string>',
startTime: '<string>',
endTime: '<string>',
durationMin: 362,
topic: '<string>',
activity: '<string>',
targetQuestions: 1000,
notes: '<string>',
position: 500
}
]
})
};
fetch('https://client-api.lala.ist/api/plan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://client-api.lala.ist/api/plan"
payload = { "blocks": [
{
"date": "<string>",
"subject": "<string>",
"startTime": "<string>",
"endTime": "<string>",
"durationMin": 362,
"topic": "<string>",
"activity": "<string>",
"targetQuestions": 1000,
"notes": "<string>",
"position": 500
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"blocks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "<string>",
"startTime": "<string>",
"endTime": "<string>",
"durationMin": 0,
"scheduled": true,
"subject": "<string>",
"topic": "<string>",
"activity": "questions",
"targetQuestions": 0,
"notes": "<string>",
"status": "planned",
"doneQuestions": 0,
"completedAt": "2023-11-07T05:31:56Z",
"createdBy": "student",
"position": 0,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"conflicts": [
{
"blockId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conflictsWith": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
}{
"error": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}Authorizations
Supabase access token: Authorization: Bearer <token>
Body
application/json
Always an array — a whole week is one request, and it lands whole.
Required array length:
1 - 50 elementsShow child attributes
Show child attributes
Add blocks
curl --request POST \
--url https://client-api.lala.ist/api/plan \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"blocks": [
{
"date": "<string>",
"subject": "<string>",
"startTime": "<string>",
"endTime": "<string>",
"durationMin": 362,
"topic": "<string>",
"activity": "<string>",
"targetQuestions": 1000,
"notes": "<string>",
"position": 500
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
blocks: [
{
date: '<string>',
subject: '<string>',
startTime: '<string>',
endTime: '<string>',
durationMin: 362,
topic: '<string>',
activity: '<string>',
targetQuestions: 1000,
notes: '<string>',
position: 500
}
]
})
};
fetch('https://client-api.lala.ist/api/plan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://client-api.lala.ist/api/plan"
payload = { "blocks": [
{
"date": "<string>",
"subject": "<string>",
"startTime": "<string>",
"endTime": "<string>",
"durationMin": 362,
"topic": "<string>",
"activity": "<string>",
"targetQuestions": 1000,
"notes": "<string>",
"position": 500
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"blocks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "<string>",
"startTime": "<string>",
"endTime": "<string>",
"durationMin": 0,
"scheduled": true,
"subject": "<string>",
"topic": "<string>",
"activity": "questions",
"targetQuestions": 0,
"notes": "<string>",
"status": "planned",
"doneQuestions": 0,
"completedAt": "2023-11-07T05:31:56Z",
"createdBy": "student",
"position": 0,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"conflicts": [
{
"blockId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conflictsWith": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
}{
"error": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}