Marketing API Version

Ad Set Adcreatives

Reading

The creatives of this ad set

Examples

To retrieve an ad set's ad creatives:

use FacebookAds\Object\AdSet;
use FacebookAds\Object\Fields\AdCreativeFields;

$adset = new AdSet(<AD_SET_ID>);
$adcreatives = $adset->getAdCreatives(array(AdCreativeFields::NAME));
from facebookads.adobjects.adset import AdSet
from facebookads.adobjects.adcreative import AdCreative

adset = AdSet(fbid=<AD_SET_ID>)
adset.get_ad_creatives([AdCreative.Field.object_story_id])
APINodeList<AdCreative> adCreatives = new AdSet(<AD_SET_ID>, context).getAdCreatives()
  .requestNameField()
  .execute();
curl -G \
  -d 'fields=name' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.10/<AD_SET_ID>/adcreatives
Graph API Explorer
GET /v2.10/{ad-set-id}/adcreatives HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{ad-set-id}/adcreatives'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{ad-set-id}/adcreatives",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{ad-set-id}/adcreatives",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{ad-set-id}/adcreatives"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

Developers usually request these permissions for this endpoint:

Marketing Apps
  • ads_management
Page management Apps
No data
Other Apps
No data

Parameters

This endpoint doesn't have any parameters.

Fields

Reading from this edge will return a JSON formatted result:

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

data

A list of AdCreative nodes.

paging

For more details about pagination, see the Graph API guide.

summary

Aggregated information about the edge, such as counts. Specify the fields to fetch in the summary param (like summary=total_count).

FieldDescription

total_count

unsigned int32

Total number of creatives returned by the query

Validation Rules

ErrorDescription
100Invalid parameter
200Permissions error
274The ad account is not enabled for usage in Ads API. Please add it in developers.facebook.com/apps -> select your app -> settings -> advanced -> advertising accounts -> Ads API

Creating

You can't perform this operation on this endpoint.

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.