The caller does not have permission error

115 views
Skip to first unread message

Henrik Ravnskjær

unread,
Jun 29, 2023, 6:16:55 AM6/29/23
to Google Ads API and AdWords API Forum
What permissions am I missing?

I have a console app where I get clientID and Secret from.

I login to Google Ads with our manager account, where I get our developertoken and customerID (from the top right, without "-" )1developertoken.jpg2ManagerAndCustomerid.jpg

I then run this code to get the refreshtoken for that user.
3LoginCode.jpg
I of cause login as the manager account again.
3GoogleKonti.jpg

Now I (believe) have all needed info to get data from Google Ads.

4CodeVariables.jpg

So I run this code
 var customerId = long.Parse(CustomerID);
    GoogleAdsConfig config = new GoogleAdsConfig()
    {
      OAuth2Mode = Google.Ads.Gax.Config.OAuth2Flow.APPLICATION,
      OAuth2ClientId = ClientId,
      OAuth2ClientSecret = ClientSecret,
      OAuth2RefreshToken = RefreshToken,
      LoginCustomerId = CustomerID,
      DeveloperToken = DeveloperToken
    };
    var client = new GoogleAdsClient(config);

    GoogleAdsServiceClient googleAdsService = client.GetService(Services.V14.GoogleAdsService);
    string query = @"SELECT campaign.id, campaign.name, campaign.network_settings.target_content_network FROM campaign ORDER BY campaign.id";

    try
    {
      googleAdsService.SearchStream(customerId.ToString(), query,
          delegate (SearchGoogleAdsStreamResponse resp)
          {
            foreach (GoogleAdsRow googleAdsRow in resp.Results)
            {
              Console.WriteLine("Campaign with ID {0} and name '{1}' was found.",
                            googleAdsRow.Campaign.Id, googleAdsRow.Campaign.Name);
            }
          }
      );
    }
    catch (GoogleAdsException e)
    {
      Console.WriteLine("Failure:");
      Console.WriteLine($"Message: {e.Message}");
      Console.WriteLine($"Failure: {e.Failure}");
      Console.WriteLine($"Request ID: {e.RequestId}");
      throw;
    }

But I get a "The caller does not have permission" error.
What am I missing? 
The manager user can see all our campaigns.

Google Ads API Forum Advisor

unread,
Jun 30, 2023, 11:30:06 AM6/30/23
to h...@feline.dk, adwor...@googlegroups.com

Hi Henrik,

Thank you for reaching out to Google Ads API Forum.

With regards to your concern, could you provide us with the complete logs generated on your end showing the error in this format (request and response logs with request id and request header)? This is so we could provide more appropriate guidance. 

If you haven't enabled logging yet, it can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from the link below. 

You may then send the requested information privately via the Reply to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Reference links:

This message is in relation to case "ref:_00D1U1174p._5004Q2mpeMv:ref"

Thanks,
 
Google Logo Google Ads API Team


Henrik Ravnskjær

unread,
Jul 3, 2023, 2:59:27 AM7/3/23
to Google Ads API and AdWords API Forum
Replied to all, so others can see my solution
 
Enabling logging showed me the problem.
Code:
    // Detailed logs.
    TraceUtilities.Configure(TraceUtilities.DETAILED_REQUEST_LOGS_SOURCE,
        "D:\\temp\\Google\\detail.log", System.Diagnostics.SourceLevels.All);

    // Summary logs.
    TraceUtilities.Configure(TraceUtilities.SUMMARY_REQUEST_LOGS_SOURCE,
        "D:\\temp\\Google\\summary.log", System.Diagnostics.SourceLevels.All);

Log result:
"errors": [
      {
        "errorCode": {
          "authorizationError": "DEVELOPER_TOKEN_NOT_APPROVED"
        },
        "message": "The developer token is only approved for use with test accounts. To access non-test accounts, apply for Basic or Standard access."
      }

I applied for basic access two weeks ago, but haven't heard anything. No accept or decline message. 
I looked it up and it should take about three business days... So.. I don't know why It's been this long.

I applied again, so hopefully it will be approved soon.


Google Ads API Forum Advisor

unread,
Jul 3, 2023, 2:02:25 PM7/3/23
to h...@feline.dk, ads-api-compl...@google.com, adwor...@googlegroups.com

Hello Henrik,

Thank you for providing additional information.

Kindly note that, we are unable to provide updates or the status of your application as our team specializes in Google Ads API related concerns and technical implementations only. To ensure you get proper assistance, we are reaching out to the Google Ads API Compliance team on your behalf and requesting input. 

In the meantime, please provide your MCC ID which holds your developer token and the Cases2 ID that was generated when you applied for additional access for it, if there's any, so the compliance team can check it on their end. A Cases2 ID has a format of #-############# and is usually found in the email subject or body. 

@Compliance Team, please find the pertinent details below and confirm if you are able to assist.

Summary:
Henrik has applied for Basic access 2 weeks ago, but has yet to receive a response. He tried to submit a new application which he hopes to get approved as soon as possible.

Google Ads manager account (MCC) ID: (requested)
Cases2 ID: (requested)

Reply all
Reply to author
Forward
0 new messages