Hello.
This is my test request:

$body = '
                {
                    "query" : "SELECT campaign.name, campaign.status, 
segments.device,
                                      metrics.impressions, metrics.clicks, 
metrics.ctr,
                                      metrics.average_cpc, 
metrics.cost_micros
                              FROM campaign
                              WHERE segments.date DURING LAST_30_DAYS"
                }';

$url = 
'https://googleads.googleapis.com/v11/customers/XXXX721442/googleAds:searchStream';
  
             
                $curl = curl_init();
                curl_setopt_array($curl, array(
                    CURLOPT_URL => $url,
                    CURLOPT_RETURNTRANSFER => true,
                    CURLOPT_POST => TRUE,
                    CURLOPT_ENCODING => '',
                    CURLOPT_MAXREDIRS => 10,
                    CURLOPT_TIMEOUT => 1000,
                    CURLOPT_FOLLOWLOCATION => true,
                    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                    CURLOPT_CUSTOMREQUEST => 'POST',
                    CURLOPT_HTTPHEADER => array(
                        'Content-Type: application/json',
                        'Authorization: ' . $token,
                        'developer-token: XXXXSYDjfJzkAZ0meiXXXX',
                        'login-customer-id: XXXX625735'
                    ),
                    CURLOPT_POSTFIELDS => $body,
                ));

This is my return:
ERRO: [{"error": {"code": 403,"message": "Request had insufficient 
authentication scopes.","status": "PERMISSION_DENIED","details": [n      { 
"@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": 
"ACCESS_TOKEN_SCOPE_INSUFFICIENT", "domain": "googleapis.com", "metadata": 
{   "method": 
"google.ads.googleads.v11.services.GoogleAdsService.SearchStream",   
"service": "googleads.googleapis.com

To receive the data from Google Analytics, all ok, but, when change to 
receive data from ADS, with our admin token, this message is returned.

Thak“s.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 on the web visit 
https://groups.google.com/d/msgid/adwords-api/27bd88b7-197b-4bd7-89f5-58b665ffb735n%40googlegroups.com.

Reply via email to