Open ahsanaasim opened 4 months ago
I went through the gaxios.js
file and added the following lines after line 142.
console.log("================")
console.log(response)
console.log(response.statusCode)
console.log("translatedResponse")
console.log(JSON.stringify(translatedResponse.data))
console.log("================")
That way i am getting the real error from Google API. I found that there are some more required fields. So, I added them. Now getting another error saying
{"error":{"code":403,"message":"Unable to create due to: REASON_GOLA_CREATION_DISALLOWED_IN_INCORRECT_GROUP_TYPE","errors":[{"message":"Unable to create due to: REASON_GOLA_CREATION_DISALLOWED_IN_INCORRECT_GROUP_TYPE","domain":"global","reason":"forbidden"}],"status":"PERMISSION_DENIED"}}
Looking into the matter. I will update here
It seems, A location cannot be added under an Organization Account. Therefore, I created a Location Group Account under the Organization and used that Location Group Account ID. Finally it worked.
I created a location group using the following code.
const createLocationGroup = async (auth, groupName, primaryOwner) => {
const mybusinessaccountmanagement = google.mybusinessaccountmanagement('v1');
try {
const response = await mybusinessaccountmanagement.accounts.create({
auth: auth,
requestBody: {
accountName: groupName,
primaryOwner: 'accounts/' + primaryOwner,
type: 'LOCATION_GROUP'
}
});
return response.data;
} catch (error) {
console.error('Error creating location group:', error);
throw error;
}
};
I have another question. How these values are added in the map. Which attributes are they?
Hi @ahsanaasim,
I am getting the same error as you do.
Could you please guide me how did you get the Account ID? I can't find the Account ID placed in the google interface
I am using Google's Business API to add a location from my Node.js application, but I'm encountering the following error:
I am using the
googleapis
npm package and tried by commenting out all optional fields, leaving only the required fields in the request body. But, I'm still encountering an error. Here is my code:here is detailed log
Also, Is there detailed documentation available for the Google Business API in the googleapis npm package?
I am following the following URL for creating the request body
https://developers.google.com/my-business/reference/businessinformation/rest/v1/accounts.locations#Location
I have asked the same question in stackoverflow. https://stackoverflow.com/questions/78817586/getting-invalid-argument-error-from-google-business-profile-api-while-trying-to