bingbing-ads-api

Bing Ads API - GetLabelAssociationsByEntityIds - UserIsNotAuthorized 106


I get The user does not represent a authorized developer. error when i try to fetch associated labels with campaignsId

DEBUG:suds.client:sending to (https://campaign.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v13/CampaignManagementService.svc)

<?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:tns="https://bingads.microsoft.com/CampaignManagement/v13" xmlns:ns0="https://bingads.microsoft.com/CampaignManagement/v13" xmlns:ns1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Header>
    <tns:AuthenticationToken>
        TOKEN
    </tns:AuthenticationToken>
    <tns:CustomerAccountId>ACCOUNT_ID</tns:CustomerAccountId>
    <tns:CustomerId>PATENT_ID</tns:CustomerId>
    <tns:DeveloperToken>DEVELOPER_TOKEN</tns:DeveloperToken>
  </SOAP-ENV:Header>
  <ns2:Body>
    <ns0:GetLabelAssociationsByEntityIdsRequest>
      <ns0:EntityIds>
        <ns1:long>CAMPAIGN_ID</ns1:long>
        <ns1:long>CAMPAIGN_ID</ns1:long>
        <ns1:long>CAMPAIGN_ID</ns1:long>
        <ns1:long>CAMPAIGN_ID</ns1:long>
        <ns1:long>CAMPAIGN_ID</ns1:long>
        <ns1:long>CAMPAIGN_ID</ns1:long>
      </ns0:EntityIds>
      <ns0:EntityType>Campaign</ns0:EntityType>
    </ns0:GetLabelAssociationsByEntityIdsRequest>
  </ns2:Body>
</SOAP-ENV:Envelope>

i use bingads.v13 python library and looks like this

campaign_service = ServiceClient(service='CampaignManagementService', version=13, authorization_data=authorization_data, environment='production')
get_label_associations_by_entity_ids = campaign_service.GetLabelAssociationsByEntityIds(
                EntityIds={'long': get_entity_ids},
                EntityType='Campaign'
            )

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: 3511ac9a-a751-4c0d-9b51-1ed04540a225.</faultstring>
      <detail>
        <ApiFaultDetail xmlns="https://bingads.microsoft.com/CampaignManagement/v13" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
          <TrackingId xmlns="https://adapi.microsoft.com">3511ac9a-a751-4c0d-9b51-1ed04540a225</TrackingId>
          <BatchErrors />
          <OperationErrors>
            <OperationError><Code>106</Code>
              <Details i:nil="true" />
              <ErrorCode>UserIsNotAuthorized</ErrorCode>
              <Message>The user does not represent a authorized developer.</Message>
            </OperationError>
          </OperationErrors>
        </ApiFaultDetail>
      </detail>
    </s:Fault>
  </s:Body>
</s:Envelope>

Solution

  • Microsoft Ads support responded that this is an IBM error.:

    I am sending you this to provide you with an update about your concern on the error that you are encountering with your API. I have coordinated with our backend team first and we would like to further confirm what kind of access do you have on the account. Upon checking here, you must be a superadmin of the account. You can follow the steps here and request for a new token. I hope this helps.