401 Unauthorized trying to get the products in Merchant Center account

384 views
Skip to first unread message

rafa....@rocketroi.com

unread,
Jan 23, 2017, 7:13:42 AM1/23/17
to AdWords API Forum
I'm trying to get the products from a Merchan Center account but i'm getting a 401 Unauthorized error.

My code is:

ShoppingContent.Products.List productsList = content.products().list(BigInteger.valueOf(merchantId)).setMaxResults(PAGE_SIZE);
ProductsListResponse page = productsList.execute();


And the error I'm getting is:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 401 Unauthorized
{
 
"code" : 401,
 
"errors" : [ {
   
"domain" : "global",
   
"location" : "Authorization",
   
"locationType" : "header",
   
"message" : "Login Required",
   
"reason" : "required"
 
} ],
 
"message" : "Login Required"
}

What could be the cause of the problem?

Vishal Vinayak (Adwords API Team)

unread,
Jan 23, 2017, 1:29:48 PM1/23/17
to AdWords API Forum
Hi Rafa,

To confirm, are you using AdWords API for this purpose? In case you are using Content API for Shopping, I would recommend posting your query on this forum

Regards,
Vishal, AdWords API Team
Reply all
Reply to author
Forward
0 new messages