그래프 API 버전

Campaign Adsets

읽기

Edge query from Ad Campaign to Ad Sets

Graph API Explorer
GET /v21.0/<AD_CAMPAIGN_ID>/adsets?fields=name%2Cstart_time%2Cend_time%2Cdaily_budget%2Clifetime_budget 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_CAMPAIGN_ID>/adsets?fields=name%2Cstart_time%2Cend_time%2Cdaily_budget%2Clifetime_budget',
    '{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_CAMPAIGN_ID>/adsets",
    {
        "fields": "name,start_time,end_time,daily_budget,lifetime_budget"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("fields", "name,start_time,end_time,daily_budget,lifetime_budget");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/<AD_CAMPAIGN_ID>/adsets",
    params,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
NSDictionary *params = @{
  @"fields": @"name,start_time,end_time,daily_budget,lifetime_budget",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/<AD_CAMPAIGN_ID>/adsets"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
curl -X GET -G \
  -d 'fields="name,start_time,end_time,daily_budget,lifetime_budget"' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v21.0/<AD_CAMPAIGN_ID>/adsets
그래프 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<enum{ACTIVE, PAUSED, DELETED, PENDING_REVIEW, DISAPPROVED, PREAPPROVED, PENDING_BILLING_INFO, CAMPAIGN_PAUSED, ARCHIVED, ADSET_PAUSED, IN_PROCESS, WITH_ISSUES}>

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

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.

필드

이 에지로부터 읽는 경우 JSON 형식의 결과를 반환합니다:

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

data

AdSet 노드 리스트.

paging

페이지 매김에 대한 자세한 정보는 그래프 API 가이드를 확인하세요.

summary

수치 등 에지에 관해 집계된 정보입니다. 요약 매개변수에 가져오려면 해당 필드를 지정하세요(예: summary=insights).

필드설명
insights
Edge<AdsInsights>

An analytics summary result for an Ad object

total_count
unsigned int32

Total number of ad objects returned by the query

오류 코드

오류설명
613Calls to this api have exceeded the rate limit.
100Invalid parameter
200Permissions error
190Invalid OAuth 2.0 Access Token
3018The start date of the time range cannot be beyond 37 months from the current date
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.
104Incorrect signature
80000There have been too many calls from 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-insights.
2500Error parsing graph query

만들기

이 엔드포인트에서 수행할 수 없는 작업입니다.

업데이트 중

이 엔드포인트에서 수행할 수 없는 작업입니다.

삭제 중

이 엔드포인트에서 수행할 수 없는 작업입니다.