microsoft ads api SOAP request InvalidCredentials

manish prajapti 1 Reputation point
2021-06-16T16:52:55.603+00:00

I am trying to get response from SOAP api by sending request using soap ui, for now I am using this simple request

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:ApplicationToken i:nil="true" xmlns:h="https://bingads.microsoft.com/Reporting/v9" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" />
    <h:AuthenticationToken xmlns:h="https://bingads.microsoft.com/Reporting/v9">***</h:AuthenticationToken>
    <h:CustomerAccountId xmlns:h="https://bingads.microsoft.com/Reporting/v9">***</h:CustomerAccountId>
    <h:CustomerId xmlns:h="https://bingads.microsoft.com/Reporting/v9">***</h:CustomerId>
    <h:DeveloperToken xmlns:h="https://bingads.microsoft.com/Reporting/v9">***</h:DeveloperToken>
    <h:Password i:nil="true" xmlns:h="https://bingads.microsoft.com/Reporting/v9" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" />
    <h:UserName i:nil="true" xmlns:h="https://bingads.microsoft.com/Reporting/v9" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" />
  </s:Header>
  <s:Body>
    <SubmitGenerateReportRequest xmlns="https://bingads.microsoft.com/Reporting/v9">
      <ReportRequest i:type="AdGroupPerformanceReportRequest" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <Format>Csv</Format>
        <Language>English</Language>
        <ReportName>My_Ad_Group_Performance_Report</ReportName>
        <ReturnOnlyCompleteData>false</ReturnOnlyCompleteData>
        <Aggregation>Daily</Aggregation>
        <Columns>
          <AdGroupPerformanceReportColumn>TimePeriod</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>AccountId</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>CampaignId</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>DeviceType</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>BidMatchType</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>QualityScore</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>ExtendedCost</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>LandingPageRelevance</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>LandingPageUserExperience</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>Revenue</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>Assists</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>KeywordRelevance</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>DeliveredMatchType</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>AveragePosition</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>Conversions</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>AdDistribution</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>Network</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>Clicks</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>Impressions</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>Ctr</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>AverageCpc</AdGroupPerformanceReportColumn>
          <AdGroupPerformanceReportColumn>Spend</AdGroupPerformanceReportColumn>
        </Columns>
        <Filter i:nil="true" />
        <Scope>
          <AccountIds i:nil="true" />
          <AdGroups i:nil="true" />
          <Campaigns i:nil="true" />
        </Scope>
        <Time>
          <CustomDateRangeEnd i:nil="true" />
          <CustomDateRangeStart i:nil="true" />
          <PredefinedTime>Yesterday</PredefinedTime>
        </Time>
      </ReportRequest>
    </SubmitGenerateReportRequest>
  </s:Body>
</s:Envelope>

based on this link https://social.msdn.microsoft.com/Forums/en-US/5f825750-af20-4a2b-aa69-a5f419124401/soap-xml-call-to-api-fails?forum=BingAds

but I am getting error message "Authentication failed. Either supplied credentials are invalid or the account is inactive"

FULL RESPONSE:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <s:Fault>
         <faultcode>s:Server</faultcode>
         <faultstring xml:lang="en-US">Invalid client data. Check the SOAP fault details for more information. TrackingId: 96bd8362-5a83-41c4-91dc-dd09d142da4a.</faultstring>
         <detail>
            <AdApiFaultDetail xmlns="https://adapi.microsoft.com" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
               <TrackingId>96bd8362-5a83-41c4-91dc-dd09d142da4a</TrackingId>
               <Errors>
                  <AdApiError>
                     <Code>105</Code>
                     <Detail i:nil="true"/>
                     <ErrorCode>InvalidCredentials</ErrorCode>
                     <Message>Authentication failed. Either supplied credentials are invalid or the account is inactive</Message>
                  </AdApiError>
               </Errors>
            </AdApiFaultDetail>
         </detail>
      </s:Fault>
   </s:Body>
</s:Envelope>

I have tried to debug it using https://social.msdn.microsoft.com/Forums/en-US/d9b3ac70-1e7b-40f6-94c7-de60859098ed/recently-getting-105-errors-php?forum=BingAds but was not able to figure out what is wrong.

Any help will be great
Thanks.

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.
399 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,146 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Eric Urban - MSFT 626 Reputation points Microsoft Employee
    2021-07-05T22:57:15.51+00:00

    @manish prajapti - Please review the suggestions here; otherwise I suggest that you contact support to review your account and developer credentials.

    0 comments No comments