curl --request POST \
--url https://api.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"body": "<unknown>",
"blocks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"media_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"text": "<string>",
"url": "<string>",
"label": "<string>",
"chapters": [
{
"at_seconds": 1,
"title": "<string>"
}
],
"quiz": {
"passing_score": 50,
"shuffle_questions": true,
"shuffle_options": true,
"show_correct_answers": true,
"required": true
},
"questions": [
{
"text": "<string>",
"options": [
{
"text": "<string>",
"is_correct": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"explanation": "<string>",
"points": 50
}
],
"assignment": {
"accepts_files": true,
"accepts_text": true,
"max_files": 5,
"due_days": 183,
"required": true
},
"question": {
"max_length": 5050,
"required": true,
"allow_edit": true
}
}
],
"thumbnail_media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"downloadable": true,
"duration_seconds": 1,
"published_at": "2023-11-07T05:31:56Z",
"comments_enabled": true
}
'import requests
url = "https://api.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons"
payload = {
"title": "<string>",
"description": "<string>",
"body": "<unknown>",
"blocks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"media_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"text": "<string>",
"url": "<string>",
"label": "<string>",
"chapters": [
{
"at_seconds": 1,
"title": "<string>"
}
],
"quiz": {
"passing_score": 50,
"shuffle_questions": True,
"shuffle_options": True,
"show_correct_answers": True,
"required": True
},
"questions": [
{
"text": "<string>",
"options": [
{
"text": "<string>",
"is_correct": True,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"explanation": "<string>",
"points": 50
}
],
"assignment": {
"accepts_files": True,
"accepts_text": True,
"max_files": 5,
"due_days": 183,
"required": True
},
"question": {
"max_length": 5050,
"required": True,
"allow_edit": True
}
}
],
"thumbnail_media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"downloadable": True,
"duration_seconds": 1,
"published_at": "2023-11-07T05:31:56Z",
"comments_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
body: JSON.stringify('<unknown>'),
blocks: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
media_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
media_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
text: '<string>',
url: '<string>',
label: '<string>',
chapters: [{at_seconds: 1, title: '<string>'}],
quiz: {
passing_score: 50,
shuffle_questions: true,
shuffle_options: true,
show_correct_answers: true,
required: true
},
questions: [
{
text: '<string>',
options: [
{text: '<string>', is_correct: true, id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}
],
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
explanation: '<string>',
points: 50
}
],
assignment: {
accepts_files: true,
accepts_text: true,
max_files: 5,
due_days: 183,
required: true
},
question: {max_length: 5050, required: true, allow_edit: true}
}
],
thumbnail_media_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
downloadable: true,
duration_seconds: 1,
published_at: '2023-11-07T05:31:56Z',
comments_enabled: true
})
};
fetch('https://api.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons', 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.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'description' => '<string>',
'body' => '<unknown>',
'blocks' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'media_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'media_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'text' => '<string>',
'url' => '<string>',
'label' => '<string>',
'chapters' => [
[
'at_seconds' => 1,
'title' => '<string>'
]
],
'quiz' => [
'passing_score' => 50,
'shuffle_questions' => true,
'shuffle_options' => true,
'show_correct_answers' => true,
'required' => true
],
'questions' => [
[
'text' => '<string>',
'options' => [
[
'text' => '<string>',
'is_correct' => true,
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'explanation' => '<string>',
'points' => 50
]
],
'assignment' => [
'accepts_files' => true,
'accepts_text' => true,
'max_files' => 5,
'due_days' => 183,
'required' => true
],
'question' => [
'max_length' => 5050,
'required' => true,
'allow_edit' => true
]
]
],
'thumbnail_media_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'downloadable' => true,
'duration_seconds' => 1,
'published_at' => '2023-11-07T05:31:56Z',
'comments_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"body\": \"<unknown>\",\n \"blocks\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"media_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"label\": \"<string>\",\n \"chapters\": [\n {\n \"at_seconds\": 1,\n \"title\": \"<string>\"\n }\n ],\n \"quiz\": {\n \"passing_score\": 50,\n \"shuffle_questions\": true,\n \"shuffle_options\": true,\n \"show_correct_answers\": true,\n \"required\": true\n },\n \"questions\": [\n {\n \"text\": \"<string>\",\n \"options\": [\n {\n \"text\": \"<string>\",\n \"is_correct\": true,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"explanation\": \"<string>\",\n \"points\": 50\n }\n ],\n \"assignment\": {\n \"accepts_files\": true,\n \"accepts_text\": true,\n \"max_files\": 5,\n \"due_days\": 183,\n \"required\": true\n },\n \"question\": {\n \"max_length\": 5050,\n \"required\": true,\n \"allow_edit\": true\n }\n }\n ],\n \"thumbnail_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"downloadable\": true,\n \"duration_seconds\": 1,\n \"published_at\": \"2023-11-07T05:31:56Z\",\n \"comments_enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"body\": \"<unknown>\",\n \"blocks\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"media_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"label\": \"<string>\",\n \"chapters\": [\n {\n \"at_seconds\": 1,\n \"title\": \"<string>\"\n }\n ],\n \"quiz\": {\n \"passing_score\": 50,\n \"shuffle_questions\": true,\n \"shuffle_options\": true,\n \"show_correct_answers\": true,\n \"required\": true\n },\n \"questions\": [\n {\n \"text\": \"<string>\",\n \"options\": [\n {\n \"text\": \"<string>\",\n \"is_correct\": true,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"explanation\": \"<string>\",\n \"points\": 50\n }\n ],\n \"assignment\": {\n \"accepts_files\": true,\n \"accepts_text\": true,\n \"max_files\": 5,\n \"due_days\": 183,\n \"required\": true\n },\n \"question\": {\n \"max_length\": 5050,\n \"required\": true,\n \"allow_edit\": true\n }\n }\n ],\n \"thumbnail_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"downloadable\": true,\n \"duration_seconds\": 1,\n \"published_at\": \"2023-11-07T05:31:56Z\",\n \"comments_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"body\": \"<unknown>\",\n \"blocks\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"media_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"label\": \"<string>\",\n \"chapters\": [\n {\n \"at_seconds\": 1,\n \"title\": \"<string>\"\n }\n ],\n \"quiz\": {\n \"passing_score\": 50,\n \"shuffle_questions\": true,\n \"shuffle_options\": true,\n \"show_correct_answers\": true,\n \"required\": true\n },\n \"questions\": [\n {\n \"text\": \"<string>\",\n \"options\": [\n {\n \"text\": \"<string>\",\n \"is_correct\": true,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"explanation\": \"<string>\",\n \"points\": 50\n }\n ],\n \"assignment\": {\n \"accepts_files\": true,\n \"accepts_text\": true,\n \"max_files\": 5,\n \"due_days\": 183,\n \"required\": true\n },\n \"question\": {\n \"max_length\": 5050,\n \"required\": true,\n \"allow_edit\": true\n }\n }\n ],\n \"thumbnail_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"downloadable\": true,\n \"duration_seconds\": 1,\n \"published_at\": \"2023-11-07T05:31:56Z\",\n \"comments_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"module_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"public_id": "<string>",
"type": "video",
"blocks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "video",
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "video",
"title": "<string>",
"provider": "bunny_stream",
"status": "uploading",
"visibility": "private",
"archived": true,
"created_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"mime": "<string>",
"size_bytes": 123,
"external_id": "<string>",
"error": "<string>",
"duration_seconds": 123,
"width": 123,
"height": 123,
"preview_url": "<string>",
"thumbnail_url": "<string>",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "video",
"download_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"favorite": true,
"usage_count": 123
},
"files": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "video",
"title": "<string>",
"provider": "bunny_stream",
"status": "uploading",
"visibility": "private",
"archived": true,
"created_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"mime": "<string>",
"size_bytes": 123,
"external_id": "<string>",
"error": "<string>",
"duration_seconds": 123,
"width": 123,
"height": 123,
"preview_url": "<string>",
"thumbnail_url": "<string>",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "video",
"download_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"favorite": true,
"usage_count": 123
}
],
"text": "<string>",
"url": "<string>",
"label": "<string>",
"chapters": [
{
"at_seconds": 1,
"title": "<string>"
}
],
"quiz": {
"passing_score": 50,
"shuffle_questions": true,
"shuffle_options": true,
"show_correct_answers": true,
"required": true,
"requirement": "completed"
},
"questions": [
{
"text": "<string>",
"options": [
{
"text": "<string>",
"is_correct": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "single_choice",
"explanation": "<string>",
"points": 50
}
],
"assignment": {
"accepts_files": true,
"accepts_text": true,
"max_files": 5,
"due_days": 183,
"required": true
},
"question": {
"max_length": 5050,
"required": true,
"allow_edit": true
}
}
],
"downloadable": true,
"position": 123,
"archived": true,
"release": {
"kind": "all",
"children": "<array>",
"days": 1825,
"at": "2023-11-07T05:31:56Z",
"lesson_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"module_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"count": 2,
"label": "<string>"
},
"comments_enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"body": "<unknown>",
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "video",
"title": "<string>",
"provider": "bunny_stream",
"status": "uploading",
"visibility": "private",
"archived": true,
"created_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"mime": "<string>",
"size_bytes": 123,
"external_id": "<string>",
"error": "<string>",
"duration_seconds": 123,
"width": 123,
"height": 123,
"preview_url": "<string>",
"thumbnail_url": "<string>",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "video",
"download_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"favorite": true,
"usage_count": 123
},
"attachments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "video",
"title": "<string>",
"provider": "bunny_stream",
"status": "uploading",
"visibility": "private",
"archived": true,
"created_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"mime": "<string>",
"size_bytes": 123,
"external_id": "<string>",
"error": "<string>",
"duration_seconds": 123,
"width": 123,
"height": 123,
"preview_url": "<string>",
"thumbnail_url": "<string>",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "video",
"download_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"favorite": true,
"usage_count": 123
}
],
"thumbnail": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "video",
"title": "<string>",
"provider": "bunny_stream",
"status": "uploading",
"visibility": "private",
"archived": true,
"created_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"mime": "<string>",
"size_bytes": 123,
"external_id": "<string>",
"error": "<string>",
"duration_seconds": 123,
"width": 123,
"height": 123,
"preview_url": "<string>",
"thumbnail_url": "<string>",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "video",
"download_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"favorite": true,
"usage_count": 123
},
"duration_seconds": 123,
"published_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Criar aula
No fim do módulo, com a liberação.
curl --request POST \
--url https://api.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"body": "<unknown>",
"blocks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"media_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"text": "<string>",
"url": "<string>",
"label": "<string>",
"chapters": [
{
"at_seconds": 1,
"title": "<string>"
}
],
"quiz": {
"passing_score": 50,
"shuffle_questions": true,
"shuffle_options": true,
"show_correct_answers": true,
"required": true
},
"questions": [
{
"text": "<string>",
"options": [
{
"text": "<string>",
"is_correct": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"explanation": "<string>",
"points": 50
}
],
"assignment": {
"accepts_files": true,
"accepts_text": true,
"max_files": 5,
"due_days": 183,
"required": true
},
"question": {
"max_length": 5050,
"required": true,
"allow_edit": true
}
}
],
"thumbnail_media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"downloadable": true,
"duration_seconds": 1,
"published_at": "2023-11-07T05:31:56Z",
"comments_enabled": true
}
'import requests
url = "https://api.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons"
payload = {
"title": "<string>",
"description": "<string>",
"body": "<unknown>",
"blocks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"media_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"text": "<string>",
"url": "<string>",
"label": "<string>",
"chapters": [
{
"at_seconds": 1,
"title": "<string>"
}
],
"quiz": {
"passing_score": 50,
"shuffle_questions": True,
"shuffle_options": True,
"show_correct_answers": True,
"required": True
},
"questions": [
{
"text": "<string>",
"options": [
{
"text": "<string>",
"is_correct": True,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"explanation": "<string>",
"points": 50
}
],
"assignment": {
"accepts_files": True,
"accepts_text": True,
"max_files": 5,
"due_days": 183,
"required": True
},
"question": {
"max_length": 5050,
"required": True,
"allow_edit": True
}
}
],
"thumbnail_media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"downloadable": True,
"duration_seconds": 1,
"published_at": "2023-11-07T05:31:56Z",
"comments_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
body: JSON.stringify('<unknown>'),
blocks: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
media_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
media_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
text: '<string>',
url: '<string>',
label: '<string>',
chapters: [{at_seconds: 1, title: '<string>'}],
quiz: {
passing_score: 50,
shuffle_questions: true,
shuffle_options: true,
show_correct_answers: true,
required: true
},
questions: [
{
text: '<string>',
options: [
{text: '<string>', is_correct: true, id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}
],
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
explanation: '<string>',
points: 50
}
],
assignment: {
accepts_files: true,
accepts_text: true,
max_files: 5,
due_days: 183,
required: true
},
question: {max_length: 5050, required: true, allow_edit: true}
}
],
thumbnail_media_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
downloadable: true,
duration_seconds: 1,
published_at: '2023-11-07T05:31:56Z',
comments_enabled: true
})
};
fetch('https://api.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons', 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.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'description' => '<string>',
'body' => '<unknown>',
'blocks' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'media_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'media_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'text' => '<string>',
'url' => '<string>',
'label' => '<string>',
'chapters' => [
[
'at_seconds' => 1,
'title' => '<string>'
]
],
'quiz' => [
'passing_score' => 50,
'shuffle_questions' => true,
'shuffle_options' => true,
'show_correct_answers' => true,
'required' => true
],
'questions' => [
[
'text' => '<string>',
'options' => [
[
'text' => '<string>',
'is_correct' => true,
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'explanation' => '<string>',
'points' => 50
]
],
'assignment' => [
'accepts_files' => true,
'accepts_text' => true,
'max_files' => 5,
'due_days' => 183,
'required' => true
],
'question' => [
'max_length' => 5050,
'required' => true,
'allow_edit' => true
]
]
],
'thumbnail_media_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'downloadable' => true,
'duration_seconds' => 1,
'published_at' => '2023-11-07T05:31:56Z',
'comments_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"body\": \"<unknown>\",\n \"blocks\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"media_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"label\": \"<string>\",\n \"chapters\": [\n {\n \"at_seconds\": 1,\n \"title\": \"<string>\"\n }\n ],\n \"quiz\": {\n \"passing_score\": 50,\n \"shuffle_questions\": true,\n \"shuffle_options\": true,\n \"show_correct_answers\": true,\n \"required\": true\n },\n \"questions\": [\n {\n \"text\": \"<string>\",\n \"options\": [\n {\n \"text\": \"<string>\",\n \"is_correct\": true,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"explanation\": \"<string>\",\n \"points\": 50\n }\n ],\n \"assignment\": {\n \"accepts_files\": true,\n \"accepts_text\": true,\n \"max_files\": 5,\n \"due_days\": 183,\n \"required\": true\n },\n \"question\": {\n \"max_length\": 5050,\n \"required\": true,\n \"allow_edit\": true\n }\n }\n ],\n \"thumbnail_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"downloadable\": true,\n \"duration_seconds\": 1,\n \"published_at\": \"2023-11-07T05:31:56Z\",\n \"comments_enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"body\": \"<unknown>\",\n \"blocks\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"media_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"label\": \"<string>\",\n \"chapters\": [\n {\n \"at_seconds\": 1,\n \"title\": \"<string>\"\n }\n ],\n \"quiz\": {\n \"passing_score\": 50,\n \"shuffle_questions\": true,\n \"shuffle_options\": true,\n \"show_correct_answers\": true,\n \"required\": true\n },\n \"questions\": [\n {\n \"text\": \"<string>\",\n \"options\": [\n {\n \"text\": \"<string>\",\n \"is_correct\": true,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"explanation\": \"<string>\",\n \"points\": 50\n }\n ],\n \"assignment\": {\n \"accepts_files\": true,\n \"accepts_text\": true,\n \"max_files\": 5,\n \"due_days\": 183,\n \"required\": true\n },\n \"question\": {\n \"max_length\": 5050,\n \"required\": true,\n \"allow_edit\": true\n }\n }\n ],\n \"thumbnail_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"downloadable\": true,\n \"duration_seconds\": 1,\n \"published_at\": \"2023-11-07T05:31:56Z\",\n \"comments_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useweve.com/v1/clubs/{clubId}/modules/{moduleId}/lessons")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"body\": \"<unknown>\",\n \"blocks\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"media_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"label\": \"<string>\",\n \"chapters\": [\n {\n \"at_seconds\": 1,\n \"title\": \"<string>\"\n }\n ],\n \"quiz\": {\n \"passing_score\": 50,\n \"shuffle_questions\": true,\n \"shuffle_options\": true,\n \"show_correct_answers\": true,\n \"required\": true\n },\n \"questions\": [\n {\n \"text\": \"<string>\",\n \"options\": [\n {\n \"text\": \"<string>\",\n \"is_correct\": true,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"explanation\": \"<string>\",\n \"points\": 50\n }\n ],\n \"assignment\": {\n \"accepts_files\": true,\n \"accepts_text\": true,\n \"max_files\": 5,\n \"due_days\": 183,\n \"required\": true\n },\n \"question\": {\n \"max_length\": 5050,\n \"required\": true,\n \"allow_edit\": true\n }\n }\n ],\n \"thumbnail_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"downloadable\": true,\n \"duration_seconds\": 1,\n \"published_at\": \"2023-11-07T05:31:56Z\",\n \"comments_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"module_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"public_id": "<string>",
"type": "video",
"blocks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "video",
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "video",
"title": "<string>",
"provider": "bunny_stream",
"status": "uploading",
"visibility": "private",
"archived": true,
"created_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"mime": "<string>",
"size_bytes": 123,
"external_id": "<string>",
"error": "<string>",
"duration_seconds": 123,
"width": 123,
"height": 123,
"preview_url": "<string>",
"thumbnail_url": "<string>",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "video",
"download_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"favorite": true,
"usage_count": 123
},
"files": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "video",
"title": "<string>",
"provider": "bunny_stream",
"status": "uploading",
"visibility": "private",
"archived": true,
"created_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"mime": "<string>",
"size_bytes": 123,
"external_id": "<string>",
"error": "<string>",
"duration_seconds": 123,
"width": 123,
"height": 123,
"preview_url": "<string>",
"thumbnail_url": "<string>",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "video",
"download_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"favorite": true,
"usage_count": 123
}
],
"text": "<string>",
"url": "<string>",
"label": "<string>",
"chapters": [
{
"at_seconds": 1,
"title": "<string>"
}
],
"quiz": {
"passing_score": 50,
"shuffle_questions": true,
"shuffle_options": true,
"show_correct_answers": true,
"required": true,
"requirement": "completed"
},
"questions": [
{
"text": "<string>",
"options": [
{
"text": "<string>",
"is_correct": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "single_choice",
"explanation": "<string>",
"points": 50
}
],
"assignment": {
"accepts_files": true,
"accepts_text": true,
"max_files": 5,
"due_days": 183,
"required": true
},
"question": {
"max_length": 5050,
"required": true,
"allow_edit": true
}
}
],
"downloadable": true,
"position": 123,
"archived": true,
"release": {
"kind": "all",
"children": "<array>",
"days": 1825,
"at": "2023-11-07T05:31:56Z",
"lesson_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"module_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"count": 2,
"label": "<string>"
},
"comments_enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"body": "<unknown>",
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "video",
"title": "<string>",
"provider": "bunny_stream",
"status": "uploading",
"visibility": "private",
"archived": true,
"created_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"mime": "<string>",
"size_bytes": 123,
"external_id": "<string>",
"error": "<string>",
"duration_seconds": 123,
"width": 123,
"height": 123,
"preview_url": "<string>",
"thumbnail_url": "<string>",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "video",
"download_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"favorite": true,
"usage_count": 123
},
"attachments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "video",
"title": "<string>",
"provider": "bunny_stream",
"status": "uploading",
"visibility": "private",
"archived": true,
"created_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"mime": "<string>",
"size_bytes": 123,
"external_id": "<string>",
"error": "<string>",
"duration_seconds": 123,
"width": 123,
"height": 123,
"preview_url": "<string>",
"thumbnail_url": "<string>",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "video",
"download_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"favorite": true,
"usage_count": 123
}
],
"thumbnail": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "video",
"title": "<string>",
"provider": "bunny_stream",
"status": "uploading",
"visibility": "private",
"archived": true,
"created_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"mime": "<string>",
"size_bytes": 123,
"external_id": "<string>",
"error": "<string>",
"duration_seconds": 123,
"width": 123,
"height": 123,
"preview_url": "<string>",
"thumbnail_url": "<string>",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "video",
"download_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"favorite": true,
"usage_count": 123
},
"duration_seconds": 123,
"published_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Token OPACO de sessão de quem administra, emitido por
/v1/auth/admin/sign-in e verificado contra a nossa tabela — o mesmo
desenho do studentSession, para a outra identidade.
É o esquema de quem ADMINISTRA — o dashboard. O aluno do classroom usa o
studentSession; uma rota consumida pelos dois declara os dois
esquemas, e o middleware aceita qualquer um deles. As duas credenciais
são opacas e chegam pelo mesmo cabeçalho: quem as separa é a tabela em
que cada uma existe.
O dashboard o guarda em cookie httpOnly, que o BFF troca pelo
Authorization a cada chamada.
Path Parameters
Id público da organização — o mesmo que GET /v1/me devolve em
organization_id.
Na URL o recurso se chama club; no contrato e no domínio, organization.
A divergência é deliberada: clubs é a palavra do produto, e a URL é o que
as pessoas leem.
É o identificador do provedor de autenticação, e é assim de propósito: o cliente precisa nomear a organização ao pedir o token, e o token é o que prova o escopo. Um id só nosso obrigaria a traduzir um no outro antes de ter um token — e a tradução exigiria uma chamada escopada, que é justamente a que ainda não dá para fazer.
O uuid interno da organização não aparece no contrato: ele é o que as chaves estrangeiras do domínio referenciam, e continua sendo nosso.
Body
1 - 200video, text, audio, file 5000O documento do editor, opaco para a API.
O conteúdo da aula, na ordem. A mídia que a aula toca, os materiais
e o type saem daqui — o type enviado só vale quando a aula não
tem bloco de mídia.
100Show child attributes
Show child attributes
A miniatura, da biblioteca do club.
Se o aluno pode baixar os materiais. Ausente é sim.
x >= 0A agenda de liberação, como EXPRESSÃO: quando a aula (ou o módulo) abre para quem já tem direito a ela. Nunca amplia direito — só segura o que a matrícula já deu.
Cada condição responde com uma DATA, não com sim ou não, e é por isso
que elas compõem sem ambiguidade: all é a maior das datas, any é a
menor. Condição que depende de algo que o aluno ainda não fez não tem
data: dentro de all ela segura tudo, dentro de any ela é só um
caminho que ainda não abriu.
As folhas são todas MONÓTONAS — uma vez verdadeiras, verdadeiras para sempre:
immediate: sem condição.days_after_start:daysdias depois de o acesso começar (a matrícula mais antiga que abre o curso, ou o início da turma).on_date: na dataat.after_previous: depois de concluir a aula anterior na ordem do curso. Na primeira aula, libera.after_lesson: depois de concluir a aulalesson_id, do mesmo curso.after_module: depois de concluir todas as aulas demodule_id.after_count: depois de concluircountaulas do curso.
days atrasa o que o nó decidiu ("7 dias depois de concluir o módulo
1") e vale em qualquer nó, menos em immediate.
Quem tem direito é pergunta de matrícula, não de agenda: não há condição de turma, de etiqueta nem de perfil aqui, de propósito — elas podem deixar de valer, e acesso que oscila é acesso que ninguém sabe explicar.
A aula referenciada que sai do curso (arquivada, despublicada) deixa de segurar: esperar por uma conclusão que não pode mais acontecer trancaria o curso para sempre.
Show child attributes
Show child attributes
A conversa embaixo desta aula. O curso também tem a chave, e as duas precisam estar ligadas para o aluno poder escrever.
Response
Aula criada
Show child attributes
Show child attributes