與 Facebook 應用程式相關聯的測試用戶。測試用戶是透過 /{app-id}/accounts/test-users
關係連線或在應用程式主控板中建立或產生關聯。
此節點上的讀取操作權限和欄位與一般 /{user-id}
節點的權限和欄位相同。
您可以發佈至此節點來更新測試用戶的密碼或名稱。
POST /v21.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 /v21.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
,否則會出現錯誤訊息。
名稱 | 說明 |
---|---|
測試用戶的朋友 - 此關係連線可用於讓兩個測試用戶成為朋友。 |