The Google Chat API updates are in developer preview. To make use of the API, builders can apply for entry via our Google Workspace Developer Preview Program.
With the launch of the Google Chat API, builders have been capable of lengthen their Chat apps to let customers ship and obtain messaging knowledge between Google Chat and different methods. This real-time collaboration is a important think about Chat apps being utilized in incident administration, helpdesk help, workflow automations, and extra.
So as to additional improve Chat apps for real-time collaboration, we’re excited to announce that Chat apps can now create areas and memberships – utilizing software id – via the Google Workspace Developer Preview Program through the Google Chat API!
What does this imply for builders?
Chat apps beforehand have been capable of create areas and memberships on behalf of customers. Now, a Chat app can create areas and memberships utilizing its personal software id – while not having to create these on behalf of a consumer – to permit for much more subtle and autonomous Chat apps.
For instance in an incident administration situation, a Chat app can shortly create an area, with none members, if it detects an incident or a service not responding. This Chat app can proceed to diagnose and troubleshoot the difficulty, writing messages into the Chat house, and when the Chat app has decided the right groups to loop in, it may add within the acceptable incident commanders, web site reliability engineers and help groups, and anybody else wanted to assist resolve the difficulty.
Be taught extra and get began
You may allow this functionality with new Chat app-specific OAuth scopes. Utilizing these software scopes, Chat apps can create areas, create messages, delete areas that the app created, and extra.
Code snippet of the brand new Chat software scopes and making a Chat house utilizing the appliance id:
const auth = new chat.auth.GoogleAuth({
keyFilename: 'credentials.json',
scopes: [
'https://www.googleapis.com/auth/chat.app.spaces.create',
'https://www.googleapis.com/auth/chat.app.spaces',
'https://www.googleapis.com/auth/chat.app.delete',
'https://www.googleapis.com/auth/chat.app.memberships'
]
});
const authClient = await auth.getClient();
chatClient await chat.chat({
model: 'v1',
auth: authClient
});
house = await chatClient.areas.create({
requestBody: {
spaceType: 'SPACE',
displayName: 'Incident Administration house',
buyer: 'clients/my_customer'
}
});