I'm working with the Meta Graph API and trying to filter results based on a subfield within a nested object. Specifically, I want to retrieve ad accounts with their associated campaigns, but only include campaigns that have a stop_time greater than a certain timestamp.

Here's the query I'm attempting to use:

me/adaccounts?fields=id,name,campaigns{id,name,stop_time}&filtering=[{field:'campaigns.stop_time',operator:'GREATER_THAN',value:'1721630725'}] 

Unfortunately, this doesn't seem to work. I suspect I'm not structuring the filtering correctly for subfields.

Can someone explain how to properly apply filters to subfields in Meta Graph API queries? Is it possible to filter nested objects directly within the main query, or is there a different approach I should take?

Any guidance or examples would be greatly appreciated!

Tag:facebook-graph-api

Add a new comment.