My Business
1.8K members online now
1.8K members online now
For developers who are using the Google My Business API to manage locations
Guide Me
star_border
Reply

Request contains an invalid argument. [400], when trying to patch the Location.

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

HI!

 

I am trying to update location product photos using patch Method, but it fails with "Request contains an invalid argument. [400]".

 

But when I am trying to update additional photos only the request succeds.

 

I am using C# Client Lib, together with the latest version of Google NUGet packages.

 

Here is my reqest details from fiddler for the additionalPhotos plus productPhotos patch request:

PATCH /v3/accounts/***/locations/***?languageCode=en&validateOnly=False&fieldMask=photos.additionalPhotoUrls%2Cphotos.productPhotoUrls

Request body

{"languageCode":"EN","photos":{"additionalPhotoUrls":["https://***/800x600-0110_7.jpg","https://****/800x600-0110_8.jpg"],"productPhotoUrls":["https://***/800x600-0110_1.jpg","https://***/800x600-0110_2.jpg","https://***/800x600-0110_4.jpg","https://***/800x600-0110_5.jpg"]}}

 

Here is my reqest details from fiddler for the  productPhotos patch request:

PATCH /v3/accounts/***/locations/***?languageCode=en&validateOnly=False&fieldMask=photos.productPhotoUrls

Request body

{"languageCode":"EN","photos":{"productPhotoUrls":["https://***/800x600-0110_1.jpg","https://***/800x600-0110_2.jpg","https://***/800x600-0110_4.jpg","https://***/800x600-0110_5.jpg"]}}

 

*** replaces some url and location name parts.

 

Thanks for any suggestions and answers.

1 Expert replyverified_user

Re: Request contains an invalid argument. [400], when trying to patch the Location.

Google Employee
# 2
Google Employee

Hi @Константин К,

 

Please make sure that the location you are uploading the photos to has an associated Google+ page, as indicated by a plusPageId in the LocationKey, since photos are supported only with a Google+ page, and the photos meet the Google My Business guidelines and the specifications of the Photos object documented on our Google Developers site.

 

In addition, since the C# client library doesn’t currently support the display of detailed error messages, we suggest you follow the Make a simple HTTP request step-by-step guide on the Google Developers site to learn how to use the OAuth 2.0 Playground for troubleshooting errors with detailed error messages when sending requests with data via the Google My Business API.

 

Thanks,

Shalini