AILIVE文档
API 参考接口列表

推送平台数据

为一个平台来源推送一批数据(评论、礼物、进场、关注、点赞等)。用同一个 `batchId` 重发时返回第一次的结果,不会重复入库。

POST
/v1/room/data

请求头参数

authorization?string|null

请求正文

application/json
  1. body

Items are validated one by one, so one bad item does not reject the batch.

batchId*Batchid

Unchanged when the same batch is resent

格式uuid
epoch*Epoch

New 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 <= 100
sentAt*Sentat
格式date-time
sourceId*Sourceid
格式uuid

响应正文

Successful Response

application/json
  1. response
accepted*Accepted
ackSeq*Ackseq

Highest seq up to which everything has been received

batchId*Batchid
格式uuid
duplicates*Duplicates
gaps*array<array<any>>

Missing seq ranges after ack_seq

rejected*array<>
serverTime*Servertime
格式date-time
请求示例
curl -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"}