I tried to query campaign report data through ads http api but got an error.
My request is

*POST /v11/customers/{my-customer-id}/googleAds:searchStream HTTP/1.1 *
*Host: googleads.googleapis.com *
*Developer-token: {my-developer-token} *
*Content-length: 282 *
*Content-type: application/json *
*Authorization: Bearer {access-token}*






*{  "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"}*

The full response is























*[  {    "error": {      "status": "UNAUTHENTICATED",       "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. 
<https://developers.google.com/identity/sign-in/web/devconsole-project.>", 
      "code": 401,       "details": [        {          "errors": [        
    {              "errorCode": {                "authenticationError": 
"AUTHENTICATION_ERROR"              },               "message": 
"Authentication of the request failed."            }          ],           
"@type": 
"type.googleapis.com/google.ads.googleads.v11.errors.GoogleAdsFailure",     
      "requestId": "kFLvE-o4K92C4wJLnVqPAw"        }      ]    }  }]*

And received the same response when running the example in google-ads-java.
Is this because that my account only has test account access? 
Please tell me the mistake I've made in the request.
Thanks!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/4e2f1bf6-569b-430c-bd7f-ecccc7e47d27n%40googlegroups.com.
  • Er... Xin Chen
    • ... Xin Chen
      • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to