Graph API-Version

Ad Account Adrules Library

Wird gelesen

AdAccountAdRulesLibrary

Beispiel

Graph API Explorer
GET /v21.0/{ad-account-id}/adrules_library 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}/adrules_library',
    '{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}/adrules_library",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{ad-account-id}/adrules_library",
    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}/adrules_library"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
Weitere Informationen zur Verwendung der Graph API findest du in unserem Graph API-Leitfaden.

Parameter

Dieser Endpunkt hat keine Parameter.

Felder

Beim Lesen dieses Edge wird ein Ergebnis im JSON-Format ausgegeben:

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

data

Eine Liste von AdRule-Nodes.

paging

Weitere Informationen zur Paginierung findest du im Graph API-Leitfaden.

Error Codes

FehlerBeschreibung
100Invalid parameter
190Invalid OAuth 2.0 Access Token
200Permissions error
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.

Wird erstellt

You can make a POST request to adrules_library edge from the following paths:
When posting to this edge, an AdRule will be created.

Parameter

ParameterBeschreibung
account_id
numeric string

Ad Account ID. This is inferred from the path.

evaluation_spec
Object

Defines the evaluation spec upon which a rule will be executed

erforderlich
evaluation_type
enum{SCHEDULE, TRIGGER}

erforderlich
filters
list<Object>

erforderlich
field
string

erforderlich
value
numeric, string, boolean, list<>, or object-like arrays

erforderlich
operator
enum{GREATER_THAN, LESS_THAN, EQUAL, NOT_EQUAL, IN_RANGE, NOT_IN_RANGE, IN, NOT_IN, CONTAIN, NOT_CONTAIN, ANY, ALL, NONE}

erforderlich
trigger
Object

type
enum{METADATA_CREATION, METADATA_UPDATE, STATS_MILESTONE, STATS_CHANGE, DELIVERY_INSIGHTS_CHANGE}

erforderlich
field
string

value
numeric, string, boolean, list<>, or object-like arrays

operator
enum{GREATER_THAN, LESS_THAN, EQUAL, NOT_EQUAL, IN_RANGE, NOT_IN_RANGE, IN, NOT_IN, CONTAIN, NOT_CONTAIN, ANY, ALL, NONE}

execution_spec
Object

Defines the execution spec upon which a rule will be executed

erforderlich
execution_type
enum{DCO, PING_ENDPOINT, NOTIFICATION, PAUSE, REBALANCE_BUDGET, CHANGE_BUDGET, CHANGE_BID, ROTATE, UNPAUSE, CHANGE_CAMPAIGN_BUDGET, ADD_INTEREST_RELAXATION, ADD_QUESTIONNAIRE_INTERESTS, INCREASE_RADIUS, UPDATE_CREATIVE, UPDATE_LAX_BUDGET, UPDATE_LAX_DURATION, AUDIENCE_CONSOLIDATION, AUDIENCE_CONSOLIDATION_ASK_FIRST, AD_RECOMMENDATION_APPLY}

erforderlich
execution_options
list<Object>

field
string

erforderlich
value
numeric, string, boolean, list<>, or object-like arrays

erforderlich
operator
enum{EQUAL, IN}

erforderlich
name
string

The friendly name of a rule, optional for inline rules

erforderlich
schedule_spec
Object

Specifies the schedule with which a rule will be evaluated

schedule_type
enum{DAILY, HOURLY, SEMI_HOURLY, CUSTOM}

erforderlich
schedule
list<Object>

start_minute
int64

end_minute
int64

days
list<int64>

status
enum {ENABLED, DISABLED, DELETED, HAS_ISSUES}

The status of a rule

Rückgabetyp

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}

Error Codes

FehlerBeschreibung
200Permissions error
100Invalid parameter
368The action attempted has been deemed abusive or is otherwise disallowed
2703Rules that turn off ads can't have cost conditions. You need to change the rule's conditions or action.
190Invalid OAuth 2.0 Access Token

Wird aktualisiert

Diese Handlung kann auf diesem Endpunkt nicht durchgeführt werden.

Wird gelöscht

Diese Handlung kann auf diesem Endpunkt nicht durchgeführt werden.