グラフ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
}

成功しなかった場合は、関連するエラーメッセージが返されます。

更新

このエンドポイントを使って更新することはできません。