0

I am currently using:

$output = $adset->read(array("campaign_schedule"));

Which is similar to:

curl -G \
-d "fields=campaign_schedule" \
-d "access_token=___" \
-d "method=get" \
'https://graph.facebook.com/{adset_id}'

This returns the campaign_schedule array deep within the response object.

How can I get just the campaign schedule as an array/object?

Documentation here: https://developers.facebook.com/docs/marketing-api/adset/pacing/v2.3

1 Answers1

0

The campaign schedule will be a member variable of the object returned.

print_r($adset->campaign_schedule);
Paul Bain
  • 4,364
  • 1
  • 16
  • 30
  • Thanks for your reply. I understand what you're saying in theory, but I don't understand how to do this in practice. The variable I want seems to be inside a protected variable. – useruseruser Jun 10 '15 at 08:53
  • no it's handled by a magic method of the class, so if you just read it, it should work. `$schedule = $adset->campaign_schedule; print_r($schedule);` – Paul Bain Jun 11 '15 at 09:21
  • 1
    Thanks so much. It seems obvious now, but I didn't understand that the setter was also the getter. – useruseruser Jun 12 '15 at 08:22