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

Method ListAccounts not found for service mybusiness.googleapis.com

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I am using the following snippet to access the API via node.js and a service account:

let google = require('googleapis');
let GMB = require('google_my_business');
let key = require('./PATH_TO_FILE/file.json');
let jwtClient = new google.auth.JWT(
  key.client_email,
  null,
  key.private_key,
  ['https://www.googleapis.com/auth/plus.business.manage'],
  null
);

jwtClient.authorize(function (err, tokens) {
  if (err) {
    console.log(err);
    return;
  }
  console.log(tokens);
  GMB.options({version: 'v3'});
  GMB.setAccessToken(tokens.access_token);
  GMB.api('accounts', 'get', {}, function (res) {
    if(!res || res.error) {
      console.log(!res ? 'error occurred' : res.error);
      return;
    }
    console.log(res);
  });
});

Authorization seems to be fine and gives back an access_token etc.:

{ 
  access_token: 'THE_TOKEN',
  token_type: 'Bearer',
  expiry_date: 1493025985000,
  refresh_token: 'jwt-placeholder' 
}

The subsequent method ListAccounts answers with

{
  "error": {
    "code": 404,
    "message": "Method ListAccounts not found for service mybusiness.googleapis.com",
    "status": "NOT_FOUND"
  }
}

This looks like this behaviour:
https://www.en.advertisercommunity.com/t5/forums/v3_1/forumtopicpage/board-id/gmb-api/thread-id/3082

How can we determine if the corresponding project is the one Google has whitelisted for access to the My-Business-API?

 

TIA

Ruediger

1 Expert replyverified_user

Re: Method ListAccounts not found for service mybusiness.googleapis.com

Google Employee
# 2
Google Employee

Hi @Ruediger S,

 

The 404 Method not found error typically happens when you are using a different Project ID from the one we whitelisted for your company to access the Google My Business API.

 

We’ll reach out to you privately in a separate email thread for more details.

 

Thanks,

The Google My Business API team

Method ListAccounts not found for service mybusiness.googleapis.com

[ Edited ]
Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi @Shalini S, I'm receiving this same error and I'm wondering if it's because my Project ID isn't whitelisted. I initially integrated it on a different project that has a different Project ID. Would you be able to assist me as well?

 

Thanks!

Re: Method ListAccounts not found for service mybusiness.googleapis.com

Google Employee
# 4
Google Employee

Hi @Jason M,

 

The 404 Method not found error typically happens when you are using a different Project ID from the one we whitelisted for your company to access the Google My Business API.

 

We’ll reach out to you privately in a separate email thread for more details.

 

Thanks,

The Google My Business API team

Method ListAccounts not found for service mybusiness.googleapis.com

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi @Shalini S,

I am having the same issue and wonder if it is because I am now using a different project ID within my same developer account. I still need to keep the original, is there any way you can help?

Re: Method ListAccounts not found for service mybusiness.googleapis.com

Google Employee
# 6
Google Employee

Hi @Kieran H,

 

We’ll reach out to you privately in a separate email thread for more details.

 

Thanks,

The Google My Business API Team

Method ListAccounts not found for service mybusiness.googleapis.com

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Hi @Shalini S,
 
I do receive the same error message when requesting data on https://developers.google.com/oauthplayground/ follwing the get started guide https://developers.google.com/my-business/content/get-started.
**
{
  "error": {
    "status": "NOT_FOUND",
    "message": "Method ListAccounts not found for service mybusiness.googleapis.com",
    "code": 404
  }
}
**

Authorization process and request URL seem fine (https://mybusiness.googleapis.com/v3/accounts/)

> is there anything I can do to get this to work?

Re: Method ListAccounts not found for service mybusiness.googleapis.com

Google Employee
# 8
Google Employee

Hi @Iso F,

 

Judging from your email address on this board, your may not have a whitelisted project to access the Google My Business API, so before you use the Google My Business API, you need to have a whitelisted project to access them.

 

You can check out the Prerequisites page of our Google Developers site to learn more about requesting access to the API.

 

Please do let me know if you have any questions!

 

Thanks,

Shalini, The Google My Business API team

Method ListAccounts not found for service mybusiness.googleapis.com

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

Hi

 

I have the same problem. When I follow this post https://developers.google.com/my-business/content/get-started#make_a_simple_http_request I get the error 

{
 
"error": {
   
"status": "NOT_FOUND",
   
"message": "Method not found.",
   
"code": 404
 
}
}

Please help me :-)

Re: Method ListAccounts not found for service mybusiness.googleapis.com

Google Employee
# 10
Google Employee

Hi @Imerco A,

 

The 404 Method not found error typically happens when you are using a different Project ID from the one we whitelisted for your company to access the Google My Business API.

 

We’ll reach out to you privately in a separate email thread for more details.

 

Thanks,

Shalini, The Google My Business API team