I have a simple apps script project that creates a Space in G-Chat and later will add some users to it. Very simple and it worked many times until this morning when I started getting an error:
Access blocked: Authorization Error
Some requested scopes cannot be shown: [https://www.googleapis.com/auth/chat.import]
I have been working on resolving this all day with no luck. I have stripped the complexity back to this:
function createSpace(projectName) {
var space = Chat.Spaces.setup({
space: {
spaceType: ‘SPACE’,
displayName: projectName
}
});
Logger.log(space.name);
}
I have checked the Google Cloud Console:
- Google Chat API is enabled and Configured
- using OAuth 2.0 Client IDs
- OAuth consent screen is sup for Internal
I tried manually adding the scope (https://www.googleapis.com/auth/chat.import), but it just gives a red “?” circle. I have also added all Google Chat API scopes explicitly to try and get this resolved.
I appreciate any ideas you may have.