Google ads api

439 views
Skip to first unread message

Hamza Shah

unread,
Apr 4, 2023, 12:49:18 PM4/4/23
to Google Ads API and AdWords API Forum
i recived this error on this api : https://googleads.googleapis.com/v13/customers/myCustomer_id/googleAds:search  

"code": 403,
        "message": "Request had insufficient authentication scopes.",
        "status": "PERMISSION_DENIED",
        "details": [
            {
                "@type": "type.googleapis.com/google.rpc.ErrorInfo",
                "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
                "domain": "googleapis.com",
                "metadata": {
                    "method": "google.ads.googleads.v13.services.GoogleAdsService.Search",
                    "service": "googleads.googleapis.com"
                }
            }
        ]
    }


im trying to get campaign details like montly cast of a campaign, is I'm doing it correct or not , if not please guide me how can I get that details on which api and how

Google Ads API Forum Advisor

unread,
Apr 4, 2023, 1:31:25 PM4/4/23
to hamzas...@gmail.com, adwor...@googlegroups.com

Hello,

Thank you for reaching out to the Google Ads API Support.

You may ensure that you have properly created OAuth client ID and OAuth Client Secret as per this guide. Also, could you confirm if you have generated a refresh token using our supported client libraries ? If so, then you may need to generate a refresh token as per this code example in order to resolve the 'ACCESS_TOKEN_SCOPE_INSUFFICIENT' error on your end.

You may give it a try, and let us know how this goes on your end.

Regards,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2kFF5f:ref

Hamza Shah

unread,
Apr 4, 2023, 2:05:30 PM4/4/23
to Google Ads API and AdWords API Forum
im using GoogleAuthProvider From firebase/auth which react library. On success its return OauthAccessToken, and refreshToken Then I use that token as a authorization bearer token in header on google ads api 

Google Ads API Forum Advisor

unread,
Apr 4, 2023, 4:45:36 PM4/4/23
to hamzas...@gmail.com, adwor...@googlegroups.com

Hello,

Thank you for getting back to us.

I understand that you are using another method to obtain the refresh token, but I recommend following our guide in obtaining Oauth Refresh Token.

If the error persists, can you please provide us with the complete request and response logs with request ID generated as shown in the respective links, so we can check on our end the errors being thrown?

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 this link. For REST interface requests, you can enable logging via the curl command by using the -i flag. 

You can provide it via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Regards,

Reply all
Reply to author
Forward
0 new messages