I don't know under which context I don't have permissions, whether it's under my Google Admin account, or something specific to API Manager, or Developer Console, or...
But, since I'm not presented with a lot of options, I click "OK", and can see a list of APIs, despite the error, but Content API for Shopping and AdWords API aren't in the list at all.
So, I've followed a rather convoluted trail of crumbs to what seems to be a dead end.
How is this supposed to work? Where did I go astray?
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/227d394c-394e-4bcb-8ff5-a878924df2f2%40googlegroups.com.--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to a topic in the Google Groups "AdWords Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/AHRp8-t_XuA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.
function main() {
var merchantId = 'XXXXXXX'; //matches the Shopping Campaign
var products = ShoppingContent.Products.list(merchantId);
if (products.resources) {
for (var i = 0; i < products.resources.length; i++) {
Logger.log(products.resources[i]);
}
}
}
Do NOT, however, click the highlighted Google Developers Console link--it's correct that you'll need to enable that, but there's a MUCH easier way to find the right setting.
Save the change, and preview the script again. This time, it will give you an error that the API hasn't been enabled, in the logs. The error, however, includes a full URL to exactly the page you need to enable your API connection. Open that link in a new tab, and click the "enable" button.
Now, when you preview your script, it will give you an error that you don't have access to the Merchant Center account in question. I believe this is because your MCC login isn't itself connected to the Merchant Center account in question.
However, Tyler pointed out that there is an MCC equivalent for Merchant Center, and you can apply for a Multi-Client Account (MCA, not to be confused with MCC). You can do so here: https://support.google.com/merchants/answer/188487?hl=en
Once approved, it looks like you can only add accounts, not link existing ones. All you need to do is have an admin on the account in question approve the addition, as per the Merchant Center support team:
Hi Roy,
In order to link an existing account to the MCA, please have the admin of the client account email us with the statement below. What is your client's ID number? Can you add them to this email and have them respond with the highlighted text below?
I authorize Google to link Merchant Center {FILL IN ID} to the {Multi-client account id}"
Thanks,
Michelle
Now that the email address that I run my MCC from also has permissions to the Merchant Center account in question, permissions finally line up, and it appears to work as intended.
From here, I can store an array of Merchant Center Ids, loop over my client accounts, and generally perform miracles.
Thanks again to Tyler for pushing me in the right direction several times along the way!