I've followed the directions best I could and when I run the following test command I get this error:
Fault message: [AuthenticationError.NOT_ADS_USER @ ; trigger:'<null>']
Here is how I'm authenticating (JSON key parsed via `OpenSSL::PKey::RSA`):
json = JSON.parse(Rails.application.secrets.adwords[:oauth2_key])
key = OpenSSL::PKey::RSA.new(json['private_key'])
@client = AdwordsApi::Api.new({
authentication: {
method: 'OAUTH2_SERVICE_ACCOUNT',
user_agent: 'AdManager/1.0.0',
oauth2_key: key,
oauth2_issuer: Rails.application.secrets.adwords[:oauth2_issuer],
developer_token: Rails.application.secrets.adwords[:developer_token],
client_customer_id: customer_id
},
service: {
environment: 'PRODUCTION'
},
connection: {
enable_gzip: false
},
library: {
log_level: 'INFO'
}
})
@client.service(:CampaignService, :v201708).get({:fields => ['Id', 'Name', 'Status']}
Here are the steps I did in order:
1. Log into my MCC AdWords account
2. Visit Google Developer Console
3. Create a new Project
4. Create a Service Account key. Make sure the domain checkbox is checked. I use the email address it generates above in `oauth2_issuer`
5. Download the JSON key
6. Get an MCC account (I actually had one I use for live campaigns, so I skipped this step)
7. Generate an AdWords API key from within MCC (i used it above in `developer_token`).
8. Create a new test manager account.
9. Inside the new test manager account, create a new test client account, and take that customer ID and place it above in `client_customer_id.
I'm not sure where I went wrong, from what I can tell I followed the steps exactly.
Thanks