Ads belonging to this ad account.
Ads belonging to this ad account
GET /v24.0/act_{ad-account-id}/ads 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(
'/act_{ad-account-id}/ads',
'{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(
"/act_{ad-account-id}/ads",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/act_{ad-account-id}/ads",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/act_{ad-account-id}/ads"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];| パラメーター | 説明 |
|---|---|
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} | Predefine date range used to aggregate insights metrics |
effective_statuslist<string> | Filter ads by effective status |
time_range{'since':YYYY-MM-DD,'until':YYYY-MM-DD} | Date range used to aggregate insights metrics |
updated_sinceinteger | Time since the Ad has been updated. |
このエッジからの読み込むではJSONフォーマットの結果が返されます:
{ "
data": [], "paging": {}, "summary": {} }
datapagingsummaryエッジの集計情報(数値など)。サマリーパラメータで取得するフィールドを指定します(サマリー=insightsなど)。
| フィールド | 説明 |
|---|---|
insightsEdge<AdsInsights> | Analytics summary for all objects |
total_countunsigned int32 | Total number of Ads returned by the query |
| エラー | 詳細 |
|---|---|
| 200 | Permissions error |
| 613 | Calls to this api have exceeded the rate limit. |
| 100 | Invalid parameter |
| 80004 | There 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. |
| 190 | Invalid OAuth 2.0 Access Token |
| 2500 | Error parsing graph query |
| 3018 | The start date of the time range cannot be beyond 37 months from the current date |
| 2635 | You are calling a deprecated version of the Ads API. Please update to the latest version. |
| 368 | The action attempted has been deemed abusive or is otherwise disallowed |
adsのエッジにPOSTリクエストを以下のパスで送信できます: POST /v24.0/act_<AD_ACCOUNT_ID>/ads HTTP/1.1
Host: graph.facebook.com
name=My+Ad&adset_id=%3CAD_SET_ID%3E&creative=%7B%22creative_id%22%3A%22%3CCREATIVE_ID%3E%22%7D&status=PAUSED/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post(
'/act_<AD_ACCOUNT_ID>/ads',
array (
'name' => 'My Ad',
'adset_id' => '<AD_SET_ID>',
'creative' => '{"creative_id":"<CREATIVE_ID>"}',
'status' => 'PAUSED',
),
'{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(
"/act_<AD_ACCOUNT_ID>/ads",
"POST",
{
"name": "My Ad",
"adset_id": "<AD_SET_ID>",
"creative": "{\"creative_id\":\"<CREATIVE_ID>\"}",
"status": "PAUSED"
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);Bundle params = new Bundle();
params.putString("name", "My Ad");
params.putString("adset_id", "<AD_SET_ID>");
params.putString("creative", "{\"creative_id\":\"<CREATIVE_ID>\"}");
params.putString("status", "PAUSED");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/act_<AD_ACCOUNT_ID>/ads",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();NSDictionary *params = @{
@"name": @"My Ad",
@"adset_id": @"<AD_SET_ID>",
@"creative": @"{\"creative_id\":\"<CREATIVE_ID>\"}",
@"status": @"PAUSED",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/act_<AD_ACCOUNT_ID>/ads"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];curl -X POST \
-F 'name="My Ad"' \
-F 'adset_id="<AD_SET_ID>"' \
-F 'creative={
"creative_id": "<CREATIVE_ID>"
}' \
-F 'status="PAUSED"' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v24.0/act_<AD_ACCOUNT_ID>/ads| パラメーター | 説明 |
|---|---|
ad_schedule_end_timedatetime | An optional parameter that defines the end time of an individual ad. If no end time is defined, the ad will run on the campaign’s schedule. This parameter is only available for sales and app promotion campaigns. |
ad_schedule_start_timedatetime | An optional parameter that defines the start time of an individual ad. If no start time is defined, the ad will run on the campaign’s schedule. This parameter is only available for sales and app promotion campaigns. |
adlabelslist<Object> | Ad labels associated with this ad |
adset_idint64 | The ID of the ad set, required on creation. |
adset_specAd set spec | The ad set spec for this ad. When the spec is provided, adset_id field is not required. |
audience_idstring | The ID of the audience. |
bid_amountinteger | Deprecated. We no longer allow setting the |
conversion_domainstring | The domain where conversions happen. Required to create or update an ad in a campaign that shares data with a pixel. This field will be auto-populated for existing ads by inferring from destination URLs . Note that this field should contain only the first and second level domains, and not the full URL. For example |
creativeAdCreative | This field is required for create. The ID or creative spec of the ad creative to be used by this ad. You can read more about creatives here. You may supply the ID within an object as follows: 必須絵文字をサポートします |
creative_asset_groups_specstring (CreativeAssetGroupsSpec) | creative_asset_groups_spec 絵文字をサポートします |
date_formatstring | The format of the date. |
display_sequenceint64 | The sequence of the ad within the same campaign |
engagement_audienceboolean | Flag to create a new audience based on users who engage with this ad |
execution_optionslist<enum{validate_only, synchronous_ad_review, include_recommendations}> | デフォルト値: SetAn execution setting |
include_demolink_hashesboolean | Include the demolink hashes. |
namestring | Name of the ad. 必須絵文字をサポートします |
priorityint64 | Priority |
source_ad_idnumeric string or integer | ID of the source Ad, if applicable. |
statusenum{ACTIVE, PAUSED, DELETED, ARCHIVED} | Only |
tracking_specsObject | With Tracking Specs, you log actions taken by people on your ad. See Tracking and Conversion Specs. |
idによって表されたノードを戻り値の型で読み込みます。id: numeric string, success: bool, | エラー | 詳細 |
|---|---|
| 100 | Invalid parameter |
| 200 | Permissions error |
| 613 | Calls to this api have exceeded the rate limit. |
| 368 | The action attempted has been deemed abusive or is otherwise disallowed |
| 80004 | There 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. |
| 194 | Missing at least one required parameter |
| 500 | Message contains banned content |
| 2635 | You are calling a deprecated version of the Ads API. Please update to the latest version. |
| 190 | Invalid OAuth 2.0 Access Token |
| 105 | The number of parameters exceeded the maximum for this operation |