API 参考接口列表
推送平台数据
为一个平台来源推送一批数据(评论、礼物、进场、关注、点赞等)。用同一个 `batchId` 重发时返回第一次的结果,不会重复入库。
POST
application/json- body
Items are validated one by one, so one bad item does not reject the batch.
batchId*BatchidUnchanged when the same batch is resent
格式
uuidepoch*EpochNew each time the collector starts; seq restarts at 1
匹配规则
^[A-Za-z0-9-]{1,64}$items*array<>EventItem, MetricItem, SnapshotItem or StatusItem, by kind
数量
1 <= items <= 100sentAt*Sentat格式
date-timesourceId*Sourceid格式
uuidSuccessful Response
application/json- response
accepted*AcceptedackSeq*AckseqHighest seq up to which everything has been received
batchId*Batchid格式
uuidduplicates*Duplicatesgaps*array<array<any>>Missing seq ranges after ack_seq
rejected*array<>serverTime*Servertime格式
date-timecurl -X POST 'https://api.ailive.studio/v1/room/data' \ -H 'Authorization: Bearer <ACCESS_TOKEN>' \ -H 'Content-Type: application/json' \ -d '{ "batchId": "5579c111-9c50-47e2-af92-f16d52e63189", "epoch": "string", "items": [ {} ], "sentAt": "2019-08-24T14:15:22Z", "sourceId": "797f5a94-3689-4ac8-82fd-d749511ea2b2"}'响应示例
{ "accepted": 0, "ackSeq": 0, "batchId": "5579c111-9c50-47e2-af92-f16d52e63189", "duplicates": 0, "gaps": [ [ 0, 0 ] ], "rejected": [ { "code": "string", "index": 0, "message": "string" } ], "serverTime": "2019-08-24T14:15:22Z"}