Represents a collection of test users on an app.
Get a list of test users on an app.
| Type | Requirement |
|---|---|
None |
GET /v25.0/{application-id}/accounts 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(
'/{application-id}/accounts',
'{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(
"/{application-id}/accounts",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{application-id}/accounts",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{application-id}/accounts"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];| Parameter | Description |
|---|---|
typeenum{test-users} | The type of user requested |
Reading from this edge will return a JSON formatted result:
{ "
data": [], "paging": {} }
dataThe following fields will be added to each node that is returned:
| Field | Description |
|---|---|
access_tokenstring | An access token that can be used to make API calls on behalf of this user |
paging| Error | Description |
|---|---|
| 190 | Invalid OAuth 2.0 Access Token |
| 100 | Invalid parameter |
| 104 | Incorrect signature |
accounts edge from the following paths: Upon successful creation, a login_url and access_token will be returned. You can use the login URL to log in as the test user. Login URLs expire once they are used, or after one hour if they are unused. An access token will only be returned if the installed parameter was set to true at the time of the query.
You can also use this edge to associate an existing test user with a different app by using the owner_acces_token parameter.
| Type | Requirement |
|---|---|
None |
| Parameter | Description |
|---|---|
installedboolean | Automatically installs the app for the test user once it is created or associated |
minorboolean | Is this test user a minor |
namestring | The name for the test user. When left blank, a random name will be automatically generated |
owner_access_tokenstring | When associating existing test users with other apps, this is the app access token of any app that is already associated with the test user. The |
permissionsList<Permission> | Default value: SetList of permissions that are automatically granted for the app when it is created or associated |
typeenum{test-users} | Type |
uidint | ID of an existing test user to associate with another app. Required when associating test users, but should not be used when creating new test users |
id in the return type.id: numeric string, access_token: string, login_url: string, email: string, password: string, | Error | Description |
|---|---|
| 2900 | Too many test accounts |
| 195 | The name you are trying to use is invalid |
/{application_id}/accounts.| Type | Requirement |
|---|---|
None |
At least one test user must be associated with an app. Attempting to perform this operation on an app's sole test user will result in error code 2902.
| Parameter | Description |
|---|---|
typeenum {TEST_USERS} | Account type |
uidUID | Account UID Required |
success: bool, | Error | Description |
|---|---|
| 2902 | Cannot remove test account from this app |