Punter Vicky
Punter Vicky

Reputation: 16982

Bing ADs API - GetGeoLocationsFileUrlRequest

The below soap request when fired using soap ui returns a valid response.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v11="https://bingads.microsoft.com/CampaignManagement/v11">
   <soapenv:Header>
      <v11:DeveloperToken>DeveloperToken</v11:DeveloperToken>
      <v11:CustomerId>CustomerId</v11:CustomerId>
      <v11:CustomerAccountId>AccountId</v11:CustomerAccountId>
      <v11:AuthenticationToken>Auth Token</v11:AuthenticationToken>
   </soapenv:Header>
   <soapenv:Body>
      <v11:GetGeoLocationsFileUrlRequest>
         <!--Optional:-->
         <v11:Version>2.0</v11:Version>
         <!--Optional:-->
         <v11:LanguageLocale>en</v11:LanguageLocale>
      </v11:GetGeoLocationsFileUrlRequest>
   </soapenv:Body>
</soapenv:Envelope>

However when I try to fire the same request by populating the details in Bing Ads API , I am seeing "Authentication token expired. Please renew it or obtain a new token." Below is the code that I am using -

    var getGeoLocationsFileUrlRequest = new GetGeoLocationsFileUrlRequest(null, "Auth Token", "Account ID", "Customer ID", "Developer Token", null, null, "2.0", "en");

    CampaignManagementServiceClient client = new CampaignManagementServiceClient();

    var getGeoLocationsFileUrlResponse = client.GetGeoLocationsFileUrl(getGeoLocationsFileUrlRequest);

Upvotes: 0

Views: 183

Answers (1)

Eric Urban
Eric Urban

Reputation: 602

The access token lasts up to an hour, so you'll need to get new access and refresh tokens via Authorization Code Grant Flow. Also in case it helps here is a GetGeoLocationsFileUrl C# example via ServiceClient.

Upvotes: 1

Related Questions