During developer preview phase, the "spaces.setup" method was working fine: we were able to send direct messages between our Chat App and users.
Since "spaces.setup" method has been released to GA, all requests return the following error message:
POST https://chat.googleapis.com/v1/spaces:setup
{
"code": 403,
"errors": [
{
"domain": "global",
"message": "The Chat app developer deactivated this app",
"reason": "forbidden"
}
],
"message": "The Chat app developer deactivated this app",
"status": "PERMISSION_DENIED"
}
I already checked all configs in cloud console to make sure app is enabled.
The new method "spaces.findDirectMessage", on the other hand, works as expected. Also, everything is fine when I add the Chat App to a space and create a message. So, I suspect there's a bug on the "setup" method.
Code of our client in Java:
HangoutsChat service = new HangoutsChat
.Builder(
GoogleNetHttpTransport.newTrustedTransport(),
GsonFactory.getDefaultInstance(),
getServiceAccountCredentials("{{Dest User Email}}", HangoutsChatScopes.CHAT_SPACES))
.setApplicationName("{{App Name}}").build();
SetUpSpaceRequest setUpSpaceRequest = new SetUpSpaceRequest();
Space space = new Space();
space.setSpaceType("DIRECT_MESSAGE");
space.setSingleUserBotDm(true);
setUpSpaceRequest.setSpace(space);
return service.spaces().setup(setUpSpaceRequest).execute();
Expected result: return of a new direct message (Space object) from chat app to user.
Actual behaviour: error 403 described above - "The Chat app developer deactivated this app".