Content API for Shopping Unable to Auth using .Net

52 views
Skip to first unread message

L W

unread,
Mar 29, 2021, 3:24:15 PM3/29/21
to Google Content API for Shopping
Hello,

I am following https://developers.google.com/shopping-content/guides/how-tos/testing on testing the Content API. The Nuget package version is the most up-to-date Google.Apis.ShoppingContent.v2_1 1.51.0.2261.

I am running the test locally (localhost), and have also tried to create a New API key in Content API page inside Google Merchant Center directly, and it doesn't work neither. Both ended up creating a service account respectively. (Account access page in Google Merchant Center show those service accounts as Pending)

Here is the code snippet. 
string[] scopes = new string[] { ShoppingContentService.Scope.Content };
var credential = GoogleCredential.FromFile("content-api-key.json").CreateScoped(scopes);
var service = new ShoppingContentService(new BaseClientService.Initializer
{
    ApplicationName = "Test App Name",
    HttpClientInitializer = credential
});
var authinfo = service.Accounts.Authinfo().Execute();

And AccountIdentifiers is always null. I could see content-api-key.json loaded just fine while debugging. I am the sole owner and user of the Account. The API Key json file was downloaded directly as I was creating the New API key. 

I know this looks simple, but I cannot see where an error could come from.

Thanks in advance!

Shopping API Forum Advisor Prod

unread,
Mar 30, 2021, 3:02:52 AM3/30/21
to lxw...@gmail.com, google-content-...@googlegroups.com

Hello there,

 

I’m James from the Content API team. Thank you for reaching out to us.

 

It appears that you already created a separate thread on our private channel which we have already responded to. For better tracking of your concern, please let us continue our discussion on the existing thread that you created on our private channel.

 

Regards,

Google Logo
James Howell Abarsoza
Content API for Shopping Team
 

 



ref:_00D1U1174p._5004Q2EoB85:ref
Reply all
Reply to author
Forward
0 new messages