跳至內容
Tutorio 免費開始
開發者

運用 Tutorio API 進行開發

建立白板、讓使用者登入,並讀取出席記錄、錄製內容與逐字稿。

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

新手指南

此 API 採用透過 HTTPS 傳輸的純 JSON。只需三個步驟,即可從無到有開始進行線上課程。

  1. 1

    建立金鑰

    在你的 Tutorio 帳戶中開啟「整合」,並建立 API 金鑰。金鑰只會顯示一次,請妥善複製並保存。

  2. 2

    連線測試

    呼叫 GET /me。它會回應金鑰所屬的帳戶。

  3. 3

    建立白板

    呼叫 POST /boards,然後為每個人建立一個登入連結。

檢查金鑰
curl https://tutorio.app/api/v1/me \
  -H "Authorization: Bearer tut_your_key"

身分驗證

在每個呼叫中將你的金鑰作為 bearer token 傳送。金鑰以 tut_ 開頭,屬於使用中方案中的導師帳戶,並可存取該帳戶的白板(若為組織,則可存取其導師的白板)。

標頭
Authorization: Bearer tut_your_key

請將金鑰保存在您的伺服器上。切勿將金鑰放在網頁或應用程式中。

錯誤與速率限制

失敗的呼叫會回應狀態碼與固定格式的主體。每個金鑰大約可進行 每分鐘 120 次請求;超過後您會收到帶有 Retry-After 標頭(以秒為單位)的 429。請等待該時間過後再繼續。

錯誤主體
{
  "error": {
    "code": "not_found",
    "message": "There is no board with that code on this account."
  }
}
錯誤代碼
bad_json400主體不是有效的 JSON。
invalid_request400缺少欄位或欄位不允許。錯誤訊息會指出具體欄位。
missing_key401Authorization 標頭中未傳送金鑰。
invalid_key401金鑰錯誤或已被刪除。
plan_required402該帳戶的 Tutorio 方案未啟用。
not_a_tutor403此金鑰屬於非導師的帳戶。
not_found404在此帳戶中找不到該代碼或 ID 對應的項目。
rate_limited429每分鐘請求大約超過 120 次。請等待 Retry-After。
server_error500我們的系統發生錯誤,請再試一次。

帳號

檢查金鑰

GET/api/v1/me

指出金鑰屬於哪個帳戶。可用於測試連線。

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

白板

建立白板

POST/api/v1/boards

建立白板並傳回其連結。傳送 external_id(您對課程、學生或預約的自訂 ID),呼叫即可重複執行且安全:相同的 ID 永遠會傳回相同的白板。

主體 (JSON)
name 字串 白板的名稱。最多 80 個字元。
external_id 字串 您為此白板設定的識別碼。再次使用此識別碼查詢將會返回相同的白板。
host_email 字串 將白板指派給您組織中的其他導師,而非您本人。
請求
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"}'
回應 · 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
}

取得白板列表

GET/api/v1/boards

您的白板列表,按最近開啟的時間排序。

查詢
limit integer 返回數量。預設為 50,最多 200。
external_id 字串 僅返回以此識別碼建立的白板。
name 字串 僅返回名稱包含此文字的白板。
請求
curl https://tutorio.app/api/v1/boards \
  -H "Authorization: Bearer tut_your_key"
回應 · 200
{
  "boards": [
    {
      "code": "qm7-kx2p-vdr",
      "name": "Maya · Year 9 Maths",
      "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr",
      "people_in_room": 2
    }
  ]
}

取得單一白板

GET/api/v1/boards/{code}

單一白板,包含目前在線的人數。

路徑
code 字串 必填白板代碼:其連結的最後一部分。
請求
curl https://tutorio.app/api/v1/boards/qm7-kx2p-vdr \
  -H "Authorization: Bearer tut_your_key"
回應 · 200
{
  "code": "qm7-kx2p-vdr",
  "name": "Maya · Year 9 Maths",
  "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr",
  "people_in_room": 2
}

重新命名白板

PATCH/api/v1/boards/{code}

路徑
code 字串 必填白板代碼:其連結的最後一部分。
主體 (JSON)
name 字串 新名稱。
請求
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"}'
回應 · 200
{
  "code": "qm7-kx2p-vdr",
  "name": "Maya · Year 10 Maths",
  "url": "https://tutorio.app/whiteboard/qm7-kx2p-vdr"
}

刪除白板

刪除/api/v1/boards/{code}

刪除白板、其上的所有內容以及上載的檔案。此操作無法復原。

路徑
code 字串 必填白板代碼:其連結的最後一部分。
請求
curl -X DELETE https://tutorio.app/api/v1/boards/qm7-kx2p-vdr \
  -H "Authorization: Bearer tut_your_key"
回應 · 200
{
  "deleted": true,
  "code": "qm7-kx2p-vdr"
}

建立登入連結

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

一個能讓使用者直接進入白板並自動登入的連結。請將其放在您自己的「加入」按鈕後方。參與者連結在過期前有效;發送 external_id 可讓該使用者始終對應到相同的 Tutorio 帳號。主持人連結則以白板導師身分登入:只能使用一次且有效期為十分鐘,請在使用者點擊時即時產生。

路徑
code 字串 必填白板代碼:其連結的最後一部分。
主體 (JSON)
role 字串 「participant」(預設)或「host」。
name 字串 聊天室顯示的名稱。參與者為必填。
external_id 字串 您為此人設定的識別碼,以便他們維持單一帳號。
email 字串 他們的電子郵件(如果您有)。僅供您的記錄使用。
expires_in integer 連結失效的剩餘秒數。參與者連結預設維持一天,最多 90 天;主持人連結十分鐘,最多一小時。
embed 布林值 設為 true 可改為在您自己的頁面上建立嵌入式框架(iframe)連結:url 為框架的 src,fallback_url 則是獨立的白板頁面。白板導師必須已在「整合」中允許您的網站,且參與者需要有 external_id。嵌入連結僅適用於該特定聊天室,且只能在框架內使用。請參閱「嵌入」。
請求
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"}'
回應 · 201
{
  "url": "https://tutorio.app/whiteboard/go/Hq3…",
  "role": "participant",
  "expires_at": "2026-01-13T09:30:00Z",
  "single_use": false
}

出缺席紀錄

白板課程紀錄

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

白板的每次使用記錄:誰參與了、何時參與,以及持續時間。

路徑
code 字串 必填白板代碼:其連結的最後一部分。
查詢
limit integer 返回數量。預設為 50,最多 200。
請求
curl https://tutorio.app/api/v1/boards/qm7-kx2p-vdr/sessions \
  -H "Authorization: Bearer tut_your_key"
回應 · 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
        }
      ]
    }
  ]
}

所有課堂紀錄

GET/api/v1/sessions

所有白板的連線記錄,按最新排序。

查詢
since 字串 僅返回在此時間當天或之後開始的連線記錄(RFC 3339)。
limit integer 返回數量。預設為 50,最多 200。
請求
curl https://tutorio.app/api/v1/sessions \
  -H "Authorization: Bearer tut_your_key"
回應 · 200
{
  "sessions": []
}

取得單一課堂紀錄

GET/api/v1/sessions/{id}

路徑
id 字串 必填連線記錄的識別碼,例如 ses_p4Vn81LkQe2zXa。
請求
curl https://tutorio.app/api/v1/sessions/ses_p4Vn81LkQe2zXa \
  -H "Authorization: Bearer tut_your_key"
回應 · 200
{
  "id": "ses_p4Vn81LkQe2zXa",
  "live": true,
  "started_at": "2026-01-12T16:00:04Z",
  "ended_at": null,
  "participants": []
}

課程錄影

取得錄影列表

GET/api/v1/recordings

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

查詢
limit integer 返回數量。預設為 50,最多 200。
請求
curl https://tutorio.app/api/v1/recordings \
  -H "Authorization: Bearer tut_your_key"
回應 · 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
    }
  ]
}

取得錄影資料

GET/api/v1/recordings/{id}

包含摘要與完整逐字稿的錄影(狀態為「done」時)。

路徑
id 字串 必填錄影的識別碼。
請求
curl https://tutorio.app/api/v1/recordings/3b9f0c2e7a1d4e68 \
  -H "Authorization: Bearer tut_your_key"
回應 · 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."
    }
  ]
}

下載錄影檔案

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

錄影本身(單一影片檔案)。請與其他呼叫一樣發送金鑰。

路徑
id 字串 必填錄影的識別碼。
請求
curl https://tutorio.app/api/v1/recordings/3b9f0c2e7a1d4e68/media \
  -H "Authorization: Bearer tut_your_key" \
  -o recording.webm

Webhook

新增 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.

主體 (JSON)
url 字串 必填接收事件的網址。必須使用 https。
events 陣列 您想要的事件類型。留空表示全部。
include_names 布林值 true 會傳送參與者姓名、錄製內容中人員的姓名以及錄製摘要。若略過或設為 false,則傳遞內容僅包含識別碼、角色與時間。請僅在需要時要求姓名:聊天室中的人員大多是兒童。
請求
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"]}'
回應 · 201
{
  "id": "hook_Ab3dE6gH9jK2mN",
  "url": "https://example.com/hooks/tutorio",
  "events": [
    "session.ended",
    "recording.ready"
  ],
  "include_names": false,
  "secret": "whsec_…"
}

取得 Webhook 列表

GET/api/v1/webhooks

您的 webhook。不包含其密鑰:密鑰僅會在建立 webhook 時顯示一次。

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

移除 Webhook

刪除/api/v1/webhooks/{id}

路徑
id 字串 必填webhook 的識別碼,例如 hook_Ab3dE6gH9jK2mN。
請求
curl -X DELETE https://tutorio.app/api/v1/webhooks/hook_Ab3dE6gH9jK2mN \
  -H "Authorization: Bearer tut_your_key"
回應 · 200
{
  "deleted": true
}

Webhook 事件

在「整合」中或使用 POST /webhooks 新增網址,Tutorio 會將每個事件以 JSON 格式發送至該網址。請在 15 秒內回傳任何 2xx 回應。若未回傳,我們將在 5 秒後以及 30 秒後再次嘗試。每次嘗試都會保留在傳送記錄中一週,「傳送測試」會發送 ping。

每個主體都具有相同的外框:id、type、created(Unix 秒數)與 data。

除非您主動要求,否則不會包含人員姓名。每位參與者皆包含 id、您指派給他們的 external_id、role 及其時間,如以下範例所示。透過 include_names 建立 webhook(或在「整合」中開啟「包含姓名」),每位參與者亦將包含 name,且錄製內容將包含 people 清單。

session.started首位使用者進入白板。
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.joined有人進入白板。
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.left有人離開白板。
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.ended全員已離開,並附帶所有人的出缺席紀錄。
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.ready錄影已處理完成,可供播放。
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.transcribed錄影逐字稿與摘要已產生完成。
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.created已透過 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"
    }
  }
}

驗證數位簽章

每次傳遞皆包含 Tutorio-Signature 標頭:t=<unix>,v1=<hex>。十六進位字串是使用您的 webhook 密鑰(開頭為 <t>.<body>,且於建立 webhook 時僅顯示一次)對 whsec_ 進行的 HMAC-SHA256 運算。請計算相同的值並進行比對,同時拒絕任何超過幾分鐘前的要求。

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

嵌入功能

最簡單的進入方式是在您產品的任何地方放置「加入」按鈕:白板會作為獨立頁面開啟,可於相同分頁或新分頁中開啟。

加入按鈕
<!-- The board opens as its own page, so cameras and microphones work. -->
<a href="/lessons/4821/join" target="_blank" rel="noopener">Join lesson</a>

將教室直接嵌入您的網頁

若要在您自己的課程頁面中顯示即時聊天室,請將其嵌入 iframe 中。這需要達成以下三項要件:

  • 允許您的網站。主持白板的主持人會在「整合」、「開發人員」、「嵌入您的白板」下方新增您網站的確切網址(例如 https://lessons.example.com)。僅限 Https,不支援萬用字元,最多十個網站。瀏覽器會拒絕所有其他網站以及所有其他 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.
  • 傳遞相機權限。框架需要包含下方的 allow 屬性,否則瀏覽器會封鎖其中的相機、麥克風與畫面分享。若缺少此屬性,聊天室將會提出提示。
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>
來自框架的訊息
tutorio:ready聊天室已載入並正在顯示「加入」畫面。
tutorio:joined他們已進入聊天室。role 為 host 或 participant。
tutorio:left他們已離開,或已被主持人移除。
tutorio:ended主持人已為所有人結束工作階段。
tutorio:error框架無法顯示聊天室。code 說明了原因:link_expired、no_session、locked、own_account、embed_off、permissions。
  • 框架支援的功能白板、分頁、應用程式與網站、上傳、聊天、包含相機與畫面分享的通話,以及主持人的聊天室控制項。
  • 需要獨立分頁的功能錄製、Rio、邀請表單、雲端檔案、Print Studio 與線上課程。聊天室提供「在新分頁中開啟」按鈕;fallback_url 即為您自己的相同網址。
  • 工作階段框架在開啟期間(無活動時兩小時,最多十二小時)以及重新載入時會保持登入狀態。主持人連結僅能使用一次,因此請在每次轉譯頁面時建立新連結。從清單中移除網站將會登出所有嵌入的聊天室。
  • 無 Cookie完全不相依於第三方 Cookie。

若要反向將您的內容嵌入白板中,請使用下方的 Custom Apps SDK。對於學習平臺而言,LTI 1.3 無需撰寫程式碼即可將白板加入課程中。

Custom Apps SDK

任何允許嵌入的 https 頁面都能成為白板上的應用程式。只要在「整合」的「自訂應用程式」下方新增它、載入一個指令碼,聊天室中的所有人就能共同使用。

全聊天室共用的計數器
<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()房間 promise:當頁面不在白板內時為 me、people、state 與 standalone。
state.set(key, value)設定共用數值。所有人皆可取得;以最後寫入的鍵值為準。總計 32 KB。
state.get(key)讀取共用數值。
on('state', fn)狀態改變時,即會以完整狀態呼叫。
send(data)傳送給房間內所有人的訊息。不會被保留。
on('message', fn)當有人發送訊息時呼叫。
people目前在房間內的人員。

Zapier

Zapier 應用程式封裝了此 API,專為不寫程式的使用者打造。目前正等待 Zapier 審查,因此尚未公開上架;歡迎向我們索取邀請連結。使用時需搭配您自己的 Zapier 帳號。

  • 觸發條件 已開始課程、參與者已加入、已結束課程、錄製就緒、已轉錄錄製、已建立白板。
  • 動作 建立白板、建立加入連結、尋找白板。

關於 Zapier 應用程式的更多資訊

遇到問題?歡迎隨時聯繫我們。

真人客服將於 support@tutorio.app回覆。告訴我們您正在開發的內容。