Hello Nayana,
Greetings from the Google Ads API Team.
Please note that according to this API documentation(https://developers.google.com/google-ads/api/docs/client-libs/php/oauth-service#set_up_client_library_with_json_file), the following fields need to be set when using the service account flow:
Since you have already set these fields, can you confirm if you have commented out clientId, clientSecret, and refreshToken in your configuration file? It is stated here in the file under [OAUTH2] that(https://github.com/googleads/google-ads-php/blob/8372d9f7551240e70fbe569a12d7e12f8fe0c324/examples/Authentication/google_ads_php.ini), “Required OAuth2 credentials. Uncomment and fill in the values for the appropriate flow based on your use case”. Since your flow is for service accounts, can you please try commenting out these lines and running your code again?
If you have any further questions relating to the configuration file, I would suggest contacting the PHP client library owner on github via their Issues Tab for more insights on your issue as they are more equipped to answer inquiries relating to their client library. You may contact them via the link below:
![]() |
Google Ads API Team |