Versi Graph API

Kabar Grup

Postingan milik Grup, termasuk pembaruan status dan tautan.

Membaca

Menampilkan array Postingan di Grup.

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

Persyaratan

Jenis PersyaratanDeskripsi

Tinjauan Aplikasi

Aplikasi Anda harus disetujui untuk fitur API Grup.

Penginstalan Aplikasi

Aplikasi harus diinstal di Grup.

Token

Token akses Pengguna atau token akses Halaman.

Catatan

  • Parameter since dan until diterapkan pada kolom updated_time.

Penerbitan

POST /v19.0/{group-id}/feed HTTP/1.1
Host: graph.facebook.com

message=This+is+a+test+message
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{group-id}/feed',
    array (
      'message' => 'This is a test message',
    ),
    '{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(
    "/{group-id}/feed",
    "POST",
    {
        "message": "This is a test message"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("message", "This is a test message");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{group-id}/feed",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
NSDictionary *params = @{
  @"message": @"This is a test message",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{group-id}/feed"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Persyaratan

Jenis PersyaratanDeskripsi

Tinjauan Aplikasi

Aplikasi Anda harus disetujui untuk izin dan fitur login berikut: (Klik untuk memperluas)

Izin Login

publish_to_groups

Fitur

API Grup

Penginstalan Aplikasi

Aplikasi harus diinstal di Grup.

Token

Token akses Pengguna dari anggota Grup.

Izin

Pengguna harus memberi aplikasi Anda izin berikut:

publish_to_groups

Kolom

NamaJenisDeskripsi

message

string

Badan utama dari postingan, jika tidak disebut pesan status. link atau message harus disediakan.

link

string

URL tautan untuk dilampirkan ke postingan. link atau message harus disediakan. Kolom tambahan yang berhubungan dengan link ditampilkan di bawah ini.

Tanggapan

Jika berhasil, Anda akan menerima tanggapan dengan informasi berikut. Selain itu, endpoint ini mendukung baca setelah tulis (RAW) dan dapat langsung memberikan kolom apa pun yang diberikan oleh operasi baca.

Nama Deskripsi Jenis

id

ID postingan yang baru dibuat

string

Memperbarui

Operasi ini tidak didukung.

Menghapus

Operasi ini tidak didukung.