Hi Google Supports,
Originally, our app was using AWQL to get the report data. Nowdays, we are
just trying google ads api to fetch report data. For our app was develped
by golang, so I am trying the golang version from:
"google.golang.org/genproto/googleapis/ads/googleads/v2/services". Hear
are my sample codes:
googleAdsService := services.NewGoogleAdsServiceClient(client.Conn())
// Create a search request
request := services.SearchGoogleAdsRequest{
CustomerId: "1234567890", // here just faked
Query: "SELECT campaign.id, campaign.name FROM campaign",
}
// Get the results
response, err := googleAdsService.Search(client.Context(), &request)
if err != nil {
fmt.Printf("err:%v\n", err)
} else {
for _, row := range response.Results {
campaign := row.Campaign
fmt.Printf("id: %d, name: %s\n", campaign.Id.Value, campaign.Name.Value)
}
}
I always received the response:
err:rpc error: code = Internal desc = Internal error encountered.
When the credentiuals is wrong, the response instead of above will be:
panic: oauth2: cannot fetch token: 400 Bad Request
Response: {
"error": "invalid_grant",
"error_description": "Bad Request"
}
So I'm sure the credentials is correct, which I am using to fetch data through
AWQL.
Thanks for your help.
Tao
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/8cca64b5-45f0-40ab-a9b7-c30e9f4e995e%40googlegroups.com.