סקירה כללית על Google Chat API
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בדף הזה מופיעה סקירה כללית על השימוש ב-Google Chat API ועל מסמכי העיון שלו.
ל-Google Chat API יש ממשקי gRPC ו-REST, וגם ספריות לקוח שתומכות בשניהם. לחלופין, אם ספריות הלקוח שסופקו לא מתאימות לצרכים שלכם, אתם יכולים לכתוב ספריות לקוח משלכם שמשתמשות בממשק gRPC או REST.
ספריות לקוח
הדרך המומלצת לרוב המפתחים לקרוא ל-Google Chat API היא באמצעות ספריות הלקוח של Cloud שנתמכות באופן רשמי בשפה המועדפת עליכם, כמו Python, Java או Node.js.
אם אתם כותבים קוד באמצעות Google Apps Script, אתם יכולים להשתמש בשירות המתקדם של Chat במקום להתקין ספריית לקוח.
סוג, שיטה ושמות שדות
הסוג, השיטה ושמות השדות של Google Chat API משתנים בהתאם לשימוש בספריות לקוח, ב-gRPC או ב-REST:
- ספריות הלקוח ב-Cloud מסודרות לפי שירותי gRPC והשיטות שלהם.
ספריות הלקוח של Google API מסודרות כשירותים שמכילים אובייקטים או מחלקות שתואמים למשאבי REST, שמכילים גם שיטות תואמות.
- פרוטוקול gRPC מסודר לפי שירותים והשיטות שלהם.
- ממשק REST מסודר לפי היררכיות של משאבים והשיטות שלהם.
- שמות השדות ב-gRPC הם בפורמט snake case.
- שמות השדות ב-REST הם בפורמט CamelCase, אבל שירות ה-API יקבל גם פורמט CamelCase וגם פורמט SnakeCase.
- שמות השדות בספריית הלקוח הם באותיות רישיות בתחילת כל מילה, בשיטת CamelCase או בשיטת SnakeCase,
בהתאם לשם שמתאים לשפה.
מאגרי אחסון לפרוטוקולים
בין אם אתם משתמשים בספריות לקוח, ב-REST או ב-gRPC, השירות הבסיסי מוגדר באמצעות מאגרי פרוטוקולים. באופן ספציפי, השירות משתמש ב-proto3.
כששולחים קריאה ל-API, יכול להיות שיהיה צורך בהבנה בסיסית של סוגים מוכרים של מאגרי פרוטוקולים בשדות מסוימים של בקשות או תגובות.
בנוסף, כשקוראים ל-REST API, יכול להיות ששדות יחסרו בתגובת JSON בגלל התנהגות ערך ברירת המחדל של מאגרי פרוטוקולים. הערכים בשדות האלה הם ערכי ברירת המחדל, ולכן הם לא נכללים בתגובה.
גרסאות API
הגרסאות הבאות של ה-API זמינות:
תצוגה מקדימה למפתחים
יכול להיות שתראו במסמכים שדות או methods של API שזמינים רק דרך תוכנית Developer Preview. כדי לבדוק את התכונות החדשות בגרסת הטרום-השקה, לראות תצוגה מקדימה שלהן ולשלוח משוב, אפשר להצטרף לתוכנית טרום-ההשקה למפתחים.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-29 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-29 (שעון UTC)."],[[["\u003cp\u003eThis page offers guidance on utilizing the Google Chat API and navigating its reference documentation, including gRPC and REST interfaces.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers are encouraged to use the provided client libraries for Python, Java, Node.js, or the Advanced Chat service for Google Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eType, method, and field names may vary slightly depending on whether you are using client libraries, gRPC, or REST, with details provided on their respective conventions.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Chat API is built upon protocol buffers, specifically proto3, which may require a basic understanding for certain request and response fields.\u003c/p\u003e\n"],["\u003cp\u003eStable API version v1 is currently available, with access to developer preview features obtainable through the Developer Preview Program.\u003c/p\u003e\n"]]],["The Google Chat API offers gRPC and REST interfaces, with corresponding client libraries or the option to create custom ones. Developers can use Cloud Client Libraries, or the Advanced Chat service with Google Apps Script. Type, method, and field names vary across libraries, gRPC, and REST. The API relies on protocol buffers (proto3), which can impact JSON responses due to default value behavior. The current stable version is v1, with a Developer Preview program for testing new features.\n"],null,["# Google Chat API overview\n\nThis page provides an overview of how to use Google Chat API and its reference\ndocumentation.\n\nGoogle Chat API has both [gRPC](/workspace/chat/api/reference/rpc) and\n[REST](/workspace/chat/api/reference/rest) interfaces, and\n[client libraries](/workspace/chat/libraries) that support both. Optionally, if\nthe provided client libraries don't meet your needs, you can write your own\nclient libraries that use the gRPC or REST interface.\n\nClient libraries\n----------------\n\nThe recommended way for most developers to call the Google Chat API\nis with our officially supported\n[Cloud Client Libraries](/workspace/chat/libraries)\nfor your preferred language, like Python, Java, or Node.js.\n\nIf you're coding with Google Apps Script, use the\n[Advanced Chat service](/apps-script/advanced/chat)\ninstead of installing a client library.\n\nType, method, and field names\n-----------------------------\n\nDepending on whether you're using client libraries, gRPC, or REST, the type,\nmethod, and field names for the Google Chat API vary somewhat:\n\n- Cloud Client Libraries are arranged by gRPC services and their methods. Google API Client Libraries are arranged as services that contain objects or classes that correspond with REST resources, which also contain corresponding methods.\n- gRPC is arranged by services and their methods.\n- REST is arranged by resource hierarchies and their methods.\n- gRPC field names use snake case.\n- REST field names use camel case, though the API service will accept either camel case or snake case.\n- Client library field names use either title case, camel case or snake case, depending on which name is idiomatic for the language.\n\nProtocol buffers\n----------------\n\nWhether you are using client libraries, REST, or gRPC, the underlying service is\ndefined using [protocol buffers](/protocol-buffers). In particular, the service\nuses [proto3](/protocol-buffers/docs/proto3).\n\nWhen calling the API, some request or response fields can require a basic\nunderstanding of\n[protocol buffer well-known types](/protocol-buffers/docs/reference/google.protobuf).\n\nIn addition, when calling the REST API, the\n[default value](/protocol-buffers/docs/proto3#default) behavior for protocol\nbuffers may result in missing fields in a JSON response. These fields are\nset to the default value, so they are not included in the response.\n\nAPI versions\n------------\n\nThe following API versions are available:\n\n- **v1**: Stable.\n\nDeveloper Preview\n-----------------\n\nIn the documentation, you might see API methods or fields that are only\navailable through the Developer Preview Program. To test and preview and offer\nfeedback on the latest preview features, join the\n[Developer Preview Program](/workspace/preview).\n\nRelated topics\n--------------\n\n- [Call the Google Chat API](/workspace/chat/api-overview)"]]