Send your key as a bearer token on every call. Keys start with tut_, belong to a tutor account on an active plan, and reach that account's boards (and, for an organisation, its tutors' boards).
A failed call answers with a status code and one shape of body. Each key may make about 120 requests a minute; after that you get a 429 with a Retry-After header in seconds. Wait that long, then carry on.
เนื้อหาข้อผิดพลาด
{
"error": {
"code": "not_found",
"message": "There is no board with that code on this account."
}
}
สร้างกระดานไวท์บอร์ดและส่งลิงก์กลับมา ส่ง external_id (ID ของคุณสำหรับบทเรียน นักเรียน หรือการจอง) และสามารถเรียกซ้ำได้อย่างปลอดภัย: ID เดิมจะให้บอร์ดเดิมเสมอ
เนื้อหา (JSON)
nameสตริง
ชื่อของบอร์ด สูงสุด 80 ตัวอักษร
external_idสตริง
ID ของคุณสำหรับจุดประสงค์ของบอร์ดนี้ การเรียกซ้ำด้วย ID เดิมจะส่งคืนบอร์ดเดิม
Tutorio will POST each event to your URL as it happens. Leave events out to get all of them. The secret in the answer signs every delivery; it is shown once, here, and never again (not in the list either), so keep it. People's names are left out of what is sent unless you ask for them with include_names: without it each participant comes with their id, your external_id for them, their role and their times, and a recording comes without its list of people and without its summary (which is written about the lesson and can name a child): the event carries "summary_available": true instead, and GET /recordings/{id} has the summary and the transcript.
เนื้อหา (JSON)
urlstringrequired
ปลายทางสำหรับส่งเหตุการณ์ ต้องเป็น https
eventsarray
The event types you want. Empty means all.
include_namesboolean
true sends participants' names, the names of the people in a recording, and a recording's summary. Left out or false, deliveries carry ids, roles and times only. Ask for names only if you need them: the people in a room are mostly children.
Add a URL in Integrations or with POST /webhooks and Tutorio posts each event to it as JSON. Answer with any 2xx within 15 seconds. If you do not, we try again after 5 seconds and after 30. Every attempt is kept in the delivery log for a week, and "Send a test" posts a ping.
Every body has the same envelope: id, type, created (Unix seconds) and data.
People's names are left out unless you ask for them. Each participant comes with an id, the external_id you gave them, a role and their times, which is what the examples below show. Make the webhook with include_names (or turn on "Include names" in Integrations) and each participant also has a name, and a recording a people list.
Each delivery carries a Tutorio-Signature header: t=<unix>,v1=<hex>. The hex is the HMAC-SHA256 of <t>.<body> using your webhook's secret (it starts whsec_ and is shown once, when the webhook is made). Compute the same and compare, and turn away anything more than a few minutes old.
verify.js
const crypto = require('crypto');
// rawBody is the request body exactly as received, before JSON.parse.
function verify(secret, header, rawBody) {
const parts = Object.fromEntries(header.split(',').map((p) => p.trim().split('=')));
const want = crypto.createHmac('sha256', secret)
.update(parts.t + '.' + rawBody)
.digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
return fresh && parts.v1.length === want.length &&
crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(want));
}
verify.py
import hashlib, hmac, time
# raw_body is the request body as bytes, exactly as received.
def verify(secret: str, header: str, raw_body: bytes) -> bool:
parts = dict(p.strip().split("=", 1) for p in header.split(","))
signed = parts["t"].encode() + b"." + raw_body
want = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
fresh = abs(time.time() - int(parts["t"])) < 300
return fresh and hmac.compare_digest(want, parts.get("v1", ""))
ลิงก์เข้าสู่ระบบ
A sign-in link takes one person straight into a board, already named. Make it on your server at the moment they press Join, and redirect them to it.
Participant links work until they expire: a day unless you say, 90 days at most.
Host links sign in as the board's tutor. They work once and last ten minutes.
external_id keeps a person on one Tutorio account each time they come back.
join.js
// When someone presses Join in your product:
app.get('/lessons/:id/join', async (req, res) => {
const lesson = await db.lessons.find(req.params.id);
const user = req.user;
// The same external_id always returns the same board.
const board = await tutorio('POST', '/boards', {
name: lesson.title,
external_id: 'lesson-' + lesson.id,
});
const link = await tutorio('POST', '/boards/' + board.code + '/links', {
role: user.isTutor ? 'host' : 'participant',
name: user.name,
external_id: 'user-' + user.id,
});
res.redirect(link.url);
});
การฝังระบบ
The simplest way in is a Join button anywhere in your product: the board opens as a page of its own, in the same tab or a new one.
Join button
<!-- The board opens as its own page, so cameras and microphones work. -->
<a href="/lessons/4821/join" target="_blank" rel="noopener">Join lesson</a>
ห้องเรียนบนหน้าเว็บของคุณ
To show the live room inside your own lesson page, put it in an iframe. Three things make that work:
Allow your site. The tutor who hosts the boards adds your site's exact address (like https://lessons.example.com) under Integrations, Developers, Embed your whiteboard. Https only, no wildcards, ten sites at most. Every other site is refused by the browser, and so is every other Tutorio page.
Make an embed link. Send "embed": true when you create a sign-in link and use its url as the frame's src. A participant needs an external_id. An embed link only works in a frame: it signs the person in to that one room, never to their Tutorio account.
Pass on the camera. The frame needs the allow attribute below, or the browser blocks the camera, microphone and screen sharing inside it. The room says so when it is missing.
lesson.js
// The lesson page in your product, rendered on your server:
app.get('/lessons/:id', async (req, res) => {
const lesson = await db.lessons.find(req.params.id);
const user = req.user;
const board = await tutorio('POST', '/boards', {
name: lesson.title,
external_id: 'lesson-' + lesson.id,
});
// "embed": true makes a link that only works as the src of a frame.
// Make a fresh one each time the page is rendered.
const link = await tutorio('POST', '/boards/' + board.code + '/links', {
role: user.isTutor ? 'host' : 'participant',
name: user.name,
external_id: 'user-' + user.id,
embed: true,
});
res.render('lesson', { roomSrc: link.url, roomTab: link.fallback_url });
});
lesson.html
<iframe id="room"
src="{{ roomSrc }}"
allow="camera; microphone; display-capture; fullscreen; clipboard-write; autoplay"
allowfullscreen
style="width:100%;height:720px;border:0"
title="Whiteboard"></iframe>
<a href="{{ roomTab }}" target="_blank" rel="noopener">Open in a new tab</a>
<script>
window.addEventListener('message', function (e) {
if (e.origin !== 'https://tutorio.app') return;
if (e.source !== document.getElementById('room').contentWindow) return;
switch (e.data && e.data.type) {
case 'tutorio:ready': break; // the room has loaded
case 'tutorio:joined': break; // e.data.role is "host" or "participant"
case 'tutorio:left': break; // they left the room
case 'tutorio:ended': break; // the host ended the session
case 'tutorio:error': break; // e.data.code says why; render the page again for a fresh link
}
});
</script>
Messages from the frame
tutorio:ready
The room has loaded and is showing its Join screen.
tutorio:joined
They are in the room. role is host or participant.
tutorio:left
They left, or the host removed them.
tutorio:ended
The host ended the session for everyone.
tutorio:error
The frame cannot show the room. code says why: link_expired, no_session, locked, own_account, embed_off, permissions.
What works in the frame The board, tabs, apps and websites, uploads, chat, the call with cameras and screen sharing, and the host's room controls.
What needs a tab of its own Recording, Rio, the invite sheet, cloud files, Print Studio and live lessons. The room has an Open in a new tab button; fallback_url is the same address for your own.
Sessions The frame stays signed in while it is open (two hours without activity, twelve at most) and across reloads. A host link works once, so make a new link every time you render the page. Removing a site from the list signs out every embedded room.
No cookies Nothing depends on third-party cookies.
To go the other way and put your content inside the board, use the Custom Apps SDK below. For a learning platform, LTI 1.3 adds the board to a course with no code.
SDK สำหรับแอปกำหนดเอง
Any https page that allows framing can be an app on the board. Add it under Custom apps in Integrations, load one script, and it is shared by everyone in the room.