그래프 API 버전

테스트 사용자 /{test-user-id}

Facebook 앱과 연결된 테스트 사용자. 테스트 사용자는 /{app-id}/accounts/test-users 에지를 사용하여, 또는 앱 대시보드에서 생성되고 연결됩니다.

관련 가이드

읽기

이 노드에서의 읽기 작업을 위한 권한과 필드는 일반 /{user-id} 노드의 권한 및 필드와 동일합니다.

게시 및 업데이트

이 노드로 게시하여 테스트 사용자의 비밀번호나 이름을 업데이트할 수 있습니다.

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

권한

  • 해당 앱과 연결된 테스트 사용자의 이러한 필드를 업데이트하려면 앱 액세스 토큰이 필요합니다.

필드

이름 설명 유형

name

테스트 사용자의 새로운 이름.

string

password

테스트 사용자의 새로운 비밀번호.

string

응답

업데이트가 성공할 경우 true가 되고 그렇지 않으면 오류 메시지가 표시됩니다.

삭제

이 노드에서 삭제 작업을 수행하여 테스트 사용자를 삭제할 수 있습니다.

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

권한

  • 관련된 앱의 앱 액세스 토큰이나 테스트 사용자의 자체 액세스 토큰을 사용해서 해당 테스트 사용자를 삭제해야 합니다.
  • 테스트 사용자는 하나의 앱만 남기고 나머지 앱과 연결을 해제해야 합니다. /{app-id}/accounts/test-users 에지를 사용하여 테스트 사용자를 해제할 수 있습니다.

필드

삭제하는 데 필요한 필드가 없습니다.

응답

삭제가 성공할 경우 true가 되고 그렇지 않으면 오류 메시지가 표시됩니다.

에지

이름 설명

/friends

테스트 사용자의 친구 - 이 에지는 두 테스트 사용자가 친구를 맺는 데 사용할 수 있습니다.