영상 제작자 및 방송 관계자들이 시청자와 소통할 수 있도록 라이브 방송 API를 사용하여 라이브 방송에 대한 댓글과 공감을 가져올 수 있습니다. 정기적으로 LiveVideo 개체를 쿼리하여 최신 댓글과 공감을 가져오거나 SSE(Server-Sent Event)를 설정하여 실시간 댓글과 공감을 수신할 수 있습니다.
라이브 방송에서 최신 댓글이나 공감을 가져오려면 다음으로 요청을 보내세요.
GET /{live-video-id}/commentsGET /{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..."
}
}
}반환 가능한 필드, 필터링 및 정렬 지침에 대한 내용은 댓글과 공감 에지 참고 자료를 참조하세요. 댓글과 공감은 몇 초에 한 번씩 가져올 수 있습니다.
브라우저 클라이언트에서 실시간으로 댓글과 공감을 수신하려면 SSE(Server-Sent Event)를 설정하고 다음 엔드포인트로 요청을 보내세요.
GET /{live-video-id}/live_commentsGET /{live-video-id}/live_reactions
스트리밍 이벤트의 호스트 URL은 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