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:

 

facebook api之Ad的更多相关文章

  1. facebook api之Ads Insights API

    The Ads Insights API provides API access for reporting and analytics purposes. When exclusively usin ...

  2. facebook api介绍

    转自(http://sls.weco.net/node/10773) 一.Facebook API 基礎概念 Facebook API 概論 : API 最大的好處在於可以讓程式開發人員只需要根據 A ...

  3. facebook api & oauth protocal

    http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-10.5 http://stackoverflow.com/questions/14 ...

  4. Facebook API 入门

    Facebook 商业价值简介 Facebook 是一个社交网络服务网站,于 2004 年 2 月 4 日上线,到 2010 年 2 月 2 日, Facebook 正赶超雅虎将成为全球第三大网站,与 ...

  5. facebook api之基本概念(中文)

    Facebook广告API系列 1 Facebook Graph API Facebook提供了一套类rest的接口,统称为Graph API.为啥叫Graph?因为facebook把所有的资源都抽象 ...

  6. facebook api之Access Tokens之Business Manager System User

    Business Manager System User Make programatic, automated actions on ad objects or Pages, or do progr ...

  7. facebook api之Access and Authentication

    Access and Authentication There are three access levels to the Marketing APIs. You can upgrade acces ...

  8. facebook api之Marketing API

    General information on the Marketing APIs, access, versioning and more. The main use cases for the M ...

  9. facebook api之Business Manager API

    Business-scoped Users - The new user is tied to a particular business and has permissions scoped to ...

随机推荐

  1. 大数据处理框架之Strom:容错机制

    1.集群节点宕机Nimbus服务器 单点故障,大部分时间是闲置的,在supervisor挂掉时会影响,所以宕机影响不大,重启即可非Nimbus服务器 故障时,该节点上所有Task任务都会超时,Nimb ...

  2. java 泛型E T ?的区别

    Java泛型中的标记符含义:  E - Element (在集合中使用,因为集合中存放的是元素) T - Type(Java 类) K - Key(键) V - Value(值) N - Number ...

  3. python遍历目录os.walk(''d:\\test2",topdown=False)

    os.walk(top, topdown=True, onerror=None, followlinks=False)遍历目录,topdown=false表示先返回目录,后返回文件 参数说明: top ...

  4. Linux基础命令---修改用户密码

    passwd 更改用户密码,超级用户可以修改所有用户密码,普通用户只能修改自己的密码.这个任务是通过调用LinuxPAM和LibuserAPI来完成的.本质上,它使用LinuxPAM将自己初始化为一个 ...

  5. go语言,golang学习笔记4 用beego跑一个web应用

    go语言,golang学习笔记4 用beego跑一个web应用 首页 - beego: 简约 & 强大并存的 Go 应用框架https://beego.me/ 更新的命令是加个 -u 参数,g ...

  6. bootsrtap h5 移动版页面 在苹果手机ios滑动上下拉动滚动卡顿问题解决方法

    bootsrtap h5 移动版页面 在苹果手机ios滑动上下拉动滚动卡顿问题解决方法 bootsrtap框架做的h5页面,在android手机下没有卡顿问题,在苹果手机就一直存在这问题,开始毫无头绪 ...

  7. Javascript创建类的七种方法

    /* 第一种定义类的方法 */var cls = new Object();cls.name = "wyf";cls.showName = function(){console.l ...

  8. Codeforces 937A - Olympiad

    A. Olympiad 题目链接:http://codeforces.com/problemset/problem/937/A time limit per test 1 second memory ...

  9. 发布webservice服务

    1,定义一个接口 public interface HaiService { //定义一个方法 String speak(String str); } 2,编写一个实现类 import javax.j ...

  10. kivy中size和pos的使用

    kivy中位置和大小属性的使用: -------------------位置---------------------------- 1.pos_hint(‘x-axis-key’:value,’y- ...