이벤트 JSON Schema
봉투와 data 유형별 JSON Schema(draft 2020-12).
키가 필요 없고 속도 제한에 포함되지 않습니다. 수신 이벤트 검증이나 타입 생성에 바로 쓸 수 있습니다.
공개 엔드포인트, 키 불필요
파라미터
파라미터가 없습니다.
응답
오류
—
curl "https://api.tokenearly.com/v1/schema"import requests
resp = requests.get("https://api.tokenearly.com/v1/schema", timeout=10)
resp.raise_for_status()
print(resp.json())// Node 18+ (built-in fetch)
async function main() {
const resp = await fetch("https://api.tokenearly.com/v1/schema");
console.log(await resp.json());
}
main().catch((err) => {
console.error(err);
process.exit(1);
});package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.tokenearly.com/v1/schema", nil)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(body))
}응답 예시
{
"spec_version": "1.0",
"event": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://api.tokenearly.com/v1/schema/event",
"title": "Tokenearly event",
"allOf": [
"…"
],
"$defs": {
"announcement": "…",
"news": "…",
"signal": "…",
"twitter": "…"
}
},
"envelope": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Tokenearly event envelope",
"type": "object",
"required": [
"spec_version",
"id",
"revision",
"action",
"topic",
"type",
"source",
"published_at",
"detected_at_ms",
"data"
],
"properties": {
"id": {
"type": "string",
"description": "Stable event id (24 hex characters) shared by every revision; never changes. Ids increase with the time the event was first stored and compare correctly as strings. Also the pagination and resume cursor."
},
"…": "…"
}
},
"data": {
"announcement": {
"title": "announcement data",
"type": "object",
"properties": {
"…": "…"
}
},
"news": {
"title": "news data",
"type": "object",
"properties": {
"…": "…"
}
},
"signal": {
"title": "signal data",
"type": "object",
"properties": {
"…": "…"
}
},
"twitter": {
"title": "twitter data",
"type": "object",
"properties": {
"…": "…"
}
}
}
}