PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, March 12, 2022

[FIXED] Facebook Graph API cURL Request with campaign status

 March 12, 2022     facebook, facebook-graph-api, facebook-php-sdk, guzzle, php     No comments   

Issue

I am trying to figure out how to query my Facebook Campaigns to filter out Active, Deleted, etc...

I use this, and it loads ALL of my campaigns, and doesn't matter based upon my status selected. I am hoping that it's something basic, but I have tried all variations with not change in my results.

Obviously I have removed the access_token on purpose.

In Short: How do I get campaigns based upon their status'.

enter image description here


Solution

You need to specify a filtering object as specified on this API page: https://developers.facebook.com/docs/marketing-api/insights/parameters

Here is an example provided on the API page: https://developers.facebook.com/docs/marketing-api/insights/

curl -G \
-d "level=ad" \
-d "filtering=[{'field':'ad.effective_status','operator':'IN','value':['ARCHIVED']}]" \
-d "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/insights/"


Answered By - neuromatter
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing