The Facebook API ad

Source: Internet
Author: User
Tags http post

Ad

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

You can still create Event ads and Link ads If you provide a valid in the actor_id ad Creative's object_story_id or fields object_story_spec

These options used together is valid:

    • Event Ads
      • Objective:EVENT_RESPONSES
      • Creative fields: object_story_id orobject_story_spec
    • Link Ads
      • Objective:LINK_CLICKS
      • Creative fields: object_story_id orobject_story_spec

The nodes, edges and requests impacted are:

    • ad_ACCOUNT_ID/ads, Create
    • ad_ACCOUNT_ID/adcreatives, Create
    • /ad_ID, Update

Any pre-existing Event or Link Ads continue to run and 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 creativecurl-f "[email protected]"-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 callcurl-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:

    • Ad Campaign, ad Set, and ad Creative
    • Ad Statistics
    • Storing Ad Objects

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 idcurl-g-D "fields=name"-D "access_token=<access_token>" "Https://graph.facebook.com/<API_VERSION >/<AD_ID> "#By AD accountcurl-g-D" fields=name "-D" access_token=<access_token> "" https:// Graph.facebook.com/<api_version>/act_<ad_account_id>/ads "#By AD campaigncurl-f" Fields=name "-F" access _token=<access_token> "" Https://graph.facebook.com/<API_VERSION>/<CAMPAIGN_ID>/ads "#By ad Setcurl-f "Fields=name"-F "access_token=<access_token>" "https://graph.facebook.com/<API_VERSION>/ <ad_set_id>/ads "

Detail more ...

Creating

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

new ads is in pending state and does not run until Facebook app Roves or rejects them . After we approve an ad it runs. If you don't want an ad to automatically run after approval, create it and set it to  paused , See a D set. Run The set when you is ready.

 #Synchronous creation#creates one ad at a time:curl-f ' name=my ad '-F ' adset_i D=<ad_set_id> '-F ' creative={"creative_id": "<CREATIVE_ID>"} '-F ' status=paused '-f ' access_token=<acc Ess_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'll 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 can make a POST request to adsEdge from the following paths:
    • /act_{ad_account_id}/ads

#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

  

Perform a POST request to the following edges from this node:

    • /{ad_id}/leads
    • /{ad_id}/insights

#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 Namecurl-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 the Ad by making a POST request to /{ad_id} .

Perform a POST request to the following edge from this node:

    • /{ad_id}/adlabels

#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_toke N> "" Https://graph.facebook.com/<api_version>/<ad_id> "

  

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

Perform a DELETE request to the following edge from this node:

    • /{ad_id}/adlabels

The Facebook API ad

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.