I am trying to read what has changed in my location while I have received GOOGLE_UPDATE notification from Google Business Profile API. The documentation is found here: locations.getGoogleUpdated
The result in playground is shown in the photo:
The result is the same in Java:
String locationId="locations/"+rec.locationName.split("locations/")[1];
String url="https://mybusinessbusinessinformation.googleapis.com/v1/locations/"+locationId +":googleUpdated";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.GET()
.header("Authorization", "Bearer " + accessToken)
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(" statusCode "+ response.statusCode());
And the response for all the Google_Update notifications is statusCode 404
What is wrong in my code or request?
I was using the old API, the correct one is [Method: locations.getGoogleUpdated][1]
so the URL would be
GET https://mybusinessbusinessinformation.googleapis.com/v1/{name=locations/*}:getGoogleUpdated
and the readMask
needs to be set