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();
 }
?>
Le lundi 21 juillet 2025 à 13:43:24 UTC+2, Google Ads API Forum Advisor a 
écrit :

> 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* 
> <https://developers.google.com/google-ads/api/docs/start> or any other 
> third party application? Kindly note that we can only provide support for 
> *Google 
> Ads API* <https://developers.google.com/google-ads/api/docs/start> 
> related concerns.
>
> If you are using the *Google Ads API* 
> <https://developers.google.com/google-ads/api/docs/start> and 
> encountering *USER_PERMISSION_DENIED* 
> <https://developers.google.com/google-ads/api/reference/rpc/v17/AuthorizationErrorEnum.AuthorizationError#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* 
> <https://developers.google.com/google-ads/api/rest/common/mutate?hl=en> 
> operations. Additionally, please verify that you have the correct *access 
> level* 
> <https://support.google.com/google-ads/answer/9978556?visit_id=637628826037447236-382779227&rd=1>
>  
> for the Google Ads account you are trying to access. I would recommend you 
> to refer to this *documentation* 
> <https://developers.google.com/google-ads/api/docs/best-practices/common-errors#:~:text=USER_PERMISSION_DENIED>
>  
> 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* 
> <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* 
> <https://developers.google.com/google-ads/api/docs/oauth/cloud-project#configure_the_oauth_consent_screen>
>  
> for more information.
> Thanks,
>   
> [image: Google Logo] Google Ads API Team 
> Feedback
> How was our support today? 
>
> [image: rating1] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=1&entry.295079254=500Ht00001swDh7IAE>
>   
>   [image: rating2] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=2&entry.295079254=500Ht00001swDh7IAE>
>   
>   [image: rating3] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=3&entry.295079254=500Ht00001swDh7IAE>
>   
>   [image: rating4] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=4&entry.295079254=500Ht00001swDh7IAE>
>   
>   [image: rating5] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=5&entry.295079254=500Ht00001swDh7IAE>
> [2025-07-21 11:42:39Z GMT] This message is in relation to case 
> "ref:!00D1U01174p.!500Ht01swDh7:ref" (ADR-00319567)
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/adwords-api/9b4f0f53-8625-41d3-a6d4-338680b61792n%40googlegroups.com.
  • co... Philippe Malterre
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Philippe Malterre

Reply via email to