Versi Graph API

Pengguna Uji /{test-user-id}

Pengguna uji yang terkait dengan aplikasi Facebook. Pengguna uji dibuat dan dikaitkan menggunakan edge /{app-id}/accounts/test-users atau dalam Dasbor Aplikasi.

Panduan Terkait

Membaca

Izin dan kolom untuk operasi baca pada node iniidentik dengan node /{user-id} reguler.

Menerbitkan dan Memperbarui

Anda dapat menerbitkan ke node ini untuk memperbarui kata sandi atau nama pengguna uji.

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

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

Izin

  • Token akses aplikasi diperlukan untuk memperbarui kolom ini bagi pengguna uji yang terkait dengan aplikasi itu.

Kolom

Nama Deskripsi Jenis

name

Nama baru untuk pengguna uji.

string

password

Kata sandi baru untuk pengguna uji.

string

Tanggapan

Jika pembaruan berhasil, true, kalau gagal, akan ada pesan kesalahan.

Menghapus

Anda dapat menghapus pengguna uji dengan melakukan operasi hapus pada node ini.

DELETE /v19.0/{test-user-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(
    '/{test-user-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 */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{test-user-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:@"/{test-user-id}"
                                      parameters:params
                                      HTTPMethod:@"DELETE"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Izin

  • Token akses aplikasi untuk aplikasi yang terkait atau token akses pengguna uji itu sendiri harus digunakan untuk menghapus pengguna uji itu.
  • Pengguna uji tidak boleh dikaitkan dengan lebih dari satu aplikasi. Anda dapat membatalkan pengaitan pengguna uji menggunakan edge /{app-id}/accounts/test-users.

Kolom

Tidak ada kolom yang harus dihapus.

Tanggapan

Jika hapus berhasil, true, kalau gagal, akan ada pesan kesalahan.

Edge

Nama Deskripsi

/friends

Teman-teman pengguna uji - edge ini dapat digunakan untuk membuat dua pengguna uji berteman.