Hello.

I am using PHP to call Google Ads API. 

I am trying to retriev the Google ads campaign id and name. I am using 
simple curl to do this. Here is my code.

*Code*
$url = 
'https://googleads.googleapis.com/v3/customers/123456789/googleAds:search';
$parameters = [
    "query" => "SELECT campaign.id, campaign.name FROM campaign",
    "token-type" => "Bearar",
    "Authorization" => 
session()->get('access_token_googleads')['access_token'],
    "developer-token" => "nswf[qf[p[..................",
];
$content_type = 'application/json';
$response = $this->getResponse($url, $parameters, $content_type, $post = 
true);
echo '<pre>';
print_r($response);

*Response*
I am getting the below response after execute this code in the browser.

{
  "error": {
    "code": 401,
    "message": "Request is missing required authentication credential. Expected 
OAuth 2 access token, login cookie or other valid authentication credential. 
See https://developers.google.com/identity/sign-in/web/devconsole-project.";,
    "status": "UNAUTHENTICATED"
  }
}


Please let me know what I missed.

I am using this documentation to run the code 
https://developers.google.com/google-ads/api/docs/reporting/example.

Let me know whether Adwords and Ads are same.

I am using my client's customer id and developer-token supplied by him. I do 
not not have Ad Manager account. 

I am using Google cloud console > APIs & Services to create OAuth client id. 

Is there anyway I can use REST API to use the Google Ads API V3?


Please help me by resolved this issue, by suggesting, by modifyfying code, etc. 
I am waiting for the reply.


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/1eab93b8-15ec-4463-b8ff-085e70f70655%40googlegroups.com.

Reply via email to