readMask value to get the display names form new GMB API

1.2k Views Asked by At

I am running this line of code:

    location_list = self.service_mbbi_v1.accounts().locations().list(parent=account_name,readMask='name').execute()

And I get the list of the location IDs but I don't manage to get the Location display name, the display name, not just the ID. I wrote google and told them about my issue and they told me they are looking into it but it has been 2 weeks and no response yet. So just wanted o see if someone else had the same issue and if they fpund a solution or a workaround.

The documentation provides only an example, not a list of possible values: https://developers.google.com/my-business/reference/businessinformation/rest/v1/accounts.locations/list

And even when I try the example value of the readMask flag I get an error: [{'@type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'read_mask', 'description': 'Invalid field mask provided'}]}]">

I found this similar question: Google Business Profile API readMask

The example they provide work for me but I still can't get the display name value.

I thought of using the google place ID I get from the metadata response and see if I can use another API to find the name but it feels they should be a proper 'readMask' string vale for the display name here and it is not 'displayName'..

Has anyone a hint of what can I do?

Thanks a lot

1

There are 1 best solutions below

2
On

If you are trying to get the business name data, your readMask should be 'title'.