-1

I am writing a console app in C# using .NET Framework.

I have every piece of data required:

  1. clientID
  2. DeveloperToken
  3. RefreshToken
  4. Account ID
  5. CustomerID

I have tried a ton of MS documentations I still can't download the report from API.

Can someone explain me simply the steps to take to just get the campaign data for a period of time from my account and not just link me a MS documentation where I have never managed to fully understand and make it work?

John Sp
  • 66
  • 3
  • 13
  • When it blows up, what happens? Do you get an exception, or a bad response, or something else? – Will Custode Nov 19 '19 at 14:49
  • Something that I cannot access the debugger of the bing server. My main problem is that I cannot fully understand what is the logic behind accessing Bing Ads API. It is so confusing :S – John Sp Nov 19 '19 at 14:53
  • I hear you, that's frustrating. But what happens when you step over that line? Can you post a screenshot or copy the exception/error/debugger state? – Will Custode Nov 19 '19 at 14:56
  • It will help to post repro steps e.g., 1. git clone https://github.com/BingAds/BingAds-dotNet-SDK.git 2. Under examples/BingAdsExamples/BingAdsConsoleApp edit app.config with production environment, client ID, developertoken. 3. edit Program.cs to use V13.ReportRequests instead of V13.SearchUserAccounts. 4. run BingAdsConsoleApp – Eric Urban Nov 19 '19 at 14:58
  • Please someone write an example and explain in simple words each step to achieve getting campaign data from my account. It will help a lot of people struggling like me to understand the confusing scattered documentation of Bing Ads API!! – John Sp Nov 19 '19 at 15:26

1 Answers1

0

From the partial screenshot it appears error AADSTS70000 was returned. Note the Azure identity documentation is applicable across many Microsoft services (not just advertising APIs), so the issue might not be specific to the Bing Ads API. Per the Azure identity error codes documentation:

InvalidGrant - Authentication failed. The refresh token is not valid. Error may be due to the following reasons:

  • Token binding header is empty
  • Token binding hash does not match

I was able to repro the same error just be adding one invalid character to an otherwise valid refresh token. Do you have more details about the repro steps? Otherwise have you tried one of the walk-through guides to make sure the authentication is correct e.g., here or here?

Eric Urban
  • 582
  • 2
  • 7
  • Eric I can't find a walk through on how to get my Account's campaigns. For example the Google Ads SDK is more comprehensive. The steps make sense but Bing Ads walk through can't help me get my account's campaigns. Can you post a step by step process on how to get my account's campaigns data? – John Sp Nov 20 '19 at 13:33