AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

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

Patch for Exterior Photos

[ Edited ]
Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

Dear all. I'm working on the PATCH method for some locations.


I already done the cover and profile photo update, but I got a error with the ExteriorPhotoUrls field mask. Could you guys give me some help? I tried to update the ExteriorPhotoUrls with one file URL and the array version.


$teste = array();
$teste[0] = "http://***.com/wp-content/themes/nerdmonster/images/VRM_header.jpg";
$photos = new Google_Service_Mybusiness_Photos();

try {
	$updatedlocation = $mybusinessService->accounts_locations->patch($name, $location, array( "languageCode"=>"pt-BR",'validateOnly' => false,"fieldMask"=>"photos.coverPhotoUrl, photos.exteriorPhotoUrls"));
	// $updatedlocation = $mybusinessService->accounts_locations->patch($name, $location, array( "languageCode"=>"pt-BR",'validateOnly' => false,"fieldMask"=>"websiteUrl,regularHours,openInfo,primaryCategory,primaryPhone,address" ));
echo "done";
 } catch (Exception $e) {
  	print "Caught exception: " . $e->getMessage() . "\n";


Kind Regards.


1 Expert replyverified_user

Patch for Exterior Photos

Follower ✭ ☆ ☆
# 2
Follower ✭ ☆ ☆

Hello all. Anyone knows how to use the patch feature for exterior photos using PHP? Thanks!

Re: Patch for Exterior Photos

Google Employee
# 3
Google Employee

Hi @Marcos L,


Can you specify the error that you are getting when updating ExteriorPhotoUrls via the Google My Business API? Please make sure 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 PHP client library doesn’t currently support the display of detailed error messages, so I suggest you follow the Make a simple HTTP request step-by-step guide on the Google Developers site and try use the OAuth 2.0 Playground to step through the auth flow, and examine the HTTP request/response at each step. This usually helps pinpoint where an application is passing the incorrect info.



The Google My Business API team

Patch for Exterior Photos

Follower ✭ ☆ ☆
# 4
Follower ✭ ☆ ☆

Hello @Shalini S.


I tried to update with the code that I provided but the photos are not updated. I don't know if is right or if I missed something. Could you please help me?