Erro when trying to pull data from AccountPerformanceReportRequest from Reporting

Luiz Oliviera 0 Reputation points
2025-01-24T14:29:23.13+00:00

Hi guys,
Im trying to call the SOAP and got the error :<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:DeserializationFailed</faultcode><faultstring>The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter https://bingads.microsoft.com/Reporting/v13:ReportRequest. The InnerException message was 'There was an error deserializing the object of type Microsoft.AdCenter.Advertiser.Reporting.Api.DataContracts.Request.ReportRequest. End element 'AccountIds' from namespace 'https://bingads.microsoft.com/Reporting/v13' expected. Found element 'v13:long' from namespace 'https://bingads.microsoft.com/Reporting/v13'. Line 22, position 31.'. Please see InnerException for more details.</faultstring></s:Fault></s:Body></s:Envelope>

<soapenv:Header>
   <v13:DeveloperToken>{developer_token}</v13:DeveloperToken>
   <v13:AuthenticationToken>{access_token}</v13:AuthenticationToken>
</soapenv:Header>
<soapenv:Body>
    <v13:SubmitGenerateReportRequest>
        <v13:ReportRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="v13:AccountPerformanceReportRequest">
            <v13:Format>Csv</v13:Format>
            <v13:Language>English</v13:Language>
            <v13:ReportName>Account Performance Report</v13:ReportName>
            <v13:ReturnOnlyCompleteData>true</v13:ReturnOnlyCompleteData>
            <v13:Aggregation>Daily</v13:Aggregation>
            <v13:Columns>
                <v13:AccountPerformanceReportColumn>AccountName</v13:AccountPerformanceReportColumn>
                <v13:AccountPerformanceReportColumn>Clicks</v13:AccountPerformanceReportColumn>
                <v13:AccountPerformanceReportColumn>Impressions</v13:AccountPerformanceReportColumn>
                <v13:AccountPerformanceReportColumn>Spend</v13:AccountPerformanceReportColumn>
            </v13:Columns>
            <v13:Scope>
                <v13:AccountIds>
                    <v13:long>{account_id}</v13:long>
                </v13:AccountIds>
            </v13:Scope>
            <v13:Time>
                <v13:PredefinedTime>Today</v13:PredefinedTime>
            </v13:Time>
        </v13:ReportRequest>
    </v13:SubmitGenerateReportRequest>
</soapenv:Body>
</soapenv:Envelope>'''
Microsoft Advertising API
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.
441 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.