如要獲取觀眾目前對直播視像作出的回應或心情,請將要求傳送至:
GET /{live-video-id}/comments
GET /{live-video-id}/reactions
curl -i -X GET \
"https://graph.facebook.com/{live-video-id}/comments?access_token={access-token}"
{ "data": [ { "created_time": "2018-08-30T18:47:02+0000", "from": { "name": "Steph C.", "id": "552524095105158" }, "message": "This is such a great live stream.", "id": "911936075671494_911936769004758" }, { "created_time": "2018-08-30T18:47:17+0000", "from": { "name": "Kevin D.", "id": "552524095105158" }, "message": "Shoutout over here!", "id": "911936075671494_911936909004744" }, { "created_time": "2018-08-30T18:48:14+0000", "from": { "name": "Clay T.", "id": "552524095105158" }, "message": "Where is this place?", "id": "911936075671494_911937292338039" } ], "paging": { "cursors": { "before": "WTI5d...", "after": "WTI5d..." } } }
如欲了解有關可傳回欄位的資訊,以及篩選和排序指示,請參閱回應和心情關係連線參考資料。您可每隔幾秒鐘為回應和心情展開一次投票活動。
如要即時接收瀏覽器用戶端的回應和心情,請設定伺服器已傳送事件,並向以下端點傳送要求:
GET /{live-video-id}/live_comments
GET /{live-video-id}/live_reactions
請注意,串流影片事件的主機網址為:https://streaming-graph.facebook.com
GET https://streaming-graph.facebook.com/{live-video-id}/live_comments?access_token={access-token}
: ping data: { "created_time":"2018-08-30T21:11:01+0000", "id":"911936075671494_912014908996944", "view_id":43329028, "from": { "id":"552524095105158", "name":"Kerry Fisher" }, "message":"I love this video!" } : ping : ping