Versi Graph API

Utas /{thread-id}

Utas percakapan Pesan Facebook. Endpoint ini hanya dapat diakses oleh pengguna yang merupakan developer aplikasi yang membuat permintaan.

Halaman seharusnya menggunakan endpoint Percakapan.

Membaca

Mendapatkan utas pesan.

Izin

Contoh

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

Kolom

Nama Deskripsi Jenis

id

ID unik untuk utas pesan ini.

string

comments

Pesan-pesan dalam utas ini.

Message[]

to

Profil yang berlangganan utas.

Profile[]

unread

Jumlah pesan yang belum dibaca oleh profil sesi.

integer

unseen

Jumlah pesan yang tidak dilihat oleh profil sesi.

integer

updated_time

Saat utas terakhir diperbarui.

datetime

can_reply

Bisakah halaman membalas di utas?

boolean

linked_group

ID grup Workplace yang tertaut ke utas (hanya Workplace)

string

Edge

Nama Deskripsi

messages

Daftar pesan individu di utas. Lihat Pesan

Memfilter Pesan

Koneksi messages dapat difilter untuk agar tidak menarik teks yang merupakan bagian dari peringatan utas oleh Aplikasi Messenger. Ini dilakukan melalui filter source, hanya ada peserta yang mungkin dipilih.

Jika filter ini tidak berlaku, teks admin (teks abu-abu muncul di utas oleh Messenger) akan diambil juga.

Contoh

Panggilan ini akan mengambil 3 pesan terakhir yang dibuat hanya oleh peserta.

curl -i -X GET \
 "https://graph.facebook.com/v4.0/t_10155839492600149?fields=id,messages.source(PARTICIPANTS).limit(3)&access_token=<Access Token>"

Penerbitan

Anda tidak dapat melakukan operasi ini di endpoint ini.

Menghapus

Anda tidak dapat melakukan operasi ini di endpoint ini.

Memperbarui

Anda tidak dapat melakukan operasi ini di endpoint ini.