Google Chat API - spaces:search error 400 INVALID ARGUMENT

Hi 

I'm evaluating the chat api useAdminAccess functionalities and have an issue with the spaces:search query - would appreciate if anyone has any ideas/experience to share.

So far I can

Add a member to a space
Make a manager of a space
Update target audience of a space

If you wanted to loop that activity for a domain wide update you would need the space information.  I was thinking you could use the space:search along with a query parameter - but it seems just not to be working when I try with any combination of query parameters.  The documentation states the customer id needs to be specified so I specify this but seems like it does not recognise any queries.

Search parameter documentation can be found here

Anyone able to get this working?  Perhaps I need to raise an bug for issue tracking....

(admin account required to test and UseAdminAccess parameter enabled)

 

{
"error": {
"code": 400,
"message": "Invalid search query: customer=customer/####abcd4",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "For example search queries, see the search spaces method reference documentation.",
"url": "https://developers.google.com/chat/api/reference/rest/v1/spaces/search"
}
]
}
]
}
}

 

 

Solved Solved
0 1 583
1 ACCEPTED SOLUTION

Just to share, whatever bug behind the scenes causing this has now been resolved and works.

So if you want to export all of the spaces in your tenant , you can do so via this command

https://chat.googleapis.com/v1/spaces:search?useAdminAccess=true&query=customer = "customers/my_customer" AND spaceType ="SPACE"

You could then take the output and add an admin account to a space and then make the admin account space manager if you needed to update settings such as target audiences en mass.  (Would be more logical to just allow the useAdminAccess flag to allow modification of any space without being  a space member.  Export of all space information from admin console to Sheet would also be a level up IMO)

 

 

View solution in original post

1 REPLY 1

Just to share, whatever bug behind the scenes causing this has now been resolved and works.

So if you want to export all of the spaces in your tenant , you can do so via this command

https://chat.googleapis.com/v1/spaces:search?useAdminAccess=true&query=customer = "customers/my_customer" AND spaceType ="SPACE"

You could then take the output and add an admin account to a space and then make the admin account space manager if you needed to update settings such as target audiences en mass.  (Would be more logical to just allow the useAdminAccess flag to allow modification of any space without being  a space member.  Export of all space information from admin console to Sheet would also be a level up IMO)

 

 

Top Solution Authors