Trying to use authenticade user token to retrieve info from that specific user

34 views
Skip to first unread message

Enzo Patriarca

unread,
Sep 22, 2023, 9:45:44 AM9/22/23
to Google Ads API and AdWords API Forum
$accessToken = $user->token;
$oauth2Token = (new OAuth2TokenBuilder())
->withAccessToken($user->token)
->build();

// Load the OAuth2 credentials from a file (google_ads_php.ini).
$credentialsLoader = CredentialsLoader::fromFile(public_path('google_ads_php.ini'));

// Build the Google Ads client with the OAuth2Token.
$googleAdsClient = (new GoogleAdsClientBuilder())
->withOAuth2Credential($oauth2Token)
->fromFile(public_path('google_ads_php.ini'))
// ->usingGapicV2Source(true)
->build();


but i am getting error of methods and i want to know a way to do it(i am using php laravel)

Google Ads API Forum Advisor

unread,
Sep 27, 2023, 6:40:17 AM9/27/23
to enzo.pa...@joinads.me, adwor...@googlegroups.com
Hi,

Thank you for contacting the Google Ads API support team.

By reviewing your concern, I understand that you are encountering an error. In order to analyse your issue further, kindly provide us with the complete API logs (request and response with request-id and request header) generated at your end and uncropped UI screenshot of where you are facing the issue.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag. 

You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:_00D1U1174p._5004Q2p0UNP:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages