Versione API Graph

Ad Account, Assigned Users

Lettura

Business and system users assigned to this Ad Account.

Esempio

Graph API Explorer
GET /v21.0/{ad-account-id}/assigned_users 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(
    '/{ad-account-id}/assigned_users',
    '{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(
    "/{ad-account-id}/assigned_users",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{ad-account-id}/assigned_users",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{ad-account-id}/assigned_users"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
Se desideri scoprire come usare l'API Graph, leggi la nostra Guida per l'utilizzo dell'API Graph.

Parametri

ParametroDescrizione
business
numeric string or integer

The business associated with this Ad Account

Obbligatorio

Campi

La lettura da questo segmento fornirà un risultato formattato JSON:

{ "data": [], "paging": {}, "summary": {} }

data

Una lista di nodi AssignedUser.

I campi seguenti verranno aggiunti a ogni nodo restituito:

CampoDescrizione
permitted_tasks
list<string>

Tasks that are assignable on this object

tasks
list<string>

All unpacked roles/tasks of this particular user on this object

paging

Per ulteriori dettagli sulla paginazione, consulta la Guida su API Graph.

summary

Informazioni aggregate sul segmento, ad esempio i numeri. Specifica i campi per recuperare il parametro del riepilogo (come riepilogo=total_count).

CampoDescrizione
total_count
unsigned int32

Total number of business and system users assigned to this Ad Account

Error Codes

ErroreDescrizione
100Invalid parameter
190Invalid OAuth 2.0 Access Token
368The action attempted has been deemed abusive or is otherwise disallowed
80004There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting#ads-management.
200Permissions error

Creazione

Non puoi eseguire questa operazione in questo endpoint.

Aggiornamento

In v3.1 we introduce the new concept of task-based permissions to substitute for the current role-based permission. This affects access to ad accounts managed by Business Manager API and Pages. Role-based access to ad accounts and Pages is still available but will be deprecated in the future. This impacts the following roles and provides the equivalent tasks for ad accounts:

  • Role: ADMIN, Tasks: ['MANAGE', 'ADVERTISE', 'ANALYZE' - Manage all aspects of ad campaigns, reporting, billing and ad account permissions.
  • Role: GENERAL_USER, Tasks: ['ADVERTISE', 'ANALYZE'] - Create ads using the funding source associated with the ad account. Run reports.
  • Role: GENERAL_USER, Tasks: ['ANALYZE'] - Run reports.

This replaces the following roles in Business Manager API with these tasks:

  • Role: MANAGER, Tasks: ['MANAGE', 'CREATE_CONTENT', 'MODERATE', 'ADVERTISE', 'ANALYZE', 'DRAFT']
  • Role: CONTENT_CREATOR, Tasks: ['CREATE_CONTENT', 'MODERATE', 'ADVERTISE', 'ANALYZE', 'DRAFT']
  • Role: MODERATOR, Tasks: ['MODERATE', 'ADVERTISE', 'ANALYZE', 'DRAFT']
  • Role: ADVERTISER, Tasks: ['ADVERTISE', 'ANALYZE', 'DRAFT']
  • Role: INSIGHTS_ANALYST, Tasks: ['ANALYZE', 'DRAFT']
  • Role: CREATIVE_HUB_MOCKUPS_MANAGER, Tasks: ['DRAFT']
Puoi aggiornare an AdAccount effettuando una richiesta POST a /act_{ad_account_id}/assigned_users.

Parametri

ParametroDescrizione
tasks
array<enum {MANAGE, ADVERTISE, ANALYZE, DRAFT, AA_ANALYZE}>

AdAccount permission tasks to assign this user

user
UID

Business user id or system user id

Obbligatorio

Tipo di ricavo

Questo endopoint supporta read-after-write e leggerà il nodo in cui hai effettuato una richiesta POST.
Struct {
success: bool,
}

Error Codes

ErroreDescrizione
100Invalid parameter
200Permissions error
2620Invalid call to update account permissions
190Invalid OAuth 2.0 Access Token

Eliminazione

You can dissociate a User from an AdAccount by making a DELETE request to /act_{ad_account_id}/assigned_users.

Parametri

ParametroDescrizione
user
UID

Business user id or system user id

Obbligatorio

Tipo di ricavo

Struct {
success: bool,
}

Error Codes

ErroreDescrizione
3919There was an unexpected technical issue. Please try again.
100Invalid parameter
368The action attempted has been deemed abusive or is otherwise disallowed