Posts tagged with vb.net

I have been struggling with the Google Ads Api to get the MCC Accounts for the last two weeks but I am unable to achieve what I want.

I have the App.Config figured out

<GoogleAdsApi>     <!-- API-specific settings -->      <add key="DeveloperToken" value="XXXXXXX"/>     <!-- OAuth2 settings -->     <add key="AuthorizationMethod" value="OAuth2" />     <add key = "OAuth2ClientId" value = "XXXXXXX.apps.googleusercontent.com" />     <add key = "OAuth2ClientSecret" value = " XXXXXXX  " />     <add key = "OAuth2Mode" value="APPLICATION"/>     <add key = "OAuth2RefreshToken" value = "1//0gd2 XXXXXXX  " /> </GoogleAdsApi> 

This is the code that I am currently working with

Public Sub GetMCCAccounts(ByVal client As GoogleAdsClient)     Dim customerService As CustomerServiceClient = client.GetService(Services.V8.CustomerService)     Dim customerResourceNames As String() = customerService.ListAccessibleCustomers()     For Each customerResourceName As String In customerResourceNames         Dim ManagerCustomerId = customerResourceName.Substring(customerResourceName.IndexOf("/") + 1)         TextBox1.AppendText(vbCrLf & ManagerCustomerId)     Next End Sub 

I am not getting the correct results. The MCC accounts that I was hoping for do not appear in the output. I am getting different account numbers. What am I missing?

Expected MCC Accounts

I am looking for these 10 MCC accounts.

Sub Account Settings Overview

Output

I am getting these 16 account numbers.

64xxxxxxxx 71xxxxxxxx 10xxxxxxxx 88xxxxxxxx 32xxxxxxxx 58xxxxxxxx 31xxxxxxxx 73xxxxxxxx 98xxxxxxxx 22xxxxxxxx 48xxxxxxxx 37xxxxxxxx 98xxxxxxxx 94xxxxxxxx 88xxxxxxxx 43xxxxxxxx