ad account to ads pixels edge
GET /v21.0/<PIXEL_ID>/?fields=code 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(
'/<PIXEL_ID>/?fields=code',
'{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(
"/<PIXEL_ID>/",
{
"fields": "code"
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Bundle params = new Bundle();
params.putString("fields", "code");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/<PIXEL_ID>/",
params,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
NSDictionary *params = @{
@"fields": @"code",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/<PIXEL_ID>/"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
curl -X GET -G \
-d 'fields="code"' \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/<PIXEL_ID>/
이 에지로부터 읽는 경우 JSON 형식의 결과를 반환합니다:
{ "
data
": [], "paging
": {}, "summary
": {} }
data
paging
summary
수치 등 에지에 관해 집계된 정보입니다. 요약 매개변수에 가져오려면 해당 필드를 지정하세요(예: summary=total_count
).
필드 | 설명 |
---|---|
total_count int32 | Total number of objects on this edge |
오류 | 설명 |
---|---|
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 |
200 | Permissions error |
2500 | Error parsing graph query |
adspixels
에지에 POST 요청을 만들 수 있습니다: POST /v21.0/act_<AD_ACCOUNT_ID>/adspixels HTTP/1.1
Host: graph.facebook.com
name=My+WCA+Pixel
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post(
'/act_<AD_ACCOUNT_ID>/adspixels',
array (
'name' => 'My WCA Pixel',
),
'{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>/adspixels",
"POST",
{
"name": "My WCA Pixel"
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Bundle params = new Bundle();
params.putString("name", "My WCA Pixel");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/act_<AD_ACCOUNT_ID>/adspixels",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
NSDictionary *params = @{
@"name": @"My WCA Pixel",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/act_<AD_ACCOUNT_ID>/adspixels"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
curl -X POST \
-F 'name="My WCA Pixel"' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/act_<AD_ACCOUNT_ID>/adspixels
매개변수 | 설명 |
---|---|
name string | Name of the pixel |
id
로 표시되는 노드를 읽습니다.id
: numeric string, 오류 | 설명 |
---|---|
6202 | More than one pixel exist for this account |
100 | Invalid parameter |
200 | Permissions error |
6200 | A pixel already exists for this account |
190 | Invalid OAuth 2.0 Access Token |