- 凭据
- Server Key(传
customerId)或 Customer Token,权限events:write。 - SDK
- JavaScript
createLongplayServer().trackEvents· JavaScriptcreateLongplay().track· Pythontrack_events· GoTrackEvents - 成功状态
- HTTP 200
0.10.20。POST /api/v1/events 只接受带 kind 的类型化事件(custom、experiment_exposure 或 feature_usage),旧 SDK 无法上报事件。直接使用 HTTP 时须遵循当前的类型化请求与逐事件结果契约,无需安装 SDK。相关:事件上报版本要求
curl -X POST "$LONGPLAY_API_URL/api/v1/events" \ -H "Authorization: Bearer $LONGPLAY_SERVER_KEY" \ -H "X-Indiana-Protocol: 0.10" \ -H "Content-Type: application/json" \ -d '{ "events": [ { "eventUuid": "b4eaa1be-aa5e-42c4-85d4-f83fd95d74e9", "timestamp": "2026-10-03T12:00:00.000Z", "kind": "custom", "name": "Pro" } ], "customerId": "8b258f8b-4228-40fa-8d24-5b16428e686d"}'响应为示例数据。