RE: InvalidArgument when migrating from AdWords to Ads API v8

2021-10-14 Thread 'Google Ads API Forum Advisor' via AdWords API and Google Ads API Forum
Hi Roy,

Thanks for reaching out. I've deleted your post because it contains sensitive 
information (your email in the top right corner of the screenshot). Please feel 
free to reply to us privately.

Can you please remove the hyphens from the customer ID in your request and then 
retry? Please let us know if you continue to have issues after trying this.

Regards,
Matt
Google Ads API Team

Matt
Google Ads API Team
ref:_00D1U1174p._5004Q2PJFGG: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 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/p7DzY0R0Z2RG00M1n1uGHvT-WYuuzUQ18BXA%40sfdc.net.


InvalidArgument when migrating from AdWords to Ads API v8

2021-10-13 Thread Roy Yin
Hi, 

we need some help at Google Ads API configuration, we developed an 
integration using Google AdWords that will auto create Google Ads customers 
and we are migrating to Google Ads API v8 recently. After the change, the 
request to get a customer ID failed with below error message:

{
  "StatusCode": 3,
  "Details": "Request contains an invalid argument.",
  "RequestId": "_GphQ-gsNj0jQGn1ldN_Yg",
  "Failure": {
"errors": [
  {
"errorCode": {
  "requestError": "INVALID_CUSTOMER_ID"
},
"message": "Invalid customer ID '472-xxx-'."
  }
],
"requestId": "_GphQ-gsNj0jQGn1ldN_Yg"
  }
}

that customer ID is a Test Manager Account that we used before during the 
development, now it has a strange status as shown in the below screenshot, 
could that be the reason that it is showing this error? If yes, how can we 
solve this situation?

[image: Screenshot 2021-10-13 220347.png]

This is our implementation that is throwing this error:

public Result GetSubAccountId(PdCompany company, PdDeal deal)
 {
var result = Result.Ok();
var config = new GoogleAdsConfig
{
DeveloperToken = Config.GoogleAdsDeveloperToken,
OAuth2Scope = "https://www.googleapis.com/auth/adwords";,
OAuth2ClientId = Config.GoogleOAuth2ClientId,
OAuth2ClientSecret = Config.GoogleOAuth2ClientSecret,
OAuth2RefreshToken = Config.GoogleOAuth2RefreshToken
};
var adsClient = new GoogleAdsClient(config);
var svc = adsClient.GetService(Services.V8.GoogleAdsService);

var response = svc.Search(Config.GoogleAdsClientCustomerId, $@"
SELECT  customer.id 
FROM customer 
WHERE   customer.descriptive_name = 
'{GetSubAccountName(company, deal)}'");

result.Success = response.Any();
if (result.Success)
{
result.Data = response.First().Customer.Id.ToString();
}
return result;
}

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/d84453ae-1676-463b-95bb-53d1cb0f104dn%40googlegroups.com.