เวอร์ชันของ API กราฟ

Ad Rule

การอ่าน

A Rule that will be triggered based on certain criteria defined on ad objects, and perform custom actions.

พารามิเตอร์

จุดสิ้นสุดนี้ไม่ต้องพารามิเตอร์ใดๆ

ช่อง

ช่องคำอธิบาย
id
numeric string

ID of the rule

account_id
numeric string

ID of the ad account that owns the rule

created_by

The user who created the rule

created_time
datetime

Time when the rule was created

name
string

The friendly name of a rule, optional for inline rules

schedule_spec

Specifies the schedule with which a rule will be evaluated

status
string

The status of a rule

updated_time
datetime

The time when the rule was last updated.

จุดเชื่อมโยง

จุดเชื่อมโยงคำอธิบาย
Edge<AdRuleHistory>

The execution history associated with this rule. Each entry represents a distinct run of the rule and provides any actions that may have been taken on any ad objects.

Error Codes

ข้อผิดพลาดคำอธิบาย
100Invalid parameter
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

การสร้าง

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

พารามิเตอร์

พารามิเตอร์คำอธิบาย
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

ต้องระบุ
evaluation_type
enum{SCHEDULE, TRIGGER}

ต้องระบุ
filters
list<Object>

ต้องระบุ
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}

ต้องระบุ
trigger
Object

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

ต้องระบุ
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

ต้องระบุ
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}

ต้องระบุ
execution_options
list<Object>

field
string

ต้องระบุ
value
numeric, string, boolean, list<>, or object-like arrays

ต้องระบุ
operator
enum{EQUAL, IN}

ต้องระบุ
name
string

The friendly name of a rule, optional for inline rules

ต้องระบุ
schedule_spec
Object

Specifies the schedule with which a rule will be evaluated

schedule_type
enum{DAILY, HOURLY, SEMI_HOURLY, CUSTOM}

ต้องระบุ
schedule
list<Object>

start_minute
int64

end_minute
int64

days
list<int64>

status
enum {ENABLED, DISABLED, DELETED, HAS_ISSUES}

The status of a rule

ประเภทการส่งกลับ

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

Error Codes

ข้อผิดพลาดคำอธิบาย
200Permissions error
100Invalid parameter
190Invalid OAuth 2.0 Access Token
2703Rules that turn off ads can't have cost conditions. You need to change the rule's conditions or action.
368The action attempted has been deemed abusive or is otherwise disallowed

กำลังอัพเดต

คุณสามารถอัพเดต an AdRule ได้โดยส่งคำขอ POST ไปที่ /{ad_rule_id}

พารามิเตอร์

พารามิเตอร์คำอธิบาย
evaluation_spec
Object

Defines the evaluation spec upon which a rule will be executed

evaluation_type
enum{SCHEDULE, TRIGGER}

ต้องระบุ
filters
list<Object>

ต้องระบุ
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}

ต้องระบุ
trigger
Object

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

ต้องระบุ
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

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}

ต้องระบุ
execution_options
list<Object>

field
string

ต้องระบุ
value
numeric, string, boolean, list<>, or object-like arrays

ต้องระบุ
operator
enum{EQUAL, IN}

ต้องระบุ
name
string

The friendly name of a rule, optional for inline rules

schedule_spec
Object

Specifies the schedule with which a rule will be evaluated

schedule_type
enum{DAILY, HOURLY, SEMI_HOURLY, CUSTOM}

ต้องระบุ
schedule
list<Object>

start_minute
int64

end_minute
int64

days
list<int64>

status
enum {ENABLED, DISABLED, DELETED, HAS_ISSUES}

The status of a rule

ประเภทการส่งกลับ

This endpoint supports read-after-write and will read the node to which you POSTed.
Struct {
success: bool,
}

Error Codes

ข้อผิดพลาดคำอธิบาย
200Permissions error
368The action attempted has been deemed abusive or is otherwise disallowed
100Invalid parameter
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

กำลังลบ

You can delete an AdRule by making a DELETE request to /{ad_rule_id}.

พารามิเตอร์

จุดสิ้นสุดนี้ไม่ต้องพารามิเตอร์ใดๆ

ประเภทการส่งกลับ

Struct {
success: bool,
}

Error Codes

ข้อผิดพลาดคำอธิบาย
200Permissions error
368The action attempted has been deemed abusive or is otherwise disallowed
190Invalid OAuth 2.0 Access Token
100Invalid parameter