Ad

Contains information to display an ad and associate it an ad set. Each ad is associated with an ad set and all ads in a set have the same daily or lifetime budget, schedule, and targeting. Creating multiple ads in an ad set helps optimize their delivery based on variations in images, links, video, text or placements.

You can still create Event Ads and Link Ads if you provide a valid actor_id in the ad creative's object_story_id or object_story_spec fields

These options used together are valid:

  • Event Ads

    • Objective: EVENT_RESPONSES
    • Creative fields: object_story_id or object_story_spec
  • Link Ads
    • Objective: LINK_CLICKS
    • Creative fields: object_story_id or object_story_spec

The nodes, edges and requests impacted are:

Any pre-existing Event or Link Ads continue to run but you cannnot modify these ad's creatives or create new ads with the invalid options once the change goes in effect.

#Creating an ad:

# Upload image for your ad creative
curl \
-F "image.jpg=@myimage.jpg" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adimages" # Provide ad creative with image hash ID returned in previous call
curl \
-F "name=sample creative" \
-F "title=hello world" \
-F "body=hi i'm an ad" \
-F "object_url=www.facebook.com" \
-F "image_hash=<IMAGE_HASH>" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adcreatives" # Create ad with ad creative.
curl \
-F "name=my ad" \
-F "adset_id=<AD_SET_ID>" \
-F "creative={'creative_id':<AD_CREATIVE_ID>}" \
-F "status=PAUSED" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/ads" # Asynchronous creation.
curl \
-F "name=testasyncset" \
-F "ad_specs=
[{'name':'name 1',
'adset_id':'<AD_SET_ID>',
'creative':{'creative_id':<AD_CREATIVE_ID>}},
{'name':'name 2',
'adset_id':'<AD_SET_ID>',
'creative':{'creative_id':<AD_CREATIVE_ID>}}]" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/asyncadrequestsets"

detail more……

See:

An ad object contains the data necessary to visually display an ad and associate it with a corresponding ad set.

Permissions

Developers usually request these permissions for this endpoint:

Marketing Apps

  • ads_management
  • ads_read

Page management Apps

  No data

Other Apps

  No data
 
#By ad ID
curl -G \
-d "fields=name" \
-d "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/<AD_ID>" #By ad account
curl -G \
-d "fields=name" \
-d "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/ads" #By ad campaign
curl \
-F "fields=name" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/<CAMPAIGN_ID>/ads" #By ad set
curl \
-F "fields=name" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/<AD_SET_ID>/ads"

detail more……

Creating

Before you create an ad, you need an existing ad set and ad creative. You can create ads synchronously and asynchronously.

New ads are in pending state and do not run until Facebook approves or rejects them. After we approve an ad it runs. If you do not want an ad to automatically run after approval, create it and set it to paused, see ad set. Run the set when you are ready.

#Synchronous Creation
#Creates one ad at a time:
curl \
-F 'name=My Ad' \
-F 'adset_id=<AD_SET_ID>' \
-F 'creative={"creative_id":"<CREATIVE_ID>"}' \
-F 'status=PAUSED' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/ads #Asynchronous Creation
#Create multiple ads at a time asynchronously. Receive a notification when all the ads in the request exist.
#Make an HTTP POST to: https://graph.facebook.com/{API_VERSION}/act_{AD_ACCOUNT_ID}/asyncadrequestsets #Download details for an ad:
curl \
-F "name=my ad" \
-F "adset_id=<AD_SET_ID>" \
-F "creative={'creative_id':<AD_CREATIVE_ID>}" \
-F "redownload=true" \
-F "status=PAUSED" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/ads" #You can make a POST request to copies edge from the following paths:
#/{ad_id}/copies
#When posting to this edge, an Ad will be created.

detail more…… 

Permissions

Developers usually request these permissions for this endpoint:

Marketing Apps

    • ads_management
    • ads_read
    • manage_pages
    • pages_show_list
    • business_management

Page management Apps

  No data

Other Apps

  No data
 
 
 
You can make a POST request to ads edge from the following paths:

#
curl -X POST \
-d "name=My+Ad" \
-d "adset_id=%7Bad-campaign-group-id%7D" \
-d "creative=%7B%22creative_id%22%3A%22%7Bi-ent-ad-creative-core-id%7D%22%7D" \
-d "status=PAUSED" \
https://graph.facebook.com/v2.12/act_{ad-account-id}/ads

  

You may perform a POST request to the following edges from this node:

#Updating

#Update certain fields:
curl \
-F "name=New Ad Name" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/<AD_ID>" #Update the name
curl \
-F "name=newname" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/<AD_ID>" #Update the status:
curl \
-F "status=ADGROUP_PAUSED" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/<AD_ID>" curl -X POST \
-d "name=My+New+Ad" \
https://graph.facebook.com/v2.12/{adgroup-id}/

detail more…… 

 

You can update an Ad by making a POST request to /{ad_id}.

You may perform a POST request to the following edge from this node:

#Deleting

#Deleting an ad
#You can remove values for any optional fields by updating the value to empty.
#You cannot delete ads in ad set with creative_sequence settings.
curl \
-F "status=DELETED" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/<AD_ID>"

  

You can delete an Ad by making a DELETE request to /{ad_id}.

You may perform a DELETE request to the following edge from this node:

 

最新文章

  1. Tomcat基于虚拟路径的发布和web.xml配置
  2. 基于MVC4+EasyUI的Web开发框架经验总结(7)--实现省份、城市、行政区三者联动
  3. objective-c系列-NSMutableArray
  4. codepage IMLangCodePages
  5. 【Matplotlib】绘图常见设置说明
  6. Liunx更新源
  7. Exception in thread &quot;main&quot; brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command
  8. [转] java Class类
  9. python升级导致的坑
  10. WinFrom - DataGridView控件右键选中记录并弹出菜单
  11. cocos2d-x 3.0来做一个简单的游戏教程 win32平台 vs2012 详解献给刚開始学习的人们!
  12. 设置ZooKeeper服务器地址列表源码解析及扩展
  13. sql连接语句
  14. 九、VueJs 填坑日记之在项目中使用jQuery
  15. 自定义class类的简单使用
  16. 洛谷P4581 [BJOI2014]想法(玄学算法,拓扑排序)
  17. 配置go语言编辑环境 - goland
  18. shell中十种实现自加的方法
  19. Android改进版CoverFlow效果控件
  20. Elasticsearch cluster health: yellow unassigned shards

热门文章

  1. 【Redis学习之五】Redis数据类型:列表和散列
  2. GridFS Example
  3. flask 数据库操作(增删改查)
  4. 20165316 实验四 Android程序设计
  5. PIVOT(透视转换)和UNPIVOT(逆透视转换)
  6. 第一节 JavaScript概述
  7. Vim常用命令:移动 跳转 到 文档开头或末尾
  8. 11.2.0.4 sql*loader/oci direct load导致kpodplck wait before retrying ORA-54
  9. Android - Resource 之 Layout 小结
  10. ORACLE 12c 配置PL/SQL 并登录