code": 403, "message": "Request had insufficient authentication scopes

45 views
Skip to first unread message

Philippe Malterre

unread,
Jul 21, 2025, 4:29:47 AM7/21/25
to Google Ads API and AdWords API Forum
Trying to :  
google.apps.forms.v1.FormsService.ListFormResponses
oAuth2 is successfull
Permission done 

Really don't know what I miss.

Thanks

Google Ads API Forum Advisor

unread,
Jul 21, 2025, 7:43:24 AM7/21/25
to philippe.mal...@gmail.com, adwor...@googlegroups.com

Hi,

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

Based on the provided information, I understand that you are encountering a permission denied error. To assist you further, could you please confirm whether you are using the Google Ads API or any other third party application? Kindly note that we can only provide support for Google Ads API related concerns.

If you are using the Google Ads API and encountering USER_PERMISSION_DENIED error, I would recommend you to specify the ‘login-customer-id’ as the manager account ID without hyphens (-) when accessing the customer account. Also, please note that the email Id that you're using to generate OAuth credentials is added to your Google Ads account with 'Admin' or 'Standard' access to perform mutate operations. Additionally, please verify that you have the correct access level for the Google Ads account you are trying to access. I would recommend you to refer to this documentation for more detailed information. If you are still facing any issues, then in order to investigate the issue further, kindly provide us with the email ID that you have used to generate OAuth credentials.

And also, I would recommend you to add the ‘https://www.googleapis.com/auth/adwords” scope for the Google Ads API. I would recommend you to refer to Configure a Google API Console Project for the Google Ads API for more information.

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-07-21 11:42:39Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01swDh7:ref" (ADR-00319567)



Philippe Malterre

unread,
Jul 21, 2025, 12:51:53 PM7/21/25
to Google Ads API and AdWords API Forum
Well,

First, thanks for taking time to answer, really appreciate. No I am not using Google Ads Api but native Google Api. Sorry if I have been out of scope. I fully understand that is not the right place to be.

However, before to close I can add a comment. 

Finaly it works, It was just a question of old token. When I reinitialise the token, the new token took the corresponding security definition and php script works fine. Bye

<?php
require_once "/Users/phili/Php/GoogleApis/apiclient/vendor/autoload.php";

session_start();

 use Google\Client;
 use Google\Service\Forms;
 use Google\Service\Exception;

require_once "/Users/xxxxx/Php/Scripts/Oauth2Authentication.php";
$_SESSION['mainScript'] = basename($_SERVER['PHP_SELF']);  
$client = getGoogleClient();
  $service = new Forms($client);
  $formId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

 try {
   $responses = $service->forms_responses->listFormsResponses($formId);
    foreach ($responses->getResponses() as $response) {
        echo 'Response ID: ' . $response->getResponseId() . "\n";
        echo 'Submitted Time: ' . $response->getCreateTime() . "\n";
        // Access individual answers
        foreach ($response->getAnswers() as $questionId => $answer) {
            echo 'Question ID: ' . $questionId . "\n";
            echo 'Answer: ' . $answer->getTextAnswers()->getAnswers()[0]->getValue() . "\n";
        }
    }
 } catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
 }
?>
Reply all
Reply to author
Forward
0 new messages