I run a query on Facebook Graph API Explorer successfully but when I run the same query on Google Apps Script with UrlFetchApp I get an Error - Invalid argument. The query is this:
https: //graph.facebook.com/v4.0/act_1015703131******/insights?fields=spend&level=account&date_preset=yesterday&filtering=[{field:campaign.name,operator:CONTAIN,value:perf},{field:adset.name,operator:NOT_CONTAIN,value:rmk}]&access_token=********
When I run the same query without filtering it works as expected!
EDIT: I tried to encode the filtering parameters and it throws a new error:
Request failed for https://graph.facebook.com returned code 400. Truncated server response: {"error":{"message":"(#100) param filtering must be an array.","type":"OAuthException","code":100,"fbtrace_id":"AMw2vkaHXbuiVSQuSNg28yZ"}} (use muteHttpExceptions option to examine full response)
What is causing the problem exactly since the error doesn't give any specific description?