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.
GET /v21.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_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<enum{ACTIVE, PAUSED, DELETED, PENDING_REVIEW, DISAPPROVED, PREAPPROVED, PENDING_BILLING_INFO, CAMPAIGN_PAUSED, ARCHIVED, ADSET_PAUSED, IN_PROCESS, WITH_ISSUES}> | Default value: Vec Filter adsets by effective status |
is_completed boolean | 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
": {} }
data
paging
summary
Aggregated information about the edge, such as counts. Specify the fields to fetch in the summary param (like summary=insights
).
Field | Description |
---|---|
insights Edge<AdsInsights> | Analytics summary for all objects |
total_count unsigned int32 | Total number of objects |
Error | Description |
---|---|
100 | Invalid parameter |
copies
edge from the following paths: Parameter | Description |
---|---|
deep_copy boolean | Default value: false Whether 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_time datetime | For deep copy, the end time of the sets under the copied campaign, e.g. |
rename_options JSON or object-like arrays | Rename options |
start_time datetime | For deep copy, the start time of the sets under the copied campaign, e.g. |
status_option enum {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}, source_id
: numeric string, copied_id
: numeric string, Error | Description |
---|---|
100 | Invalid parameter |