Google.Api.Ads.AdManager.Lib.AdManagerApiException: 'AdManagerApiException: A valid application name was not found in the request header

107 views
Skip to first unread message

Steve Ngai

unread,
Dec 26, 2023, 3:00:16 PM12/26/23
to Google Ads API and AdWords API Forum
I am trying to setup XUnit to test my google ad manager api service. When I run the test, I hit this exception.

Google.Api.Ads.AdManager.Lib.AdManagerApiException: 'AdManagerApiException: A valid application name was not found in the request header. Please provide a valid application name by modifying the ApplicationName setting in your application's

This is my constructor which has the issue to configure ApplicationName

I also can't find NetworkCode and AuthorizationMethod

public class GoogleAdManagerServiceTest { private readonly GoogleAdManagerService _googleAdManagerService; private readonly AdManagerUser _user; public GoogleAdManagerServiceTest() { _user = new AdManagerUser(); _user.Config.ApplicationName = "xxx"; // How to configure ApplicationName because it cannot be found. _user.Config.OAuth2ClientId = "xxx"; _user.Config.OAuth2ClientSecret = "xxx"; _user.Config.OAuth2RefreshToken = "xxx"; _googleAdManagerService = new GoogleAdManagerService(_user); } [Fact] public void TestGetCompanies() { try { // Arrange // Act // Assert } catch (Exception ex) { Assert.True(false, $"Test failed with exception: {ex.Message}"); } } }

Google Ads API Forum Advisor

unread,
Dec 26, 2023, 4:28:30 PM12/26/23
to findin...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

By reviewing your concern, I understand that you're attempting to configure XUnit for testing your Google Ad Manager API service but encountering an AdManagerApiException. Please note that this forum support can only assist with technical queries or concerns related to the Google Ads API. As this issue is related to Google Ad Manager, I would recommend you reach out to the Google Ad manager API support team through this forum link and you can raise your concerns there. 
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02r3k2R:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages