Marketing API Version

Ad Account Ad Images

Reading

The images associated with this account

Graph API Explorer
GET /v2.10/{ad-account-id}/adimages HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{ad-account-id}/adimages'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{ad-account-id}/adimages",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{ad-account-id}/adimages",
    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-account-id}/adimages"
                                      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

NameDescription
biz_tag_id
int64

business tag id to filter images

business_id
numeric string or integer

optional param assist with filters such as recently used

hashes
list<string>

hashes

minheight
int64

minheight

minwidth
int64

minwidth

name
string

image name used in image names filter

Fields

Reading from this edge will return a JSON formatted result:

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

data

A list of AdImage 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 images in the ad account

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
278Reading advertisements requires an access token with the extended permission ads_read
272This Ads API call requires the user to be admin of the application

Creating

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

Parameters

NameDescription
bytes
Base64 UTF-8 string

image file.
bytes = <image content in bytes format>, see example

copy_from
JSON or object-like arrays

This copies the adimage from the source to the destination account.
{"source_account_id":"<SOURCE_ACCOUNT_ID>", "hash":"02bee5277ec507b6fd0f9b9ff2f22d9c"}

source_account_id
numeric string
hash
string
zipbytes
Base64 UTF-8 string

zip file of image

Return Type

This endpoint supports read-after-write and will read the node to which you POSTed.
Map {
string: Map {
string: Struct {
hash: string,
url: string,
}
}
}

Validation Rules

ErrorDescription
2633This shared login is disabled. Go to Ads Manager for more information.
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
294Managing advertisements requires an access token with the extended permission for ads_management

Updating

You can't perform this operation on this endpoint.

Deleting

You can dissociate an AdImage from an AdAccount by making a DELETE request to /act_{ad_account_id}/adimages.

Parameters

NameDescription
hash
string

hash of the image you wish to delete

Required

Return Type

Struct {
success: bool,
}

Validation Rules

ErrorDescription
100Invalid parameter