Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want group id but it says Error: (#100) Missing permissions #613

Open
ManojPadhiyar1993 opened this issue Sep 15, 2024 · 1 comment
Open

Comments

@ManojPadhiyar1993
Copy link

ManojPadhiyar1993 commented Sep 15, 2024

My goal is to fetch leads data

$app_id = 'YOUR_APP_ID';
$app_secret = 'YOUR_APP_SECRET';
$access_token = 'YOUR_ACCESS_TOKEN';
$ad_account_id = 'act_YOUR_AD_ACCOUNT_ID';
Api::init($app_id, $app_secret, $access_token);

// Optional: Enable curl logging to debug requests
$api = Api::instance();
$api->setLogger(new CurlLogger());

try {
// Create a new AdAccount object with the Ad Account ID
$adAccount = new AdAccount($ad_account_id);

// Fetch ad sets (ad group IDs) for this ad account
$adsets = $adAccount->getAdSets([
    'id',         // Fetch Ad Set ID
    'name',       // Fetch Ad Set Name
    'campaign_id' // Fetch Campaign ID (optional)
]);

// Loop through the results and print the Ad Set IDs
foreach ($adsets as $adset) {
    echo 'Ad Set ID: ' . $adset['id'] . "\n";
    echo 'Ad Set Name: ' . $adset['name'] . "\n";
    echo 'Campaign ID: ' . $adset['campaign_id'] . "\n";
}

} catch (Exception $e) {
// Handle error
echo 'Error: ' . $e->getMessage();
}

@bostin
Copy link

bostin commented Oct 8, 2024

I have the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants