Advertisement
Guest User

Untitled

a guest
Jan 16th, 2021
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. $api = Api::init($app_id, $app_secret, $access_token);
  2. $api->setLogger(new CurlLogger());
  3.  
  4. $fields = array(
  5. 'name',
  6. 'objective',
  7. );
  8. $params = array(
  9. 'effective_status' => array('ACTIVE','PAUSED'),
  10. );
  11. $result = json_encode((new AdAccount($id))->getCampaigns(
  12. $fields,
  13. $params
  14. )->getResponse()->getContent(), JSON_PRETTY_PRINT);
  15.  
  16. $result2 = json_decode($result);
  17. print_r($result2);
  18.  
  19. foreach($result2 as $item){
  20. echo $item['name'];
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement