401 Unauthorized trying to get the products in Merchant Center account

395 visningar
Hoppa till det första olästa meddelandet

rafa....@rocketroi.com

oläst,
23 jan. 2017 07:13:422017-01-23
till 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)

oläst,
23 jan. 2017 13:29:482017-01-23
till 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
Svara alla
Svara författaren
Vidarebefordra
0 nya meddelanden