curl --request POST \
--url https://api.weve.cx/v1/clubs/{clubId}/lives \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"duration_minutes": 367,
"description": "<string>",
"cover_media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_url": "<string>",
"chat_enabled": true,
"record": true,
"published_at": "2023-11-07T05:31:56Z",
"host_user_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.weve.cx/v1/clubs/{clubId}/lives"
payload = {
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"duration_minutes": 367,
"description": "<string>",
"cover_media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_url": "<string>",
"chat_enabled": True,
"record": True,
"published_at": "2023-11-07T05:31:56Z",
"host_user_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
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({
channel_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: '<string>',
starts_at: '2023-11-07T05:31:56Z',
duration_minutes: 367,
description: '<string>',
cover_media_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
source_url: '<string>',
chat_enabled: true,
record: true,
published_at: '2023-11-07T05:31:56Z',
host_user_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.weve.cx/v1/clubs/{clubId}/lives', 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.weve.cx/v1/clubs/{clubId}/lives",
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([
'channel_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'title' => '<string>',
'starts_at' => '2023-11-07T05:31:56Z',
'duration_minutes' => 367,
'description' => '<string>',
'cover_media_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'source_url' => '<string>',
'chat_enabled' => true,
'record' => true,
'published_at' => '2023-11-07T05:31:56Z',
'host_user_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.weve.cx/v1/clubs/{clubId}/lives"
payload := strings.NewReader("{\n \"channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"duration_minutes\": 367,\n \"description\": \"<string>\",\n \"cover_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_url\": \"<string>\",\n \"chat_enabled\": true,\n \"record\": true,\n \"published_at\": \"2023-11-07T05:31:56Z\",\n \"host_user_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\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.weve.cx/v1/clubs/{clubId}/lives")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"duration_minutes\": 367,\n \"description\": \"<string>\",\n \"cover_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_url\": \"<string>\",\n \"chat_enabled\": true,\n \"record\": true,\n \"published_at\": \"2023-11-07T05:31:56Z\",\n \"host_user_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weve.cx/v1/clubs/{clubId}/lives")
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 \"channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"duration_minutes\": 367,\n \"description\": \"<string>\",\n \"cover_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_url\": \"<string>\",\n \"chat_enabled\": true,\n \"record\": true,\n \"published_at\": \"2023-11-07T05:31:56Z\",\n \"host_user_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"live": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"public_id": "<string>",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_name": "<string>",
"title": "<string>",
"provider": "livekit",
"status": "scheduled",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"chat_enabled": true,
"record": true,
"recording": true,
"hosts": [
{
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"viewers": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"cover": {
"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"
},
"source_url": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"cancel_reason": "<string>",
"replay": {
"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"
}
},
"speakers": [
{
"student_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"since": "2023-11-07T05:31:56Z"
}
],
"recordings": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "requested",
"started_at": "2023-11-07T05:31:56Z",
"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"
},
"size_bytes": 123,
"duration_seconds": 123,
"error": "<string>",
"ended_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>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Marcar live
Marca uma live num canal.
curl --request POST \
--url https://api.weve.cx/v1/clubs/{clubId}/lives \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"duration_minutes": 367,
"description": "<string>",
"cover_media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_url": "<string>",
"chat_enabled": true,
"record": true,
"published_at": "2023-11-07T05:31:56Z",
"host_user_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.weve.cx/v1/clubs/{clubId}/lives"
payload = {
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"duration_minutes": 367,
"description": "<string>",
"cover_media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_url": "<string>",
"chat_enabled": True,
"record": True,
"published_at": "2023-11-07T05:31:56Z",
"host_user_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
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({
channel_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: '<string>',
starts_at: '2023-11-07T05:31:56Z',
duration_minutes: 367,
description: '<string>',
cover_media_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
source_url: '<string>',
chat_enabled: true,
record: true,
published_at: '2023-11-07T05:31:56Z',
host_user_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.weve.cx/v1/clubs/{clubId}/lives', 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.weve.cx/v1/clubs/{clubId}/lives",
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([
'channel_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'title' => '<string>',
'starts_at' => '2023-11-07T05:31:56Z',
'duration_minutes' => 367,
'description' => '<string>',
'cover_media_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'source_url' => '<string>',
'chat_enabled' => true,
'record' => true,
'published_at' => '2023-11-07T05:31:56Z',
'host_user_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.weve.cx/v1/clubs/{clubId}/lives"
payload := strings.NewReader("{\n \"channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"duration_minutes\": 367,\n \"description\": \"<string>\",\n \"cover_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_url\": \"<string>\",\n \"chat_enabled\": true,\n \"record\": true,\n \"published_at\": \"2023-11-07T05:31:56Z\",\n \"host_user_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\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.weve.cx/v1/clubs/{clubId}/lives")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"duration_minutes\": 367,\n \"description\": \"<string>\",\n \"cover_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_url\": \"<string>\",\n \"chat_enabled\": true,\n \"record\": true,\n \"published_at\": \"2023-11-07T05:31:56Z\",\n \"host_user_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weve.cx/v1/clubs/{clubId}/lives")
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 \"channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"duration_minutes\": 367,\n \"description\": \"<string>\",\n \"cover_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_url\": \"<string>\",\n \"chat_enabled\": true,\n \"record\": true,\n \"published_at\": \"2023-11-07T05:31:56Z\",\n \"host_user_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"live": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"public_id": "<string>",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_name": "<string>",
"title": "<string>",
"provider": "livekit",
"status": "scheduled",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"chat_enabled": true,
"record": true,
"recording": true,
"hosts": [
{
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"viewers": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"cover": {
"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"
},
"source_url": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"cancel_reason": "<string>",
"replay": {
"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"
}
},
"speakers": [
{
"student_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"since": "2023-11-07T05:31:56Z"
}
],
"recordings": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "requested",
"started_at": "2023-11-07T05:31:56Z",
"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"
},
"size_bytes": 123,
"duration_seconds": 123,
"error": "<string>",
"ended_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>"
}
}{
"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 - 160Onde a transmissão acontece. livekit é a sala nossa — com palco, chat e
gravação —; youtube e vimeo são tocados por embed no classroom; link
é qualquer outra sala (Zoom, Meet), aberta fora.
livekit, youtube, vimeo, link 15 <= x <= 7204000Obrigatório fora da sala nossa. youtube aceita o link do vídeo, da
live ou do embed (youtube.com/watch?v=, youtu.be/,
youtube.com/live/); vimeo, o do vídeo ou do evento; link,
qualquer https://.
500Só na sala nossa. Padrão ligado.
Só na sala nossa. Padrão ligado.
20Response
A live marcada
Show child attributes
Show child attributes