Microsoft Advertising API
A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.
414 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am currently trying to request a AdPerformanceReport using my own application and I am using the PHP SDK as a reference.
Requesting a report with the SDK works but with my app it does not despite sending basically identical xml strings. Both versions post to "https://reporting.api.bingads.microsoft.com/Api/Advertiser/Reporting/v13/ReportingService.svc?singleWsdl"
This is the error I see when I use my APP:
Post "https://reporting.api.bingads.microsoft.com/Api/Advertiser/Reporting/v13/ReportingService.svc?singleWsdl": read tcp MY_IP->168.61.2.231:443: read: connection reset by peer
I would love to know the reason for this error.
Request xml taken from the SDK:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="https://bingads.microsoft.com/Reporting/v13"
xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<SOAP-ENV:Header>
<ns1:CustomerAccountId>ACCOUNT_ID</ns1:CustomerAccountId>
<ns1:CustomerId>CUSTOMER_ID</ns1:CustomerId>
<ns1:DeveloperToken>DEV_TOKEN</ns1:DeveloperToken>
<ns1:UserName />
<ns1:Password />
<ns1:AuthenticationToken>AUTH_TOKEN</ns1:AuthenticationToken>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:SubmitGenerateReportRequest>
<ns1:ReportRequest xsi:type="ns1:AdPerformanceReportRequest">
<ns1:ExcludeColumnHeaders xsi:nil="true" />
<ns1:ExcludeReportFooter xsi:nil="true" />
<ns1:ExcludeReportHeader xsi:nil="true" />
<ns1:Format>Tsv</ns1:Format>
<ns1:FormatVersion xsi:nil="true" />
<ns1:ReportName></ns1:ReportName>
<ns1:ReturnOnlyCompleteData>false</ns1:ReturnOnlyCompleteData>
<ns1:Aggregation>Daily</ns1:Aggregation>
<ns1:Columns>
<ns1:AdPerformanceReportColumn>TimePeriod</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>AccountId</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>AccountName</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>AccountNumber</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>AdGroupId</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>AdGroupName</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>Clicks</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>Impressions</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>CampaignId</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>CampaignName</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>Spend</ns1:AdPerformanceReportColumn>
</ns1:Columns>
<ns1:Filter>
<ns1:AccountStatus xsi:nil="true" />
<ns1:AdDistribution xsi:nil="true" />
<ns1:AdGroupStatus xsi:nil="true" />
<ns1:AdStatus xsi:nil="true" />
<ns1:AdType xsi:nil="true" />
<ns1:CampaignStatus xsi:nil="true" />
<ns1:DeviceType xsi:nil="true" />
<ns1:Language xsi:nil="true" />
</ns1:Filter>
<ns1:Scope>
<ns1:AccountIds>
<ns2:long>ACCOUNT_ID</ns2:long>
</ns1:AccountIds>
<ns1:AdGroups xsi:nil="true" />
<ns1:Campaigns xsi:nil="true" />
</ns1:Scope>
<ns1:Time>
<ns1:CustomDateRangeEnd xsi:nil="true" />
<ns1:CustomDateRangeStart xsi:nil="true" />
<ns1:PredefinedTime>Yesterday</ns1:PredefinedTime>
<ns1:ReportTimeZone xsi:nil="true" />
</ns1:Time>
</ns1:ReportRequest>
</ns1:SubmitGenerateReportRequest>
</SOAP-ENV:Body>
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="https://bingads.microsoft.com/Reporting/v13"
xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<s:Header>
<ns1:Action mustUnderstand="1">SubmitGenerateReport</ns1:Action>
<ns1:CustomerAccountId>ACCOUNT_ID</ns1:CustomerAccountId>
<ns1:CustomerId>CUSTOMER_ID</ns1:CustomerId>
<ns1:DeveloperToken>DEV_TOKEN</ns1:DeveloperToken>
<ns1:UserName />
<ns1:Password />
<ns1:AuthenticationToken>AUTH_TOKEN</ns1:AuthenticationToken>
</s:Header>
<s:Body>
<ns1:SubmitGenerateReportRequest>
<ns1:ReportRequest i:type="ns1:AdPerformanceReportRequest">
<ns1:ExcludeColumnHeaders i:nil="true" />
<ns1:ExcludeReportFooter i:nil="true" />
<ns1:ExcludeReportHeader i:nil="true" />
<ns1:Format>Tsv</ns1:Format>
<ns1:FormatVersion i:nil="true" />
<ns1:ReportName></ns1:ReportName>
<ns1:ReturnOnlyCompleteData>false</ns1:ReturnOnlyCompleteData>
<ns1:Aggregation>Daily</ns1:Aggregation>
<ns1:Columns>
<ns1:AdPerformanceReportColumn>TimePeriod</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>AccountId</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>AccountName</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>AccountNumber</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>AdGroupId</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>AdGroupName</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>Clicks</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>Impressions</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>CampaignId</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>CampaignName</ns1:AdPerformanceReportColumn>
<ns1:AdPerformanceReportColumn>Spend</ns1:AdPerformanceReportColumn>
</ns1:Columns>
<ns1:Filter>
<ns1:AccountStatus i:nil="true" />
<ns1:AdDistribution i:nil="true" />
<ns1:AdGroupStatus i:nil="true" />
<ns1:AdStatus i:nil="true" />
<ns1:AdType i:nil="true" />
<ns1:CampaignStatus i:nil="true" />
<ns1:DeviceType i:nil="true" />
<ns1:Language i:nil="true" />
</ns1:Filter>
<ns1:Scope>
<ns1:AccountIds i:nil="false">
<ns2:long>ACCOUNT_ID</ns2:long>
</ns1:AccountIds>
<ns1:AdGroups i:nil="true" />
<ns1:Campaigns i:nil="true" />
</ns1:Scope>
<ns1:Time>
<ns1:CustomDataRangeEnd i:nil="true" />
<ns1:CustomDateRangeStart i:nil="true" />
<ns1:PredefinedTime>Yesterday</ns1:PredefinedTime>
<ns1:ReportTimeZone i:nil="true" />
</ns1:Time>
</ns1:ReportRequest>
</ns1:SubmitGenerateReportRequest>
</s:Body>
</s:Envelope>