그래프 API 버전

Video Poll

읽기

Embedded video poll

Feature Permissions

이름설명
라이브 동영상 API기능 권한이 필요할 수도 있습니다.

Graph API Explorer
GET /v19.0/{video-poll-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{video-poll-id}',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{video-poll-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{video-poll-id}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{video-poll-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
그래프 API를 사용하는 방법을 알아보려면 그래프 API 사용 가이드를 읽어보세요.

매개변수

이 엔드포인트는 매개변수가 없습니다.

필드

필드설명
id
numeric string

The poll ID

question
string

The poll question text

show_results
bool

True if this is a Live poll and voting is open and the results show after voting

status
enum {closed, voting_open, results_open}

Live poll status

에지

Edge설명
Edge<VideoPollOption>

Options available on this poll

오류 코드

오류설명
100Invalid parameter

만들기

다음 경로에서 polls 에지에 POST 요청을 만들 수 있습니다:
이 에지에 게시할 때 a VideoPoll이(가) 생성됩니다.

매개변수

매개변수설명
correct_option
int64

Number of the correct option (in order, starting from 1)

options
array<string>

Text options for users to select in order

필수
question
string

Question text

필수
show_results
boolean

True to show the results after voting, otherwise false

반환 유형

이 엔드포인트는 기록 후 읽기를 지원하며 반환 유형에서 id로 표시되는 노드를 읽습니다.
Struct {
id: numeric string,
option_ids: List [
numeric string
],
}

오류 코드

오류설명
200Permissions error
100Invalid parameter

업데이트 중

/{video_poll_id}에 POST 요청을 하여 a VideoPoll을(를) 업데이트할 수 있습니다.

매개변수

매개변수설명
action
enum {ATTACH_TO_VIDEO, CLOSE, SHOW_VOTING, SHOW_RESULTS, DELETE_POLL}

Change state for the poll

필수
show_results
boolean

True if the viewer sees results after voting, false if they do not

반환 유형

이 엔드포인트는 기록 후 읽기를 지원하며 반환 유형에서 id로 표시되는 노드를 읽습니다.
Struct {
success: bool,
}

오류 코드

오류설명
100Invalid parameter

삭제 중

이 엔드포인트에서 수행할 수 없는 작업입니다.