Hi,
I followed the following info in this youtube video
Yes, I know it's old> but I must say it was very helpful. I have also created a developer token. Still in test mode and have created the OAuth2 for an application. Once I did that. I created a refresh token and then pasted the response info into my app.config file.
I have also created a test account to be used with the dev token, as it's still in testing.
I am also using the examples V8 which I downloaded.
Now I will start with what does work. If I run: AccountManagement\CreateCustomer.cs. It creates a customer in my test account successfully as below.
This code example illustrates how to create a new customer under a given manager account.
Note: this example must be run using the credentials of a Google Ads manager account. By default, the new account will only be accessible via the manager account.
Created a customer with resource name 'customers/1063876605' under the manager account with customer ID 'xxxxxxxxx'
I then created a test campaign under the newly created customer, although it's still in draft status. Not sure if this is relevant.
Now for what doesn't work:
If I run BasicOperations\GetCampaigns and set my manager account ID in the config file under <add key = 'LoginCustomerId' value = xxxxxxx /> and the customer ID as the one created above. It returns the following
G:\My Projects\C#\Google ads\Latest examples\google-ads-dotnet-main\examples\bin\Debug\netcoreapp3.0\Google.Ads.GoogleAds.Examples.exe (process 13496) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
But if I don't configur <add key = 'LoginCustomerId'
value = xxxxxxx /> in the config file and still use the account ID as created above. I get the following:
This code example gets all campaigns. To add campaigns, run AddCampaigns.cs.
Failure:
Message: Status(StatusCode="PermissionDenied", Detail="The caller does not have permission", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1633431129.992000000","description":"Error received from peer ipv4:
216.58.223.74:443","file":"..\..\..\src\core\lib\surface\call.cc","file_line":1068,"grpc_message":"The caller does not have permission","grpc_status":7}")
Failure: { "errors": [ { "errorCode": { "authorizationError": "USER_PERMISSION_DENIED" }, "message": "User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header. See
https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid" } ], "requestId": "hgLMtllTEEhwDDnuFIlEOw" }
Request ID: hgLMtllTEEhwDDnuFIlEOw
So why is it that I have permission to create a customer, but I don't have permission to do anything else?
Thanks