googleapis / googleapis/google-api-php-client-services

Can't use PATCH for Business Information

Open
#6,605 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
1.3k
Forks
320
Avg merge
2h 32m
Merged PRs (30d)
193

Description

Hi there,
I've gotten pretty much everything working nicely except for any function requiring HTTP: PATCH.
For example, updating Location data for a Google Business Profile.
Here's my code:

```
$locationData = (object) [
'title' => "MY_NEW_LOCATION_PROFILE_TITLE"
];
$locationData = json_encode($locationData);

$locationName = 'locations/###################'; // Checked and confirmed using get()!
$params['updateMask'] = 'title'; // Field updated
$serviceBusiness = new Google_Service_MyBusinessBusinessInformation($client);
$updateLocation = $serviceBusiness->locations->patch($locationName, $locationData, $params);
vard_dump($updateLocation);
```

The $client is good because I can run locations->get() and accounts_locations->listAccountsLocations() and even categories->listCategories() without issue. I confirmed the $locationName using locations->get().

But for some reason locations->patch() always dies. I believe it is because of the PATCH http type (as opposed to GET or POST).

Any ideas??

Cheers,
Richard :)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.