Lumundag sa nilalaman
Tutorio Magsimula nang libre
Mga Developer

Bumuo gamit ang Tutorio API.

Gumawa ng whiteboards, mag-sign in, at basahin ang attendance, recordings, at transcripts.

https://tutorio.app/api/v1 openapi.json

Pagsisimula

Ang API ay plain JSON sa pagitan ng HTTPS. Tatlong hakbang lang para magsimula.

  1. 1

    Gumawa ng key

    Buksan ang Integrations sa iyong Tutorio account at gumawa ng API key. Minsan lamang ito ipapakita, kaya kopyahin ito sa ligtas na lugar.

  2. 2

    I-test kung gumagana

    Tawagin ang GET /me. Sasagutin ito ng account kung saan nakareserba ang key.

  3. 3

    Gumawa ng board

    Tawagin ang POST /boards, pagkatapos ay gumawa ng sign-in link para sa bawat tao.

Suriin ang key
curl https://tutorio.app/api/v1/me \
  -H "Authorization: Bearer tut_your_key"

Authentication

Ipadala ang iyong key bilang bearer token sa bawat tawag. Nagsisimula ang mga key sa tut_, nakakabit sa isang tutor account na may aktibong plan, at naaabot ang mga board ng account na iyon (at para sa organisasyon, ang mga board ng mga tutor nito).

Header
Authorization: Bearer tut_your_key

Panatilihin ang mga key sa iyong server. Huwag kailanman ilagay ang mga ito sa web page o app.

Mga error at limitasyon

Ang nabigong tawag ay sumasagot ng status code at isang hugis ng katawan. Ang bawat key ay maaaring gumawa ng humigit-kumulang 120 na mga request kada minuto; pagkatapos nito ay makatatanggap ka ng 429 na may Retry-After header sa loob ng ilang segundo. Maghintay nang ganoong katagal bago magpatuloy.

Error body
{
  "error": {
    "code": "not_found",
    "message": "There is no board with that code on this account."
  }
}
Mga error code
bad_json400Ang body ay hindi wastong JSON.
invalid_request400May nawawalang field o hindi pinapayagan. Sinasabi ng mensahe kung alin.
missing_key401Walang key na ipinadala sa Authorization header.
invalid_key401Mali ang key o kaya ay na-delete na.
plan_required402Hindi aktibo ang Tutorio plan ng account.
not_a_tutor403Ang key ay pagmamay-ari ng account na hindi tutor.
not_found404Walang nahanap na may ganyang code o id sa account na ito.
rate_limited429Higit sa 120 na request kada minuto. Maghintay para sa Retry-After.
server_error500Amo ang nagkamali. Subukang muli.

Account

Suriin ang key

GET/api/v1/me

Sinasabi kung kanino kabilang ang key. Gamitin ito para subukan ang koneksyon.

Request
curl https://tutorio.app/api/v1/me \
  -H "Authorization: Bearer tut_your_key"
Sagot · 200
{
  "id": "6f1c…",
  "name": "Maya Patel",
  "email": "maya@example.com",
  "key": {
    "id": "key_x7Kp2mQ9aB4cDe",
    "name": "Booking site"
  }
}

Mga board

Gumawa ng board

POST/api/v1/boards

Gumagawa ng whiteboard at nagbibigay ng link nito. Ipadala ang external_id (ang iyong sariling id para sa lesson, student o booking) at ligtas itong ulitin: ang parehong id ay laging nagbibigay ng parehong board.

Body (JSON)
name string Ang tawag sa board. Hanggang 80 na mga character.
external_id string Ang iyong id para sa layunin ng board na ito. Ang paghingi muli nito ay nagbabalik ng parehong board.
host_email string Ibigay ang board sa isang tutor sa iyong organisasyon sa halip na sa iyo.
Request
curl -X POST https://tutorio.app/api/v1/boards \
  -H "Authorization: Bearer tut_your_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "Maya · Year 9 Maths", "external_id": "lesson-4821"}'
Sagot · 201
{
  "code": "qm7-kx2p-vdr",
  "name": "Maya · Year 9 Maths",
  "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr",
  "external_id": "lesson-4821",
  "created": true,
  "created_at": "2026-01-12T09:30:00Z",
  "host_id": "6f1c…",
  "people_in_room": 0
}

Ilista ang mga board

GET/api/v1/boards

Ang iyong mga board, unahin ang pinakabagong binuksan.

Query
limit integer Ilan ang ibabalik. 50 maliban kung iba ang sabihin mo, 200 ang pinakamarami.
external_id string Ang board lang na ginawa para sa id na ito.
name string Mga board lang na naglalaman ang pangalan ng tekstong ito.
Request
curl https://tutorio.app/api/v1/boards \
  -H "Authorization: Bearer tut_your_key"
Sagot · 200
{
  "boards": [
    {
      "code": "qm7-kx2p-vdr",
      "name": "Maya · Year 9 Maths",
      "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr",
      "people_in_room": 2
    }
  ]
}

Kunin ang board

GET/api/v1/boards/{code}

Isang board, kasama kung ilang tao ang nasa loob nito ngayon.

Path
code string requiredAng code ng board: ang huling bahagi ng link nito.
Request
curl https://tutorio.app/api/v1/boards/qm7-kx2p-vdr \
  -H "Authorization: Bearer tut_your_key"
Sagot · 200
{
  "code": "qm7-kx2p-vdr",
  "name": "Maya · Year 9 Maths",
  "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr",
  "people_in_room": 2
}

Palitan ang pangalan

PATCH/api/v1/boards/{code}

Path
code string requiredAng code ng board: ang huling bahagi ng link nito.
Body (JSON)
name string Ang bagong pangalan.
Request
curl -X PATCH https://tutorio.app/api/v1/boards/qm7-kx2p-vdr \
  -H "Authorization: Bearer tut_your_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "Maya · Year 10 Maths"}'
Sagot · 200
{
  "code": "qm7-kx2p-vdr",
  "name": "Maya · Year 10 Maths",
  "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr"
}

I-delete ang board

DELETE/api/v1/boards/{code}

Binubura ang board, lahat ng laman nito at mga na-upload. Hindi na ito maibabalik.

Path
code string requiredAng code ng board: ang huling bahagi ng link nito.
Request
curl -X DELETE https://tutorio.app/api/v1/boards/qm7-kx2p-vdr \
  -H "Authorization: Bearer tut_your_key"
Sagot · 200
{
  "deleted": true,
  "code": "qm7-kx2p-vdr"
}

Gumawa ng sign-in link

POST/api/v1/boards/{code}/links

Isang link na direktang nagpapasok sa tao sa board, naka-sign in na. Ilagay ito sa likod ng iyong sariling Join button. Gumagana ang participant link hanggang sa mag-expire ito; magpadala ng external_id para palaging bumalik ang taong iyon sa parehong Tutorio account. Ang host link ay nag-sign in bilang tutor ng board: minsan lang gumagana at tumatagal ng sampung minuto, kaya gawin ito sa sandaling i-click nila.

Path
code string requiredAng code ng board: ang huling bahagi ng link nito.
Body (JSON)
role string "participant" (ang default) o "host".
name string Ang pangalang ipinapakita ng silid. Kailangan para sa participant.
external_id string Ang iyong id para sa taong ito, para iisa ang kanilang account.
email string Ang kanilang email, kung mayroon ka. Para lang sa iyong mga rekord.
expires_in integer Mga segundo bago tumigil sa paggana ang link. Ang participant link ay tumatagal ng isang araw maliban kung sabihin mo, 90 na araw ang pinakamarami; ang host link ay sampung minuto, isang oras ang pinakamarami.
embed boolean Ang true ay gumagawa ng link para sa isang iframe sa sarili mong pahina sa halip: ang url ang src ng frame, at ang fallback_url ang board bilang sarili nitong pahina. Dapat pinayagan ng tutor ng board ang iyong site sa ilalim ng Integrations, at kailangan ng participant ng external_id. Ang embed link ay nag-sign in sa iisang silid na iyon lang at gumagana kahit saan maliban sa loob ng frame. Tingnan ang Embedding.
Request
curl -X POST https://tutorio.app/api/v1/boards/qm7-kx2p-vdr/links \
  -H "Authorization: Bearer tut_your_key" \
  -H "Content-Type: application/json" \
  -d '{"role": "participant", "name": "Maya Patel", "external_id": "student-193"}'
Sagot · 201
{
  "url": "https://tutorio.app/whiteboard/go/Hq3…",
  "role": "participant",
  "expires_at": "2026-01-13T09:30:00Z",
  "single_use": false
}

Attendance

Mga session ng board

GET/api/v1/boards/{code}/sessions

Bawat beses na ginamit ang board: kung sino ang pumunta, kailan, at kung gaano katagal.

Path
code string requiredAng code ng board: ang huling bahagi ng link nito.
Query
limit integer Ilan ang ibabalik. 50 maliban kung iba ang sabihin mo, 200 ang pinakamarami.
Request
curl https://tutorio.app/api/v1/boards/qm7-kx2p-vdr/sessions \
  -H "Authorization: Bearer tut_your_key"
Sagot · 200
{
  "sessions": [
    {
      "id": "ses_p4Vn81LkQe2zXa",
      "started_at": "2026-01-12T16:00:04Z",
      "ended_at": "2026-01-12T16:58:41Z",
      "live": false,
      "duration_seconds": 3517,
      "participants": [
        {
          "id": "6f1c…",
          "name": "Mr Okafor",
          "role": "host",
          "joined_at": "2026-01-12T16:00:04Z",
          "left_at": "2026-01-12T16:58:41Z",
          "duration_seconds": 3517,
          "visits": 1
        },
        {
          "id": "a20b…",
          "name": "Maya Patel",
          "role": "participant",
          "external_id": "student-193",
          "joined_at": "2026-01-12T16:01:30Z",
          "left_at": "2026-01-12T16:58:02Z",
          "duration_seconds": 3392,
          "visits": 2
        }
      ]
    }
  ]
}

Lahat ng session

GET/api/v1/sessions

Mga session sa bawat board, pinakabago muna.

Query
since string Mga session lang na nagsimula sa o pagkatapos ng oras na ito (RFC 3339).
limit integer Ilan ang ibabalik. 50 maliban kung iba ang sabihin mo, 200 ang pinakamarami.
Request
curl https://tutorio.app/api/v1/sessions \
  -H "Authorization: Bearer tut_your_key"
Sagot · 200
{
  "sessions": []
}

Kunin ang session

GET/api/v1/sessions/{id}

Path
id string requiredAng id ng session, tulad ng ses_p4Vn81LkQe2zXa.
Request
curl https://tutorio.app/api/v1/sessions/ses_p4Vn81LkQe2zXa \
  -H "Authorization: Bearer tut_your_key"
Sagot · 200
{
  "id": "ses_p4Vn81LkQe2zXa",
  "live": true,
  "started_at": "2026-01-12T16:00:04Z",
  "ended_at": null,
  "participants": []
}

Mga recording

Ilista ang recording

GET/api/v1/recordings

Finished recordings, newest first. Use /boards/{code}/recordings for one board.

Query
limit integer Ilan ang ibabalik. 50 maliban kung iba ang sabihin mo, 200 ang pinakamarami.
Request
curl https://tutorio.app/api/v1/recordings \
  -H "Authorization: Bearer tut_your_key"
Sagot · 200
{
  "recordings": [
    {
      "id": "3b9f0c2e7a1d4e68",
      "status": "done",
      "started_at": "2026-01-12T16:00:10Z",
      "duration_seconds": 3490,
      "people": [
        "Mr Okafor",
        "Maya Patel"
      ],
      "media_url": "https://tutorio.app/api/v1/recordings/3b9f0c2e7a1d4e68/media",
      "has_transcript": true
    }
  ]
}

Kunin ang recording

GET/api/v1/recordings/{id}

Ang recording kasama ang buod at buong transcript nito, kapag naisulat na ang mga ito (status "done").

Path
id string requiredAng id ng recording.
Request
curl https://tutorio.app/api/v1/recordings/3b9f0c2e7a1d4e68 \
  -H "Authorization: Bearer tut_your_key"
Sagot · 200
{
  "id": "3b9f0c2e7a1d4e68",
  "status": "done",
  "summary": {
    "title": "Solving linear equations",
    "overview": "Maya worked through…",
    "covered": [
      "Balancing both sides"
    ],
    "went_well": [
      "Checked every answer"
    ],
    "work_on": [
      "Negative coefficients"
    ],
    "next_steps": [
      "Ten mixed questions"
    ]
  },
  "transcript": [
    {
      "at": "00:14",
      "speaker": "Mr Okafor",
      "text": "Let's start with number three."
    }
  ]
}

I-download ang recording

GET/api/v1/recordings/{id}/media

Ang recording mismo bilang isang video file. Ipadala ang key tulad ng ginagawa sa bawat iba pang tawag.

Path
id string requiredAng id ng recording.
Request
curl https://tutorio.app/api/v1/recordings/3b9f0c2e7a1d4e68/media \
  -H "Authorization: Bearer tut_your_key" \
  -o recording.webm

Mga webhook

Magdagdag ng webhook

POST/api/v1/webhooks

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.

Body (JSON)
url string requiredKung saan ipapadala ang mga kaganapan. Kailangang https.
events array Ang mga uri ng kaganapan na gusto mo. Iwanang blangko para sa lahat.
include_names boolean Ang true ay nagpapadala ng mga pangalan ng kalahok, pangalan sa recording, at buod ng recording. Kung walang laman o false, id, papel, at oras lamang ang ipinapadala. Humingi lamang ng pangalan kung kailangan: mga bata kadalasan ang nasa silid.
Request
curl -X POST https://tutorio.app/api/v1/webhooks \
  -H "Authorization: Bearer tut_your_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/hooks/tutorio", "events": ["session.ended", "recording.ready"]}'
Sagot · 201
{
  "id": "hook_Ab3dE6gH9jK2mN",
  "url": "https://example.com/hooks/tutorio",
  "events": [
    "session.ended",
    "recording.ready"
  ],
  "include_names": false,
  "secret": "whsec_…"
}

Ilista ang webhook

GET/api/v1/webhooks

Ang iyong mga webhook. Hindi kasama ang mga secret: ipinapakita lamang ang secret kapag ginawa ang webhook.

Request
curl https://tutorio.app/api/v1/webhooks \
  -H "Authorization: Bearer tut_your_key"
Sagot · 200
{
  "webhooks": [
    {
      "id": "hook_Ab3dE6gH9jK2mN",
      "url": "https://example.com/hooks/tutorio",
      "events": [
        "session.ended"
      ],
      "include_names": false,
      "disabled": false,
      "last_status": 200
    }
  ]
}

Alisin ang webhook

DELETE/api/v1/webhooks/{id}

Path
id string requiredAng id ng webhook, tulad ng hook_Ab3dE6gH9jK2mN.
Request
curl -X DELETE https://tutorio.app/api/v1/webhooks/hook_Ab3dE6gH9jK2mN \
  -H "Authorization: Bearer tut_your_key"
Sagot · 200
{
  "deleted": true
}

Mga webhook event

Magdagdag ng URL sa Integrations o gamit ang POST /webhooks at ipapadala ng Tutorio ang bawat kaganapan bilang JSON. Tumugon sa loob ng 15 segundo gamit ang anumang 2xx. Kung hindi, susubukan naming muli pagkatapos ng 5 segundo at 30. Nakatago sa log ng pagpapadala ang bawat tangka nang isang linggo, at ang "Send a test" ay nagpapadala ng ping.

Magkakapareho ang balot ng bawat katawan: id, type, created (mga segundo sa Unix) at data.

Hindi isinasama ang mga pangalan maliban kung hihilingin mo. May kasamang id, ang external_id na ibinigay mo, role at mga oras ang bawat kalahok, ayon sa mga halimbawa sa ibaba. Gawin ang webhook gamit ang include_names (o i-on ang "Include names" sa Integrations) para magkaroon din ang bawat kalahok ng name, at listahan ng people ang recording.

session.startedPumasok sa board ang unang tao.
session.started
{
  "id": "evt_Jq8sT2bN5wYc1R",
  "type": "session.started",
  "created": 1768233604,
  "data": {
    "board": {
      "code": "qm7-kx2p-vdr",
      "external_id": "lesson-4821",
      "name": "Maya · Year 9 Maths",
      "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr"
    },
    "session": {
      "id": "ses_p4Vn81LkQe2zXa",
      "started_at": "2026-01-12T16:00:04Z"
    }
  }
}
participant.joinedMay pumasok sa board.
participant.joined
{
  "id": "evt_Jq8sT2bN5wYc1R",
  "type": "participant.joined",
  "created": 1768233604,
  "data": {
    "board": {
      "code": "qm7-kx2p-vdr",
      "external_id": "lesson-4821",
      "name": "Maya · Year 9 Maths",
      "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr"
    },
    "participant": {
      "external_id": "student-193",
      "id": "a20b4c6d-0000-4000-8000-000000000002",
      "joined_at": "2026-01-12T16:01:30Z",
      "role": "participant"
    },
    "session": {
      "id": "ses_p4Vn81LkQe2zXa",
      "started_at": "2026-01-12T16:00:04Z"
    }
  }
}
participant.leftMay umalis sa board.
participant.left
{
  "id": "evt_Jq8sT2bN5wYc1R",
  "type": "participant.left",
  "created": 1768233604,
  "data": {
    "board": {
      "code": "qm7-kx2p-vdr",
      "external_id": "lesson-4821",
      "name": "Maya · Year 9 Maths",
      "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr"
    },
    "participant": {
      "external_id": "student-193",
      "id": "a20b4c6d-0000-4000-8000-000000000002",
      "left_at": "2026-01-12T16:58:02Z",
      "role": "participant"
    },
    "session": {
      "id": "ses_p4Vn81LkQe2zXa",
      "started_at": "2026-01-12T16:00:04Z"
    }
  }
}
session.endedUmalis na ang huling tao. Kasama ang buong attendance.
session.ended
{
  "id": "evt_Jq8sT2bN5wYc1R",
  "type": "session.ended",
  "created": 1768233604,
  "data": {
    "board": {
      "code": "qm7-kx2p-vdr",
      "external_id": "lesson-4821",
      "name": "Maya · Year 9 Maths",
      "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr"
    },
    "session": {
      "board": {
        "code": "qm7-kx2p-vdr",
        "external_id": "lesson-4821",
        "name": "Maya · Year 9 Maths",
        "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr"
      },
      "duration_seconds": 3517,
      "ended_at": "2026-01-12T16:58:41Z",
      "id": "ses_p4Vn81LkQe2zXa",
      "live": false,
      "participants": [
        {
          "duration_seconds": 3517,
          "id": "6f1c2d3e-0000-4000-8000-000000000001",
          "joined_at": "2026-01-12T16:00:04Z",
          "left_at": "2026-01-12T16:58:41Z",
          "role": "host",
          "visits": 1
        },
        {
          "duration_seconds": 3392,
          "external_id": "student-193",
          "id": "a20b4c6d-0000-4000-8000-000000000002",
          "joined_at": "2026-01-12T16:01:30Z",
          "left_at": "2026-01-12T16:58:02Z",
          "role": "participant",
          "visits": 2
        }
      ],
      "started_at": "2026-01-12T16:00:04Z"
    }
  }
}
recording.readyTapos na ang recording at pwede nang i-play.
recording.ready
{
  "id": "evt_Jq8sT2bN5wYc1R",
  "type": "recording.ready",
  "created": 1768233604,
  "data": {
    "board": {
      "code": "qm7-kx2p-vdr",
      "external_id": "lesson-4821",
      "name": "Maya · Year 9 Maths",
      "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr"
    },
    "recording": {
      "board": {
        "code": "qm7-kx2p-vdr",
        "name": "Maya · Year 9 Maths",
        "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr"
      },
      "bytes": 48211934,
      "duration_seconds": 3511,
      "ended_at": "2026-01-12T16:58:41Z",
      "has_transcript": false,
      "id": "3b9f0c2e7a1d4e68",
      "media_url": "https://tutorio.app/api/v1/recordings/3b9f0c2e7a1d4e68/media",
      "mime_type": "video/webm",
      "page_url": "https://tutorio.app/tutor/whiteboard/recording/3b9f0c2e7a1d4e68",
      "started_at": "2026-01-12T16:00:10Z",
      "status": "ready"
    }
  }
}
recording.transcribedNagawa na ang transcript at buod ng recording.
recording.transcribed
{
  "id": "evt_Jq8sT2bN5wYc1R",
  "type": "recording.transcribed",
  "created": 1768233604,
  "data": {
    "board": {
      "code": "qm7-kx2p-vdr",
      "external_id": "lesson-4821",
      "name": "Maya · Year 9 Maths",
      "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr"
    },
    "recording": {
      "board": {
        "code": "qm7-kx2p-vdr",
        "name": "Maya · Year 9 Maths",
        "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr"
      },
      "bytes": 48211934,
      "duration_seconds": 3511,
      "ended_at": "2026-01-12T16:58:41Z",
      "has_transcript": true,
      "id": "3b9f0c2e7a1d4e68",
      "media_url": "https://tutorio.app/api/v1/recordings/3b9f0c2e7a1d4e68/media",
      "mime_type": "video/webm",
      "page_url": "https://tutorio.app/tutor/whiteboard/recording/3b9f0c2e7a1d4e68",
      "started_at": "2026-01-12T16:00:10Z",
      "status": "done",
      "summary_available": true
    }
  }
}
board.createdNagawa ang board gamit ang API.
board.created
{
  "id": "evt_Jq8sT2bN5wYc1R",
  "type": "board.created",
  "created": 1768233604,
  "data": {
    "board": {
      "code": "qm7-kx2p-vdr",
      "external_id": "lesson-4821",
      "name": "Maya · Year 9 Maths",
      "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr"
    }
  }
}

Pag-verify ng mga signature

May dala itong header na Tutorio-Signature ang bawat padala: t=<unix>,v1=<hex>. Ang hex ay ang HMAC-SHA256 ng <t>.<body> gamit ang secret ng iyong webhook (nagsisimula sa whsec_ at minsan lamang ipinapakita, paggawa ng webhook). Kalkulahin at ihambing ito, at huwag pansinin ang lumipas na ang ilang minuto.

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));
}

Pag-embed

Ang pinakasimpleng paraan ay ang Join button kahit saan sa iyong produkto: magbubukas ang board bilang sariling pahina, sa parehong tab o sa bago.

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>

Ang room sa loob ng iyong page

Para maipakita ang live room sa mismong pahina ng iyong aralin, ilagay ito sa isang iframe. Kailangan ang tatlong ito para gumana:

  • Payagan ang iyong site. Ilalagay ng tutor na nagho-host ng mga board ang eksaktong address ng iyong site (tulad ng https://lessons.example.com) sa ilalim ng Integrations, Developers, Embed your whiteboard. Https lamang, walang mga wildcard, hanggang sampung site lamang. Tinatanggihan ng browser ang iba pang site at pati na rin ang ibang pahina ng Tutorio.
  • 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.
  • Ipasa ang camera. Kailangan ng frame ang attribute na allow sa ibaba, kung hindi ay haharangin ng browser ang camera, mikropono, at pagbabahagi ng screen sa loob nito. Sinasabi ng room kapag wala ito.
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>
Mga mensahe mula sa frame
tutorio:readyNag-load na ang room at ipinapakita ang Join screen nito.
tutorio:joinedNasa loob na sila ng room. Ang role ay host o participant.
tutorio:leftUmalis sila, o tinanggal sila ng host.
tutorio:endedTinapos ng host ang sesyon para sa lahat.
tutorio:errorHindi maipakita ng frame ang room. Sinasabi ng code ang dahilan: link_expired, no_session, locked, own_account, embed_off, permissions.
  • Ang mga gumagana sa frame Ang board, mga tab, app at website, mga upload, chat, tawag gamit ang mga camera at screen sharing, at mga kontrol sa room ng host.
  • Ang kailangan ng sariling tab Recording, Rio, invite sheet, mga file sa cloud, Print Studio, at mga live lesson. May button na Open in a new tab ang room; ang fallback_url ay parehong address para sa iyo.
  • Mga Sesyon Nananatiling naka-sign in ang frame habang bukas ito (dalawang oras na walang galaw, hanggang labindalawa) at kahit i-reload. Minsan lang gumagana ang host link, kaya gumawa ng bagong link tuwing ire-render mo ang pahina. Ang pag-alis ng site sa listahan ay magla-log out sa bawat naka-embed na room.
  • Walang cookies Walang umaasa sa mga third-party cookie.

Para naman ilagay ang iyong nilalaman sa loob ng board, gamitin ang Custom Apps SDK sa ibaba. Para sa platform ng pag-aaral, idinaragdag ng LTI 1.3 ang board sa kurso nang walang code.

Custom Apps SDK

Ang anumang pahina na https na pinapayagang i-frame ay pwedeng maging app sa board. Idagdag ito sa ilalim ng Custom apps sa Integrations, i-load ang isang script, at ibabahagi ito ng lahat sa room.

Isang counter na ibinabahagi ng buong room
<button id="add">0</button>

<script src="https://tutorio.app/public/assets/js/sdk/board.js"></script>
<script>
  const button = document.getElementById('add');
  const show = (state) => { button.textContent = state.count || 0; };

  TutorioBoard.ready().then((room) => {
    show(room.state);
    TutorioBoard.on('state', show);
    button.onclick = () => {
      TutorioBoard.state.set('count', (TutorioBoard.state.get('count') || 0) + 1);
    };
  });
</script>
TutorioBoard
ready()Isang pangako para sa silid: me, people, state, at standalone kapag wala sa board ang pahina.
state.set(key, value)Nagtatakda ng nakabahaging halaga. Lahat ay makakakuha nito; ang huling mag-save sa key ang masusunod. 32 KB sa kabuuan.
state.get(key)Bumabasa ng nakabahaging halaga.
on('state', fn)Tinatawag kasama ang buong estado tuwing nagbabago ito.
send(data)Isang mensahe sa lahat sa silid. Hindi itinatago.
on('message', fn)Tinatawag sa bawat mensaheng ipinapadala ng sinuman.
peopleAng mga nasa silid ngayon.

Zapier

Binabalot ng Zapier app ang API na ito para sa mga hindi nag-a-code. Naghihintay ito ng pagsusuri ng Zapier kaya wala pa sa listahan nila ng app; hingin sa amin ang invite link. Kailangan mo ng sarili mong Zapier account.

  • Mga Triggers Nagsimula ang sesyon, May pumasok, Nagtapos ang sesyon, Handa na ang recording, Na-transcribe ang recording, Nilikha ang whiteboard.
  • Mga Action Gumawa ng whiteboard, Gumawa ng join link, Maghanap ng whiteboard.

Higit pa tungkol sa Zapier app

May tanong? I-message kami.

May sumasagot na totoong tao sa support@tutorio.app. Ikuwento sa amin ang ginagawa mo.