Create a duplicate campaign based on an existing one.
The Marketing API has it is own rate limiting logic. If you are encountering errors mentioning a reached limit, see Rate Limiting.
This endpoint returns copies of a specific ad campaign.
GET /v24.0/{campaign-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(
'/{campaign-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(
"/{campaign-id}/copies",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{campaign-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:@"/{campaign-id}/copies"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];| Parameter | Description |
|---|---|
date_presetenum{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_statuslist<enum{ACTIVE, PAUSED, DELETED, PENDING_REVIEW, DISAPPROVED, PREAPPROVED, PENDING_BILLING_INFO, CAMPAIGN_PAUSED, ARCHIVED, ADSET_PAUSED, IN_PROCESS, WITH_ISSUES}> | Default value: VecFilter adsets by effective status |
is_completedboolean | Filter adsets by completed status |
time_range{'since':YYYY-MM-DD,'until':YYYY-MM-DD} | Time range used to aggregate insights metrics |
Reading from this edge will return a JSON formatted result:
{ "
data": [], "paging": {}, "summary": {} }
datapagingsummaryAggregated information about the edge, such as counts. Specify the fields to fetch in the summary param (like summary=insights).
| Field | Description |
|---|---|
insightsEdge<AdsInsights> | Analytics summary for all objects |
total_countunsigned int32 | Total number of objects |
| Error | Description |
|---|---|
| 100 | Invalid parameter |
| 104 | Incorrect signature |
copies edge from the following paths: | Parameter | Description |
|---|---|
deep_copyboolean | Default value: falseWhether to copy all the child ads. Limits: the total number of children ads to copy should not exceed 3 for a synchronous call and 51 for an asynchronous call. |
end_timedatetime | For deep copy, the end time of the sets under the copied campaign, e.g. |
parameter_overridesCampaign spec | parameter_overrides |
rename_optionsJSON or object-like arrays | Rename options |
start_timedatetime | For deep copy, the start time of the sets under the copied campaign, e.g. |
status_optionenum {ACTIVE, PAUSED, INHERITED_FROM_SOURCE} | Default value: PAUSED
|
copied_campaign_id in the return type.copied_campaign_id: numeric string, ad_object_ids: List [ad_object_type: enum {unique_adcreative, ad, ad_set, campaign, opportunities, privacy_info_center, topline, ad_account, product}, source_id: numeric string, copied_id: numeric string, | Error | Description |
|---|---|
| 100 | Invalid parameter |
| 190 | Invalid OAuth 2.0 Access Token |
| 200 | Permissions error |