그래프 API 버전

요청 /{request-id}

앱이나 다른 사용자가 보내고 어떤 사용자가 수신한 개별 게임 요청입니다.

관련 가이드

읽기

그래프 API 탐색기
GET /v19.0/{request-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(
    '/{request-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(
    "/{request-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{request-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:@"/{request-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

권한

  • 요청 개체 ID만 사용하여 요청 중이며 요청의 수신자에 대해 알고 싶을 경우 사용자 액세스 토큰이 필요합니다. 이 요청은 사용 중인 액세스 토큰의 소유 권한이 있는 사람에게 전송된 상태여야 합니다.
  • 연결된 요청 개체 ID와 사용자 ID 문자열을 사용하여 요청하거나, 요청 개체 ID만 사용 중이고 수신자 정보를 알 필요는 없는 경우 앱 액세스 토큰을 사용할 수 있습니다. 이 ID에 대한 자세한 내용은 요청 문서를 참조하세요.

필드

이름 설명 유형

id

요청 개체 ID.

string

application

요청과 연결된 앱.

App

to

요청의 수신자.

User

from

요청과 연결된 발송자. 사용자 간 요청에만 포함됩니다.

User

message

요청을 설명하는 문자열.

string

created_time

요청을 생성한 시점의 타임스탬프.

datetime

게시

이 엔드포인트를 사용하여 게시할 수 없습니다.

요청은 게임 요청 대화 상자를 통해 게시됩니다. 앱이 게임일 경우 /{user-id}/apprequests 에지를 사용하여 앱 요청을 게시할 수 있습니다.

삭제

DELETE /v19.0/{request-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->delete(
    '/{request-id}',
    array (),
    '{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(
    "/{request-id}",
    "DELETE",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{request-id}",
    null,
    HttpMethod.DELETE,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{request-id}"
                                      parameters:params
                                      HTTPMethod:@"DELETE"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

권한

  • 요청 개체 ID만 사용 중인 경우 사용자 액세스 토큰이 필요합니다. 이 요청은 사용 중인 액세스 토큰의 소유 권한이 있는 사람에게도 전송된 상태여야 합니다.
  • 연결된 요청 개체 ID와 사용자 ID 문자열을 사용 중인 경우 앱 액세스 토큰을 사용할 수 있습니다.

필드

삭제하는 데 필요한 필드가 없습니다.

응답

성공한 경우:

{
  "success": true
}

실패할 경우 관련 오류 메시지가 반환됩니다.

업데이트

이 엔드포인트를 사용하여 업데이트할 수 없습니다.