Versi Graph API

Permintaan /{request-id}

Permintaan game individu yang diterima seseorang, dikirim oleh aplikasi atau orang lain.

Panduan Terkait

Membaca

Graph API Explorer
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
}];

Izin

  • Token akses pengguna diperlukan jika Anda meminta hanya menggunakan ID objek Permintaan, dan ingin mengetahui tentang penerima permintaan. Permintaan harus dikirim kepada orang yang token aksesnya Anda gunakan.
  • Token akses aplikasi dapat digunakan saat Anda meminta menggunakan ID objek Permintaan gabungan dan string ID pengguna, atau saat Anda hanya menggunakan ID objek permintaan, tetapi tidak perlu mengetahui info penerima. Lihat dokumen Permintaan untuk info selengkapnya tentang ID ini.

Kolom

Nama Deskripsi Jenis

id

ID objek permintaan.

string

application

Aplikasi yang terkait dengan permintaan.

App

to

Penerima permintaan.

User

from

Pengirim terkait dengan permintaan. Ini hanya disertakan untuk permintaan pengguna ke pengguna.

User

message

String yang mendeskripsikan permintaan.

string

created_time

Cap waktu ini saat permintaan ini dibuat.

datetime

Penerbitan

Anda tidak dapat menerbitkan dengan endpoint ini.

Permintaan diterbitkan melalui Dialog Permintaan Game. Jika aplikasi Anda adalah Game, Anda dapat menerbitkan permintaan aplikasi dengan edge /{user-id}/apprequests.

Menghapus

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
}];

Izin

  • Token akses pengguna diperlukan jika Anda hanya menggunakan ID objek Permintaan. Permintaan juga harus dikirim kepada orang yang token aksesnya Anda gunakan.
  • Token akses aplikasi dapat digunakan saat Anda menggunakan ID objek Permintaan gabungan dan string ID pengguna.

Kolom

Tidak ada kolom yang harus dihapus.

Tanggapan

Jika berhasil:

{
  "success": true
}

Jika tidak, pesan kesalahan yang relevan akan ditampilkan.

Memperbarui

Anda tidak dapat memperbarui dengan endpoint ini.