グラフAPIバージョン

Ad Copies

The Marketing API has it is own rate limiting logic. If you are encountering errors mentioning a reached limit, see Rate Limiting.

読み取り

The copies of this ad.

Graph API Explorer
GET /v19.0/{ad-id}/copies 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-id}/copies',
    '{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-id}/copies",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{ad-id}/copies",
    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-id}/copies"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
グラフAPIを使用する方法については、グラフAPIの使用ガイドをご覧ください。

パラメーター

パラメーター説明
date_preset
enum{today, yesterday, this_month, last_month, this_quarter, maximum, data_maximum, last_3d, last_7d, last_14d, last_28d, last_30d, last_90d, last_week_mon_sun, last_week_sun_sat, last_quarter, last_year, this_week_mon_today, this_week_sun_today, this_year}

Preset date range used to aggregate insights metrics

effective_status
list<string>

Filter Ads by effective status

time_range
{'since':YYYY-MM-DD,'until':YYYY-MM-DD}

Time range used to aggregate insights metrics

since
datetime

A date in the format of "YYYY-MM-DD", which means from the beginning midnight of that day.

until
datetime

A date in the format of "YYYY-MM-DD", which means to the beginning midnight of the following day.

updated_since
integer

Filter ads by updated since time

項目

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

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

data

Adノードの一覧です。

paging

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

summary

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

フィールド説明
insights
Edge<AdsInsights>

Analytics summary for all objects

total_count
unsigned int32

Total number of objects

エラーコード

エラー詳細
100Invalid parameter

作成

Targeting DSA Regulated Locations (European Union)

To copy an ad set targeted in the European Union's Digital Services Act (DSA) regulated locations, please set the payor/beneficiary information first. Otherwise the copying request may respond with one of the following errors:

Payor missing error

{
  "error": {
    "message": "Invalid parameter",
    "type": "FacebookApiException",
    "code": 100,
    "error_data": "{\"blame_field_specs\":[[\"dsa_payor\"]]}",
    "error_subcode": 3858079,
    "is_transient": false,
    "error_user_title": "No payor provided in DSA regulated region",
    "error_user_msg": "The DSA requires ads to provide payor information in regulated regions. Updating/creating ad needs to provide payor of the ad.",
    "fbtrace_id": "fbtrace_id"
  },
  "__fb_trace_id__": "fbtrace_id",
  "__www_request_id__": "request_id"
}
Beneficiary missing error
{
  "error": {
    "message": "Invalid parameter",
    "type": "FacebookApiException",
    "code": 100,
    "error_data": "{\"blame_field_specs\":[[\"dsa_beneficiary\"]]}",
    "error_subcode": 3858081,
    "is_transient": false,
    "error_user_title": "No payor/beneficiary provided in DSA regulated location",
    "error_user_msg": "The DSA requires ads to provide beneficiary information in regulated regions. Updating/creating ad needs to provide beneficiary of the ad.",
    "fbtrace_id": "fbtrace_id"
  },
  "__fb_trace_id__": "fbtrace_id",
  "__www_request_id__": "request_id"
}

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

パラメーター

パラメーター説明
adset_id
numeric string or integer

Single ID of an adset object to make the parent of the copy. Ignore if you want to keep the copy under the original adset parent.

rename_options
JSON or object-like arrays

Rename options

rename_strategy
enum {DEEP_RENAME, ONLY_TOP_LEVEL_RENAME, NO_RENAME}
デフォルト値: ONLY_TOP_LEVEL_RENAME

DEEP_RENAME: will change this object's name and children's names in the copied object. ONLY_TOP_LEVEL_RENAME: will change the this object's name but won't change the children's name in the copied object. NO_RENAME: will change no name in the copied object

rename_prefix
string

A prefix to copy names. Defaults to null if not provided.

rename_suffix
string

A suffix to copy names. Defaults to null if not provided and appends a localized string of - Copy based on the ad account locale.

status_option
enum {ACTIVE, PAUSED, INHERITED_FROM_SOURCE}
デフォルト値: PAUSED

ACTIVE: the copied ad will have active status. PAUSED: the copied ad will have paused status. INHERITED_FROM_SOURCE: the copied ad will have the parent status.

戻り値の型

このエンドポイントはリード‐アフター‐ライトに対応し、copied_ad_idによって表されたノードを戻り値の型で読み込みます。
Struct {
copied_ad_id: numeric string,
}

エラーコード

エラー詳細
100Invalid parameter
200Permissions error
1500The url you supplied is invalid

更新中…

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

削除中です

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