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
}];
名前 | 説明 | 型 |
---|---|---|
| テストユーザーの新しい名前。 |
|
| テストユーザーの新しいパスワード。 |
|
更新が成功した場合は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
が返され、それ以外の場合はエラーメッセージが返されます。
名前 | 説明 |
---|---|
テストユーザーの友達 - このエッジを使用して2人のテストユーザーを友達にできます。 |