Versione API Graph

Custom Audience Ads

Lettura

Esempio

Graph API Explorer
GET /v19.0/{custom-audience-id}/ads 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(
    '/{custom-audience-id}/ads',
    '{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(
    "/{custom-audience-id}/ads",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{custom-audience-id}/ads",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{custom-audience-id}/ads"
                                      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
effective_status
list<string>

Status of the ad

status
list<string>

The effective status of the ad. The field returns the same value as 'effective_status', and is the suggested one to use.

Campi

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

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

data

Una lista di nodi Ad.

paging

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

Error Codes

ErroreDescrizione
100Invalid parameter
200Permissions error
368The action attempted has been deemed abusive or is otherwise disallowed
270This Ads API request is not allowed for apps with development access level (Development access is by default for all apps, please request for upgrade). Make sure that the access token belongs to a user that is both admin of the app and admin of the ad account
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.
190Invalid OAuth 2.0 Access Token
80003There 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#custom-audience.

Creazione

Non puoi eseguire questa operazione in questo endpoint.

Aggiornamento

Non puoi eseguire questa operazione in questo endpoint.

Eliminazione

Non puoi eseguire questa operazione in questo endpoint.