@macy_poc: Thanks for the clarification and for providing the
entity=ACCOUNT request—that’s helpful.
Before we identify what’s different between the account-level and campaign-level requests, let’s change the granularity for the campaign-level request to
TOTAL so that we remove the
INVALID_TIME_WINDOW error. (We’ll change this back to
DAY once we make sure we can make a success campaign-level request to the stats endpoint.) Are you able to make a successful request with this change?
Previously you mentioned you were seeing an “All components of query must be named” error message. This is not an Ads API error message. Instead, it looks like it comes from Hadley Wickham’s
httr package: https://github.com/hadley/httr/blob/master/R/url-query.r#L15. Are you able to get the full trace of the request? This might help determine what part of the request is incorrect.
Other than that, the only difference we notice is that the account-level request isn’t explicit about the
entity_ids parameter, which is a valid way to make the request. In order words, the campaign-level request includes
paste(campaign.ids, collapse = ","), which could be causing a problem.