public void Run(AdWordsUser user) { using (ManagedCustomerService managedCustomerService = (ManagedCustomerService)user.GetService( AdWordsService.v201802.ManagedCustomerService)) {
// Create account. ManagedCustomer customer = new ManagedCustomer(); customer.name = "Customer 01"; customer.currencyCode = "VND"; customer.dateTimeZone = "Europe/London";
// Create operations. ManagedCustomerOperation operation = new ManagedCustomerOperation(); operation.operand = customer; operation.@operator = Operator.ADD;
// For whitelisted users only, uncomment two commands below as part of the // ADD operation to invite a user to have access to an account. An email // will be sent to that user inviting them to have access to the newlyd // created account. operation.inviteeEmail = "truong.n...@haravan.com"; operation.inviteeRole = AccessRole.ADMINISTRATIVE;
try { ManagedCustomerOperation[] operations = new ManagedCustomerOperation[] { operation }; // Add account. ManagedCustomerReturnValue result = managedCustomerService.mutate(operations);
// Display accounts. if (result.value != null && result.value.Length > 0) { ManagedCustomer customerResult = result.value[0]; Console.WriteLine("Account with customer ID \"{0}\" was created.", customerResult.customerId); } else { Console.WriteLine("No accounts were created."); } } catch (Exception e) { throw new System.ApplicationException("Failed to create accounts.", e); } }AdWordsApiException: Exception of type 'Google.Api.Ads.AdWords.Lib.AdWordsApiException' was thrown.
Error reason is unknown.. (Error: RequestError.UNKNOWN, FieldPath: operations[0].inviteeEmail, Trigger: truong.n...@haravan.com)
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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 a topic in the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/QqqOyJhqTEg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/ce1bd61b-57b2-4bb5-9501-6ae3b05fc626%40googlegroups.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 a topic in the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/QqqOyJhqTEg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
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+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/bf0de6ce-e7bf-4d9f-9c5a-edfd06c32725%40googlegroups.com.
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...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/bf0de6ce-e7bf-4d9f-9c5a-edfd06c32725%40googlegroups.com.
|
||||||