מתן הרשאה לאפליקציות של Google Chat לייבא נתונים
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
באמצעות Google Chat API, אפליקציות יכולות לייבא נתונים מפלטפורמות אחרות להעברת הודעות לתוך מרחבים ב-Google Chat באמצעות מצב ייבוא. מידע נוסף מופיע במאמר ייבוא נתוני הודעות ל-Google Chat משירות אחר.
כדי לקרוא ולכתוב משאבים במרחבים במצב ייבוא, צריך לאמת אפליקציות ל-Chat באמצעות חשבון שירות.
אדמין צריך להעניק לחשבון השירות את היקף ההרשאות הבא של Chat API: https://www.googleapis.com/auth/chat.import
.
רק אדמינים של דומיינים ב-Google Workspace יכולים להעניק את היקף ההרשאות הזה של OAuth לחשבונות שירות באמצעות הענקת הרשאות גישה ברמת הדומיין.
לכל דומיין שבו אפליקציית Chat יוצרת מרחבים במצב ייבוא צריכה להיות הרשאת OAuth הזו. אחרי שחשבון השירות מקבל הרשאת גישה ברמת הדומיין להיקף הזה, אפליקציות ל-Chat יכולות לגשת למרחבים במצב ייבוא על ידי התחזות לחשבון משתמש.
במקרים מסוימים, יכול להיות שחשבון המשתמש שמשמש להתחזות כבר לא זמין. במקרים כאלה, אפליקציית Chat יכולה להשתמש בפרטי הכניסה של חשבון השירות כגיבוי. לדוגמה, אם תמחקו חשבון משתמש ששימש ליצירת הודעה, אפליקציית Chat יכולה להשתמש בפרטי הכניסה של חשבון השירות שלה כדי ליצור הודעה עם אותו תוכן. לאפליקציות ל-Chat יש גישה למרחבים במצב ייבוא כאפליקציה שמשתמשת בפרטי כניסה של חשבון שירות עם היקף ההרשאות הבא של OAuth: https://www.googleapis.com/auth/chat.bot
.
לא נדרשים היקפי הרשאות אחרים של Google Chat API כשמייבאים משאבים למרחב במצב ייבוא.
אפליקציות של Chat יכולות לייבא תוכן רק למרחבים במצב ייבוא שהן יוצרות, ולא למרחבים במצב ייבוא שאפליקציות אחרות יוצרות.
בטבלה הבאה מפורטים המשאבים שאפליקציות ל-Chat יכולות להפעיל במרחבים במצב ייבוא, וסוגי האימות שהם תומכים בהם:
שיטת משאב |
תמיכה בהתחברות זמנית כמשתמש אחר |
פרטי כניסה נתמכים לחשבון שירות |
spaces.create
|
כן |
לא |
spaces.get
|
לא |
כן |
spaces.update
|
כן |
לא |
spaces.delete
|
כן |
לא |
spaces.completeImport
|
כן |
לא |
spaces.messages.create
|
כן |
כן |
spaces.messages.delete
|
כן |
כן |
spaces.messages.get
|
לא |
כן |
spaces.messages.list
|
כן |
לא |
spaces.messages.update
|
כן |
כן |
spaces.messages.reactions.create
|
כן |
לא |
spaces.messages.reactions.delete
|
כן |
לא |
spaces.members.create
|
כן |
לא |
spaces.members.delete
|
כן |
לא |
spaces.members.list
|
כן |
לא |
media.upload
|
כן |
לא |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-29 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-29 (שעון UTC)."],[[["\u003cp\u003eGoogle Chat API allows importing data from other platforms into Google Chat using import mode spaces.\u003c/p\u003e\n"],["\u003cp\u003eChat apps require specific authentication and authorization to read and write resources in these spaces, needing domain administrator approval.\u003c/p\u003e\n"],["\u003cp\u003eApps can impersonate user accounts or utilize their service account credentials for specific actions within import mode spaces.\u003c/p\u003e\n"],["\u003cp\u003eImport mode spaces support various resource methods with differing authentication requirements, as detailed in the provided table.\u003c/p\u003e\n"],["\u003cp\u003eChat apps can only import content into spaces they create and not into spaces created by other apps.\u003c/p\u003e\n"]]],["Apps use the Google Chat API's import mode to bring data from other platforms into Google Chat. This requires authentication with a service account granted the `https://www.googleapis.com/auth/chat.import` scope via domain-wide delegation by a Google Workspace admin. Apps can impersonate user accounts or use service account credentials (`https://www.googleapis.com/auth/chat.bot`). Only specific resource methods are supported in import mode spaces. Import mode is exclusive, meaning apps can only modify spaces they create.\n"],null,["# Authorize Google Chat apps to import data\n\nWith the Google Chat API, apps can import data from other messaging platforms into\nGoogle Chat by using *import mode* spaces. For more information, see\n[Import message data to Google Chat from another service](https://support.google.com/a/answer/13465849).\n\nTo read and write resources in import mode spaces, you must\n[authenticate Chat apps with a service account](/workspace/chat/authenticate-authorize-chat-app).\nGrant the service account the following Chat API authorization scope\nby an administrator: `https://www.googleapis.com/auth/chat.import`.\n\nOnly Google Workspace domain administrators can grant this OAuth scope to\nservice accounts through\n[domain-wide delegation](/identity/protocols/oauth2/service-account#delegatingauthority).\nEvery domain that a Chat app creates import mode spaces\nin must have this OAuth scope. After the service account has been delegated\ndomain-wide authority for this scope, Chat apps can access import\nmode spaces by\n[impersonating a user account](/identity/protocols/oauth2/service-account#authorizingrequests).\n\nIn some scenarios, the user account for impersonation might no longer be\navailable. In these cases, the Chat app can use their\nservice account credentials as a fallback. For example, if you delete a user\naccount that was used during message creation, the\nChat app can use their own service account credentials\nto create a message containing the same contents. Chat apps can\naccess import mode spaces as an app using service account credentials with the\nfollowing OAuth scope: `https://www.googleapis.com/auth/chat.bot`.\n\nNo other [Google Chat API scopes](/workspace/chat/authenticate-authorize#scopes)\nare required when importing resources into an import mode space.\nChat apps can only import content into the import mode spaces\nthat they create, and not into the import mode spaces created by other apps.\n\nThe following table lists the resource methods that Chat apps can\ncall in import mode spaces, and what kind of authentication they support:\n\n| Resource method | User impersonation supported | Service account credentials supported |\n|------------------------------------|------------------------------|---------------------------------------|\n| `spaces.create` | Yes | No |\n| `spaces.get` | No | Yes |\n| `spaces.update` | Yes | No |\n| `spaces.delete` | Yes | No |\n| `spaces.completeImport` | Yes | No |\n| `spaces.messages.create` | Yes | Yes |\n| `spaces.messages.delete` | Yes | Yes |\n| `spaces.messages.get` | No | Yes |\n| `spaces.messages.list` | Yes | No |\n| `spaces.messages.update` | Yes | Yes |\n| `spaces.messages.reactions.create` | Yes | No |\n| `spaces.messages.reactions.delete` | Yes | No |\n| `spaces.members.create` | Yes | No |\n| `spaces.members.delete` | Yes | No |\n| `spaces.members.list` | Yes | No |\n| `media.upload` | Yes | No |\n\nRelated topics\n--------------\n\n- To learn more about authentication and authorization, see [Authenticate and authorize Google Chat apps and API requests](/workspace/chat/authenticate-authorize).\n- To learn how to set up a service account to access the Google Chat API, see [Authenticate as a Google Chat app](/workspace/chat/authenticate-authorize-chat-app).\n- To learn how to start importing resources using import mode spaces, see [Import data to Google Chat](/workspace/chat/import-data)."]]