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

Java client library v3.2 still references v2 REST API

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I followed all the steps on the following page:

https://developers.google.com/my-business/content/get-started
Under "Make a simple HTTP request", steps 1 - 12.

I did get a response that shows 200 OK.

Then I tried:
https://developers.google.com/my-business/content/set-up-java-client
The code sample under "Implement the OAuth 2.0 authorization flow"

// Uses the 'mybusiness' instance to send an API call.
Mybusiness.Accounts.List accountsList = mybusiness.accounts().list();
ListAccountsResponse response = accountsList.execute();
List accounts = response.getAccounts();

The accountsList has a size of 0, and accountsList.execute() gives me the following error:

 

 

com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found

...

...

at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1056)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)

 

So I tried to make request on the OAuth 2.0 Playground with v2 and v3 REST API endpoints.  I got a 202 with 

https://mybusiness.googleapis.com/v3/accounts and a 404 with 

https://mybusiness.googleapis.com/v2/accounts

 

I looked into the java objects in the v3.2 java client library and a lot of them still referencing v2 REST path.  For example, in com.google.api.services.mybusiness.v2.Mybusiness.java in the 3.2 jar, line 306:

private static final String REST_PATH = "v2/accounts";

 I believe the v3.2 jar needs to be updated with v3 REST paths and objects.

1 Expert replyverified_user

Re: Java client library v3.2 still references v2 REST API

Google Employee
# 2
Google Employee

Hi @YP M,

 

We will look into this issue and get back to you soon. Thanks for your patience.

 

Thanks,

The Google My Business API team

Re: Java client library v3.2 still references v2 REST API

Google Employee
# 3
Google Employee

Hi @YP M,

 

We've posted the updated client libraries. Please check and let us know if you are still facing the same issue.

 

Please feel free to contact us for any Google My Business API related questions.

 

Thanks,

The Google My Business API team