ข้ามไปยังเนื้อหา
Tutorio เริ่มใช้งานฟรี
นักพัฒนา

สร้างต่อยอดด้วย Tutorio API

สร้างไวท์บอร์ด ลงชื่อเข้าใช้งาน และอ่านข้อมูลการเข้าเรียน บันทึกการสอน และบทถอดเสียง

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

เริ่มต้นใช้งาน

API นี้เป็นรูปแบบ JSON ธรรมดาผ่าน HTTPS เพียงสามขั้นตอนก็พาคุณจากจุดเริ่มต้นไปสู่บทเรียนสดได้

  1. 1

    สร้างคีย์

    เปิดส่วนการบูรณาการในบัญชี Tutorio ของคุณและสร้างคีย์ API คีย์นี้จะแสดงเพียงครั้งเดียว ดังนั้นโปรดคัดลอกเก็บไว้ในที่ปลอดภัย

  2. 2

    ทดสอบการทำงาน

    Call GET /me. It answers with the account the key belongs to.

  3. 3

    สร้างบอร์ด

    Call POST /boards, then make a sign-in link for each person.

ตรวจสอบคีย์
curl https://tutorio.app/api/v1/me \
  -H "Authorization: Bearer tut_your_key"

การยืนยันตัวตน

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).

ส่วนหัว
Authorization: Bearer tut_your_key

เก็บคีย์ไว้บนเซิร์ฟเวอร์ของคุณ ห้ามใส่คีย์ไว้ในหน้าเว็บหรือแอปพลิเคชันเด็ดขาด

ข้อผิดพลาดและข้อจำกัด

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."
  }
}
รหัสข้อผิดพลาด
bad_json400เนื้อหาไม่ใช่ JSON ที่ถูกต้อง
invalid_request400ฟิลด์ข้อมูลหายไปหรือไม่ได้รับอนุญาต ข้อความจะระบุรายละเอียดให้ทราบ
missing_key401ไม่มีการส่งคีย์มาในส่วนหัว Authorization
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 สตริง ID ของคุณสำหรับจุดประสงค์ของบอร์ดนี้ การเรียกซ้ำด้วย 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 สตริง เฉพาะกระดานที่สร้างสำหรับ 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 string requiredรหัสกระดาน: ส่วนท้ายของลิงก์
คำขอ
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 string requiredรหัสกระดาน: ส่วนท้ายของลิงก์
เนื้อหา (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"
}

ลบบอร์ด

DELETE/api/v1/boards/{code}

ลบกระดาน เนื้อหาทั้งหมด และไฟล์ที่อัปโหลด การดำเนินการนี้ไม่สามารถย้อนกลับได้

พาร์ท
code string requiredรหัสกระดาน: ส่วนท้ายของลิงก์
คำขอ
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 string requiredรหัสกระดาน: ส่วนท้ายของลิงก์
เนื้อหา (JSON)
role สตริง "participant" (ค่าเริ่มต้น) หรือ "host"
name สตริง ชื่อที่จะแสดงในห้อง จำเป็นสำหรับผู้เข้าร่วม
external_id สตริง ID ของคุณสำหรับบุคคลนี้ เพื่อให้ใช้บัญชีเดิม
email สตริง อีเมลของพวกเขา หากมี เก็บรวบรวมไว้เพื่อเป็นบันทึกของคุณเท่านั้น
expires_in integer วินาทีจนกว่าลิงก์จะหมดอายุ ลิงก์ผู้เข้าร่วมมีอายุหนึ่งวันเว้นแต่คุณจะระบุ สูงสุด 90 วัน; ลิงก์ผู้จัดมีอายุสิบนาที สูงสุดหนึ่งชั่วโมง
embed boolean true สร้างลิงก์สำหรับ iframe บนหน้าของคุณแทน: url คือ src ของเฟรม และ fallback_url คือกระดานในฐานะหน้าเว็บแยกต่างหาก ติวเตอร์ของกระดานต้องอนุญาตเว็บไซต์ของคุณภายใต้ Integrations และผู้เข้าร่วมต้องมี external_id ลิงก์ฝังจะเข้าสู่ระบบเฉพาะห้องนั้นและใช้งานได้ในเฟรมเท่านั้น ดูหัวข้อ Embedding
คำขอ
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 string requiredรหัสกระดาน: ส่วนท้ายของลิงก์
คำค้นหา
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 string requiredID ของเซสชัน เช่น 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}

บันทึกการประชุมพร้อมสรุปและถอดCความเต็ม เมื่อจัดทำเสร็จแล้ว (สถานะ "done")

พาร์ท
id string requiredID ของบันทึกการประชุม
คำขอ
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 string requiredID ของบันทึกการประชุม
คำขอ
curl https://tutorio.app/api/v1/recordings/3b9f0c2e7a1d4e68/media \
  -H "Authorization: Bearer tut_your_key" \
  -o recording.webm

Webhooks

เพิ่ม 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 string requiredปลายทางสำหรับส่งเหตุการณ์ ต้องเป็น https
events array The event types you want. Empty means all.
include_names boolean 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.
คำขอ
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

Your webhooks. Their secrets are not included: a secret is only ever shown when its webhook is made.

คำขอ
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

DELETE/api/v1/webhooks/{id}

พาร์ท
id string requiredThe webhook's id, such as hook_Ab3dE6gH9jK2mN.
คำขอ
curl -X DELETE https://tutorio.app/api/v1/webhooks/hook_Ab3dE6gH9jK2mN \
  -H "Authorization: Bearer tut_your_key"
การตอบกลับ · 200
{
  "deleted": true
}

อีเวนต์ของ webhook

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.

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"
    }
  }
}

การตรวจสอบลายเซ็น

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

การฝังระบบ

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:readyThe room has loaded and is showing its Join screen.
tutorio:joinedThey are in the room. role is host or participant.
tutorio:leftThey left, or the host removed them.
tutorio:endedThe host ended the session for everyone.
tutorio:errorThe 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.

A counter the whole room shares
<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()ข้อสัญญาสำหรับห้อง: 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 บอกให้เรารู้ว่าคุณกำลังพัฒนาอะไรอยู่