Skip to content

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

@ManojPadhiyar1993

Description

@ManojPadhiyar1993

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();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions