我尝试使用REST API来获取已经完成的房间列表。对于the documentation,对https://video.twilio.com/v1/Rooms的简单GET应返回一个房间列表,并可选择按状态过滤。
然而,当我们在我们的应用程序上运行它时,我们得到一个空列表。预期的行为是房间列表,适用于所有状态(我们特别感兴趣的是获取已完成的房间,因为我们正在尝试访问他们的录音,为此您需要特定房间的Sid):< / p>
{
"meta": {
"page": 0,
"page_size": 50,
"first_page_url": "https://video.twilio.com/v1/Rooms?PageSize=50&Page=0",
"previous_page_url": null,
"url": "https://video.twilio.com/v1/Rooms?PageSize=50&Page=0",
"next_page_url": null,
"key": "rooms"
},
"rooms": []
}
从此列表中获取任何结果的唯一方法是,当有空间正在进行中时,
{
"meta": {
"page": 0,
"page_size": 50,
"first_page_url": "https://video.twilio.com/v1/Rooms?PageSize=50&Page=0",
"previous_page_url": null,
"url": "https://video.twilio.com/v1/Rooms?PageSize=50&Page=0",
"next_page_url": null,
"key": "rooms"
},
"rooms": [
{
"status": "in-progress",
"unique_name": "Llao",
"date_updated": "2018-06-01T10:37:04Z",
"video_codecs": [
"VP8",
"H264"
],
"max_participants": 50,
"record_participants_on_connect": true,
"enable_turn": true,
"account_sid": "AC5cd19c83a4278a81a21e8e7bcdfbed04",
"url": "https://video.twilio.com/v1/Rooms/RM1a1481f87cd9e10d0e58cdd22cefc5a4",
"end_time": null,
"sid": "RM1a1481f87cd9e10d0e58cdd22cefc5a4",
"duration": null,
"date_created": "2018-06-01T10:36:51Z",
"media_region": "us1",
"type": "group",
"status_callback_method": "POST",
"status_callback": null,
"links": {
"recordings": "https://video.twilio.com/v1/Rooms/RM1a1481f87cd9e10d0e58cdd22cefc5a4/Recordings",
"participants": "https://video.twilio.com/v1/Rooms/RM1a1481f87cd9e10d0e58cdd22cefc5a4/Participants"
}
},
{
"status": "in-progress",
"unique_name": "1",
"date_updated": "2018-06-01T10:36:19Z",
"video_codecs": [
"VP8",
"H264"
],
"max_participants": 50,
"record_participants_on_connect": true,
"enable_turn": true,
"account_sid": "AC5cd19c83a4278a81a21e8e7bcdfbed04",
"url": "https://video.twilio.com/v1/Rooms/RM9e8d2b723a2775c4bff98d9692ff192a",
"end_time": null,
"sid": "RM9e8d2b723a2775c4bff98d9692ff192a",
"duration": null,
"date_created": "2018-06-01T10:35:36Z",
"media_region": "us1",
"type": "group",
"status_callback_method": "POST",
"status_callback": null,
"links": {
"recordings": "https://video.twilio.com/v1/Rooms/RM9e8d2b723a2775c4bff98d9692ff192a/Recordings",
"participants": "https://video.twilio.com/v1/Rooms/RM9e8d2b723a2775c4bff98d9692ff192a/Participants"
}
}
]
}
那么我们如何获得所有房间的完整日志?
必须有办法让Twilio的控制面板类似: