Hi,

I also had to delete your initial post as it contained your client ID. I am 
reposting the rest of your post instead for reference :

"Hello
Please forgive me in advance for my English The Google Ads API client library 
uses gRPC. However, my hosting provider does not give the option to install 
gRPC. So I have to use the REST API. I am trying to get an access token using 
the following code:

$url = "https://accounts.google.com/o/oauth2/auth";;
$arr = array(
'grant_type' => 'refresh_token',
'refresh_token' => '***refreshtoken***',
'client_id' => '***clientid***',
'client_secret' => '***clientsecret***',
);
$headers = array(
'Accept: application/json',
'Content-Type: application/json',
);
$post_arr=array();
foreach ($arr as $key=>$value) {
$post_arr[]=$key."=".$value;
}
$data=implode('&',$post_arr);

$handle=curl_init();
curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($handle, CURLOPT_URL, $url);
curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
$response=curl_exec($handle);
$code=curl_getinfo($handle, CURLINFO_HTTP_CODE);

In response I get error 302 and the following


<HTML>
<HEAD>
<TITLE>Moved Temporarily</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Temporarily</H1>
The document has moved <A HREF=XXXXXXXXX>here</A>.
</BODY>
</HTML>

What is my mistake?"

Best regards,

Peter Laurence Napa Oliquino
Google Ads API Team
ref:_00D1U1174p._5004Q2Iwqi6:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/U6g7z000000000000000000000000000000000000000000000QV3LWV00UOddAlhjRN-aozmKqOs7Sg%40sfdc.net.
  • g... 'Вячеслав Иванов' via AdWords API and Google Ads API Forum
    • ... AdWords API and Google Ads API Forum
    • ... 'Aryeh Baker' via AdWords API and Google Ads API Forum
      • ... Google Ads API Forum Advisor
        • ... Google Ads API Forum Advisor

Reply via email to