No matter what I do I cannot pull all the ads on my account. My end goal is to find disapproved ads on the account programmatically, but no matter which filters I use (Even if I use no filters), I can only retrieve 59 out of 181 ads on the account. Could someone please correct my XML request? Here's the code I'm currently using that returns 59 out of the total 181.
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="https://bingads.microsoft.com/Reporting/v13" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns="https://bingads.microsoft.com/Reporting/v13">
<env:Header>
<AuthenticationToken>****</AuthenticationToken>
<CustomerAccountId>****</CustomerAccountId>
<CustomerId>****</CustomerId>
<DeveloperToken>****</DeveloperToken>
</env:Header>
<env:Body>
<tns:SubmitGenerateReportRequest>
<ReportRequest xsi:nil="false" xsi:type="AdPerformanceReportRequest">
<ExcludeColumnHeaders>true</ExcludeColumnHeaders>
<ExcludeReportFooter>true</ExcludeReportFooter>
<ExcludeReportHeader>true</ExcludeReportHeader>
<Format>Csv</Format>
<Language>English</Language>
<ReportName>AdPerformanceReportRequest</ReportName>
<ReturnOnlyCompleteData>false</ReturnOnlyCompleteData>
<Aggregation>Summary</Aggregation>
<Columns>
<AdPerformanceReportColumn>AdId</AdPerformanceReportColumn>
<AdPerformanceReportColumn>AdGroupName</AdPerformanceReportColumn>
<AdPerformanceReportColumn>CampaignName</AdPerformanceReportColumn>
<AdPerformanceReportColumn>CampaignStatus</AdPerformanceReportColumn>
<AdPerformanceReportColumn>AdStatus</AdPerformanceReportColumn>
<AdPerformanceReportColumn>Spend</AdPerformanceReportColumn>
</Columns>
<Filter xsi:nil="true"/>
<Scope>
<AccountIds xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<a1:long>****</a1:long>
</AccountIds>
</Scope>
<Time>
<CustomDateRangeEnd>
<Day>25</Day>
<Month>06</Month>
<Year>2020</Year>
</CustomDateRangeEnd>
<CustomDateRangeStart>
<Day>25</Day>
<Month>06</Month>
<Year>2020</Year>
</CustomDateRangeStart>
<PredefinedTime xsi:nil="true"/>
<ReportTimeZone>EasternTimeUSCanada</ReportTimeZone>
</Time>
</ReportRequest>
</tns:SubmitGenerateReportRequest>
</env:Body>
</env:Envelope>
This returns accurate data, I added up the spend of the returned ads and they matched the numbers in the interface exactly. I suspected that the API by default only returns rows with performance data, so I filtered the ads in the interface by ads that have > 0 impressions and it happens to be 59. I don't know if this is a coincidence or not, but I really need to pull all the ads on the account, because obviously a disapproved ad wouldn't have any impressions.
When I try to use filters, I format the request according to the documentation for AdPerformanceReportFilter, and get something that looks like this
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="https://bingads.microsoft.com/Reporting/v13" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns="https://bingads.microsoft.com/Reporting/v13">
<env:Header>
...
<Columns>
<AdPerformanceReportColumn>AdId</AdPerformanceReportColumn>
<AdPerformanceReportColumn>AdGroupName</AdPerformanceReportColumn>
<AdPerformanceReportColumn>CampaignName</AdPerformanceReportColumn>
<AdPerformanceReportColumn>CampaignStatus</AdPerformanceReportColumn>
<AdPerformanceReportColumn>AdStatus</AdPerformanceReportColumn>
<AdPerformanceReportColumn>Spend</AdPerformanceReportColumn>
</Columns>
<Filter>
<AdStatus>Paused</AdStatus>
</Filter>
<Scope>
<AccountIds xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<a1:long>****</a1:long>
</AccountIds>
</Scope>
...
And this returns 0 ads, but when I check the interface, there are plenty of paused ads. 81 paused ads in fact.
It returns 0 ads if I use Pending, Rejected, Deleted or Paused. Specifying Active gives me the usual 59. Can you please show me how to pull rows from the API that don't have performance data?
Thank you.