์นํ
์ด ํ์ด์ง์ ๋ด์ฉ
Settings โ Developers โ Webhooks(์ค์ โ ๊ฐ๋ฐ์ โ ์นํ )์์ ์๋ํฌ์ธํธ๋ฅผ ์ถ๊ฐํฉ๋๋ค(์์ ์์ ๊ด๋ฆฌ์๋ง ๊ฐ๋ฅ). ์๋ํฌ์ธํธ๋ ๊ณต๊ฐ๋ HTTPS ์ฃผ์์ฌ์ผ ํฉ๋๋ค. ๋ฐ์ ์ด๋ฒคํธ๋ฅผ ์ ํํ์ธ์. All events๋ฅผ ์ผ ๋๊ฑฐ๋(๋์ค์ Pellio์ ์ถ๊ฐ๋๋ ์ด๋ฒคํธ๋ ํฌํจ), ๋๊ณ ์ํ๋ ์ด๋ฒคํธ๋ฅผ ๊ณ ๋ฅผ ์ ์์ต๋๋ค. Pellio๋ ์๋ํฌ์ธํธ์ ์๋ช ์ํฌ๋ฆฟ์ ํ ๋ฒ๋ง ๋ณด์ฌ ์ค๋๋ค.
๊ฐ ์๋ํฌ์ธํธ์๋ ์์ ํ๋ ์ด๋ฒคํธ ๋ชฉ๋ก๊ณผ ํจ๊ป ๋ค์ ์์ ์ด ํ์๋ฉ๋๋ค.
- Edit events: ์์ ํ ์ด๋ฒคํธ๋ฅผ ๋ณ๊ฒฝํฉ๋๋ค. Save events๋ฅผ ๋๋ฅด๋ฉด ์ฆ์ ์ ์ฉ๋ฉ๋๋ค.
- Send test: ์์ ์ด๋ฒคํธ ์ค์ ๊ณผ ๊ด๊ณ์์ด ํด๋น ์๋ํฌ์ธํธ๋ก
webhook.test์ด๋ฒคํธ๋ฅผ ๋ณด๋ ๋๋ค. - Deliveries: ์ต๊ทผ 50๋ฒ์ ์ ์ก ์๋(๋๊ธฐ ์ค, ์ ์ก๋จ, ์คํจ)์ ์๋ต์ ๋ณด์ฌ ์ค๋๋ค.
- Rotate secret: ์๋ช ์ํฌ๋ฆฟ์ ๊ต์ฒดํฉ๋๋ค. ์ ์ํฌ๋ฆฟ์ ํ ๋ฒ๋ง ํ์๋๊ณ ๊ธฐ์กด ์ํฌ๋ฆฟ์ ์ฆ์ ๋ฌดํจํ๋๋ฏ๋ก, ์๋ํฌ์ธํธ๋ฅผ ๋ฐ๋ก ์ ๋ฐ์ดํธํ์ธ์.
- Remove: ์๋ํฌ์ธํธ๋ก ์ ์ก์ ์ค๋จํฉ๋๋ค.
API์์๋ POST /v1/webhooks๊ฐ url๊ณผ events(๋น ๋ชฉ๋ก์ ๋ชจ๋ ์ด๋ฒคํธ)๋ฅผ ๋ฐ๊ณ , PATCH /v1/webhooks/{id}๋ก events๋ฅผ ๋ณ๊ฒฝํ๋ฉฐ, POST /v1/webhooks/{id}/rotate-secret์ ์ secret์ ๋ฐํํฉ๋๋ค.
์ด๋ฒคํธ
๋ชจ๋ ์์ฒญ ๋ณธ๋ฌธ์ { "id", "event", "createdAt", "data" } ํ์์
๋๋ค.
| event | ๋ฐ์ ์์ | data |
|---|---|---|
video.created |
์ ๋ก๋, ๋ นํ, URL ๊ฐ์ ธ์ค๊ธฐ๋ก ๋์์์ด ์์ฑ๋์์ ๋ | id, title |
video.ready |
๋์์ ์ฒ๋ฆฌ๊ฐ ๋๋ฌ์ ๋(๊ต์ฒด๋ ์๋ฅด๊ธฐ ํ ํฌํจ) | id, title, status, version, durationSeconds, width, height, errorMessage |
video.failed |
์ ๋์์์ ์ฒ๋ฆฌํ์ง ๋ชปํ์ ๋ | video.ready์ ๋์ผ |
video.deleted |
๋์์์ด ํด์งํต์ผ๋ก ์ด๋(trashed: true)๋๊ฑฐ๋ ์๊ตฌ ์ญ์ ๋์์ ๋ |
id, title, trashed |
video.watched |
์๋ณ๋ ์์ฒญ์(์ด๋ฉ์ผ ์์, ?email= ๋งํฌ, WordPress ์ฌ์ดํธ๋ฅผ ํตํด ์๋ณ)๊ฐ ๋์์์ ์์ํ๊ฑฐ๋, 25%, 50%, 75%๋ฅผ ์ง๋๊ฑฐ๋, ๋๊น์ง ์์ฒญํ์ ๋(์ฌ๋ฌ ๋ฒ ๋ฐฉ๋ฌธํ ์์ฒญ์ ํฉ์ณ 90%). ์์ฒญ์, ๋์์, ๋ง์ผ์คํค๋ณ๋ก ํ ๋ฒ์ฉ ๋ฐ์ํฉ๋๋ค. |
video(id, title), viewer(email, name), progress(0, 25, 50, 75, 100), milestone(started, 25%, 50%, 75%, completed), completed |
lead.captured |
๋๊ตฐ๊ฐ ์ด๋ฉ์ผ ์์์ ์ ์ถํ์ ๋ | id, email, name, fields, video(id, title), createdAt |
์ ์ก
Pellio๋ User-Agent: Pellio-Webhooks/1 ํค๋์ ํจ๊ป POST ์์ฒญ์ ๋ณด๋ด๊ณ ์ต๋ 10์ด ๋์ ๊ธฐ๋ค๋ฆฝ๋๋ค. 2xx ์๋ต์ ๋ชจ๋ ์ ์ก ์ฑ๊ณต์ผ๋ก ์ฒ๋ฆฌํฉ๋๋ค. ๋ฆฌ๋๋ ์
์ ๋ฐ๋ผ๊ฐ์ง ์์ผ๋ฏ๋ก 3xx๋ ์คํจ๋ก ์ฒ๋ฆฌ๋ฉ๋๋ค. ์คํจํ ์ ์ก์ ์ด 6๋ฒ๊น์ง ์๋ํ๋ฉฐ, ์ฒซ ์ฌ์๋ ์ ์ 20์ด๋ฅผ ๊ธฐ๋ค๋ฆฌ๊ณ ์ดํ ๋๊ธฐ ์๊ฐ์ ๋ ๋ฐฐ์ฉ ๋๋ ค ์ต๋ 320์ด๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค.
์๋ช ํ์ธํ๊ธฐ
๋ชจ๋ ์์ฒญ์๋ ์๋ํฌ์ธํธ์ ์ํฌ๋ฆฟ์ผ๋ก ๋ง๋ Pellio-Signature ํค๋๊ฐ ํฌํจ๋ฉ๋๋ค: t=<unix time>,v1=<hex HMAC-SHA256 of "t.body">. ๊ฐ๊ณตํ์ง ์์ ์๋ณธ ์์ฒญ ๋ณธ๋ฌธ์ผ๋ก ์๋ช
์ ํ์ธํ์ธ์.
import { createHmac, timingSafeEqual } from 'node:crypto';
function verify(header, rawBody, secret) {
const { t, v1 } = Object.fromEntries(header.split(',').map((p) => p.split('=')));
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false; // 5-minute tolerance
const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
return timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
}
์ด ๊ธ์ด ๋์์ด ๋์๋์?
๊ด๋ จ ๊ธ
- API keys and the REST APIAuthenticate, upload and manage videos from your own code.
- ํ๋ ์ด์ด APIpostMessage๋ ์น ์ปดํฌ๋ํธ๋ก ํ๋ ์ด์ด๋ฅผ ์ ์ดํ๊ณ ์ด๋ฒคํธ๋ฅผ ์์ ํฉ๋๋ค.
- AI ์ด์์คํดํธ(MCP)Pellio์ MCP ์๋ฒ๋ก Claude, ChatGPT, Cursor, Claude Code๋ฅผ Pellio์ ์ฐ๊ฒฐํฉ๋๋ค.
- WordPress pluginA fast, private video player for any WordPress site, and Pellio hosting when you connect an account.