グラフAPIバージョン

Ad Account Ad Images

読み取り

Ad Images that belong to this Ad Account.

Graph API Explorer
GET /v19.0/{ad-account-id}/adimages HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{ad-account-id}/adimages',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* 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();
/* 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
}];
グラフAPIを使用する方法については、グラフAPIの使用ガイドをご覧ください。

パラメーター

パラメーター説明
biz_tag_id
int64

Business tag ID to filter images.

business_id
numeric string or integer

Optional. Assists with filters such as recently used.

hashes
list<string>

Hash of the image.

minheight
int64

Minimum height of the image.

minwidth
int64

Minimum width of the image.

name
string

Image name used in image names filter.

項目

このエッジからの読み込むではJSONフォーマットの結果が返されます:

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

data

AdImageノードの一覧です。

paging

ページネ―ションについて詳しくは、グラフAPIガイドをご覧ください。

summary

エッジの集計情報(数値など)。サマリーパラメータで取得するフィールドを指定します(サマリー=total_countなど)。

フィールド説明
total_count
unsigned int32

Total number of images in the Ad Account.

エラーコード

エラー詳細
100Invalid parameter
200Permissions error
80004There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting#ads-management.
2635You are calling a deprecated version of the Ads API. Please update to the latest version.
190Invalid OAuth 2.0 Access Token
368The action attempted has been deemed abusive or is otherwise disallowed

作成

adimagesのエッジにPOSTリクエストを以下のパスで送信できます:
このエッジにPOSTする場合、an AdImageが作成されます。

パラメーター

パラメーター説明
bytes
Base64 UTF-8 string

Image file. Example: bytes = <image content in bytes format>

copy_from
JSON or object-like arrays

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

source_account_id
numeric string

hash
string

戻り値の型

このエンドポイントはリード‐アフター‐ライトに対応し、imagesによって表されたノードを戻り値の型で読み込みます。
Map {
string: Map {
string: Struct {
hash: string,
url: string,
url_128: string,
url_256: string,
url_256_height: string,
url_256_width: string,
height: int32,
width: int32,
name: string,
}
}
}

エラーコード

エラー詳細
100Invalid parameter
80004There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting#ads-management.
200Permissions error
190Invalid OAuth 2.0 Access Token
368The action attempted has been deemed abusive or is otherwise disallowed
415Two factor authentication required. User have to enter a code from SMS or TOTP code generator to pass 2fac. This could happen when accessing a 2fac-protected asset like a page that is owned by a 2fac-protected business manager.

更新中…

このエンドポイントではこの操作を実行できません。

削除中です

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

パラメーター

パラメーター説明
hash
string

Hash of the image you wish to delete.

必須

戻り値の型

Struct {
success: bool,
}

エラーコード

エラー詳細
100Invalid parameter